Skip to content

Commit

Permalink
Merge pull request #41 from LSSTDESC/use-official-firecrown
Browse files Browse the repository at this point in the history
Use conda-released Firecrown version; update build
  • Loading branch information
fjaviersanchez authored Jan 23, 2024
2 parents 91fc88a + 2fd1c28 commit 109ed79
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 24 deletions.
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,42 @@ pip install --no-deps -e .

You are now ready to try a simple forecast as outlined in the next section.


-----------
## Installation using Conda

Because Augur depends upon Firecrown, and Firecrown requires installation using Conda, we use Conda to install Augur.

# clone the Augur repository
git clone [email protected]:LSSTDESC/augur.git

# conda env update, when run as suggested, is able to create a new environment, as
# well as updating an existing environment.
conda env update -f augur/environment.yml
conda activate forecasting

# The following line loads the firecrown module from the environment, and queries
# it to find the installation location.
FIRECROWN_DIR=$(python -c "import firecrown; print('/'.join(firecrown.__spec__.submodule_search_locations[0].split('/')[0:-1]))")

# We define some environment variables that will be defined whenever you activate
# the conda environment.
conda env config vars set AUGUR_DIR=${PWD}/augur CSL_DIR=${CONDA_PREFIX}/cosmosis-standard-library FIRECROWN_DIR=${FIRECROWN_DIR}
# The command above does not immediately define the environment variables.
# They are made available on every fresh activation of the environment.
# So we have to deactivate and then reactivate...
conda deactivate
conda activate forecasting
# Now we can finish building the CosmoSIS Standard Library.
source ${CONDA_PREFIX}/bin/cosmosis-configure
# We want to put the CSL into the same directory as conda environment upon which it depends
cd ${CONDA_PREFIX}
cosmosis-build-standard-library
# Now change directory into the Augur repository
cd ${AUGUR_DIR}
# And finally make an editable (developer) installation of firecrown into the conda environment
python -m pip install --no-deps --editable ${PWD}

## Usage

`augur` has changed from its initial version and currently only contains a
Expand Down
2 changes: 1 addition & 1 deletion augur/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.1.0"
__version__ = "0.1.1"
12 changes: 12 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: forecasting
channels:
- conda-forge
dependencies:
- firecrown
- healpy
- jinja2
- numpydoc
- pip
- pip:
- tjpcov
- qp
26 changes: 26 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[metadata]
name = augur
version = attr: augur._version.__version__
author = DESC Team
description = DESC Cosmology Forecasting Tool
long_description = file: README.md
long_description_content_type = text/markdown
url = https://github.com/LSSTDESC/augur
license_files = LICENSE

[options]
include_package_data = True
packages = find:
python_requires = >=3.9
install_requires =
firecrown
jinja2
healpy
numpydoc
qp

[options.packages.find]
exclude =
examples*
tests*

28 changes: 5 additions & 23 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,7 @@
import os
from setuptools import setup, find_packages
"""Setup script for augur.
"""

scripts = ['bin/augur']
from setuptools import setup

__version__ = None
pth = os.path.join(
os.path.dirname(os.path.realpath(__file__)),
"augur",
"_version.py")
with open(pth, 'r') as fp:
exec(fp.read())

setup(
name='augur',
version=__version__,
description="DESC Cosmology Forecasting Tool",
author="DESC Team",
packages=find_packages(),
include_package_data=True,
scripts=scripts,
install_requires=[
'pyccl', 'click', 'numpy', 'firecrown',
'scipy', 'pandas', 'pyyaml', 'jinja2'],
)
if __name__ == "__main__":
setup()

0 comments on commit 109ed79

Please sign in to comment.