From 6298a9fcf92df1d219fde9755aaa9a2a776c68d9 Mon Sep 17 00:00:00 2001 From: Marc Paterno Date: Tue, 10 Oct 2023 08:33:06 -0500 Subject: [PATCH 1/6] Add to environment to avoid pip installs on macOS WIP --- docs/developer_installation.rst | 68 ++++++++++++++++++++------------- environment.yml | 7 +++- 2 files changed, 47 insertions(+), 28 deletions(-) diff --git a/docs/developer_installation.rst b/docs/developer_installation.rst index 7792ffe17..b8aa2991b 100644 --- a/docs/developer_installation.rst +++ b/docs/developer_installation.rst @@ -12,25 +12,29 @@ Installation for development of Firecrown To do development work on Firecrown you need both the Firecrown source code and all the packages upon which Firecrown depends or is used with. To get the Firecrown source code you will need to clone the Firecrown repository. -Most (but not all) of the dependencies of Firecrown are available through conda. +Most (but not all) of the dependencies of Firecrown are available through `conda`. +We use `pip` to install only those dependencies not available through `conda`. These instructions include details on how to obtain the samplers used with Firecrown. -This is important because if you are doing development it is important to make sure what you change or add works with both of the supported samplers. +This is important because if you are doing development it is necessary to make sure what you change or add works with both of the supported samplers. You only need to clone the Firecrown repository once, and to create the conda environment once. Every time you want to do development in a new shell session you will need to activate the conda environment and set the environment variables. +You may need to update your conda environment periodically, to keep up with current releases of the packages on which Firecrown depends. +Instructions for doing so are found below. The continuous integration (CI) testing system used for Firecrown will run tests, execute examples, and employ a variety of code quality verification tools on every pull request. Failure by any one of these will cause the CI system to automatically reject the pull request. In order to make it easier to get your pull request passed, these instructions include all the necessary software in the conda environment used for development. Please see the end of this page for a listing of what the CI system will run, and how to run the same tests yourself. - +Note that the CI system is typically using the latest (compatible) version of all the Firecrown dependencies; this is one of the reasons it is best practice to keep the dependencies of your development environment up-to-date. Clone the Firecrown repository ============================== Choose a directory in which to work. In this directory, you will be cloning the Firecrown repository and later building some of the non-Firecrown code that is not installable through conda. +Note that this is *not* the directory in which the conda environment is created, nor is it the directory in which the CosmoSIS Standard Library (CSL) will be built. .. code:: bash @@ -42,10 +46,13 @@ Installation of dependencies These instructions will create a new conda environment containing all the packages used in development. This includes testing and code verification tools used during the development process. +We use the command `conda` in these instructions, but you may prefer instead to use `mamba`. +The Mamba version of Conda is typically faster when "solving" environments, which is done both on installation and during updates of the environment. It is best to execute these commands while in the same directory as you were in when you cloned the Firecrown repository above. The `cosmosis-build-standard-library` command below will clone and then build the CosmoSIS Standard Library. -This will create a directory `cosmosis-standard-library` in whatever is your current directory when you execute the command. +We recommend doing this in the directory in which the conda environment resides. +We have found this helps to make sure that only one version of the CSL is associated with any development efforts using the associated installation of CosmoSIS. .. code:: bash @@ -53,40 +60,43 @@ This will create a directory `cosmosis-standard-library` in whatever is your cur # well as updating an existing environment. conda env update -f firecrown/environment.yml conda activate firecrown_developer + # We define two environment variables that will be defined whenever you activate + # the conda environment. + conda env config vars set CSL_DIR=${CONDA_PREFIX}/cosmosis-standard-library FIRECROWN_DIR=${PWD}/firecrown + # The command above does not immediately defined 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 firecrown_developer + # 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 + pushd ${CONDA_PREFIX} cosmosis-build-standard-library - + popd Setting your environment for development ======================================== Each time you want to do development in a new shell session you need to activate the conda environment and set some environment variables. -Begin by `cd`-ing to the working directory you used during the installation (which should contain both `firecrown` and `cosmosis-standard-library` directories). +When you activate the conda environment, you can use the environment variable you defined when creating the environment to find your Firecrown directory: .. code:: bash - cd /path/to/directory/you/created/above conda activate firecrown_developer - export CSL_DIR=${PWD}/cosmosis-standard-library - export FIRECROWN_DIR=${PWD}/firecrown - export PYTHONPATH=${FIRECROWN_DIR}/build/lib + cd ${FIRECROWN_DIR} -To build the Firecrown code you should be in the Firecrown directory: +To "build" the Firecrown code you should be in the Firecrown directory: .. code:: bash - cd ${FIRECROWN_DIR} - python setup.py build + python -m pip install --no-deps --editable ${PWD} The tests can be run with :bash:`pytest`, after building: .. code:: bash - # We recommend removing the previous build and using the setup.py to build - # to more closely match what will be done when creating a new release. - rm -r build/ - python setup.py build python -m pytest -vv Examples can be run by `cd`-ing into the specific examples directory and following the instructions in the local README file. @@ -100,20 +110,26 @@ Before committing any code, please use the following tools, and address any comp All of these are used as part of the CI system as part of the checking of all pull requests. .. code:: bash - - # We are using type hints and mypy to help catch type-related errors. - mypy -p firecrown -p examples -p tests + # We are using black to keep consistent formatting across all python source files. + black firecrown examples tests # We are using flake8 to help verify PEP8 compliance. flake8 firecrown examples tests # We are using pylint to enforce a variety of rules. - # Not all of the code is "clean" according to pylint; this is a work in progress. - pylint --rcfile tests/pylintrc --recursive=y tests + # Different directories require some different rules. + pylint firecrown + pylint --rcfile firecrown/models/pylintrc firecrown/models + pylint --rcfile tests/pylintrc tests - # We are using black to keep consistent formatting across all python source files. - black --check firecrown/ examples/ tests/ + # We are using type hints and mypy to help catch type-related errors. + mypy -p firecrown -p examples -p tests + +Keeping your conda environment up-to-date +========================================= + +Why to do it. + +How to do it. - # Note that this use of black does not actually change any file. If files other than - # those you edited are complained about by black, please file an issue. diff --git a/environment.yml b/environment.yml index 485010e05..7cf94f529 100644 --- a/environment.yml +++ b/environment.yml @@ -2,11 +2,12 @@ name: firecrown_developer channels: - conda-forge dependencies: + - alabaster + - babel - black - charset-normalizer - cosmosis >= 2.2.0 - cosmosis-build-standard-library - - numcosmo >=0.18.2 - coverage - cython < 3.0.0 - dill @@ -18,6 +19,7 @@ dependencies: - matplotlib-base - more-itertools - mypy + - numcosmo >=0.18.2 - numpy >= 1.21.0 - pip - pip: @@ -30,8 +32,9 @@ dependencies: - pylint - pytest - pyyaml - - types-pyyaml - requests - sacc >= 0.11 - scipy + - sphinx + - types-pyyaml - urllib3 From c12a7efd3bda512652de7719ae9daea801ad51ad Mon Sep 17 00:00:00 2001 From: Marc Paterno Date: Thu, 19 Oct 2023 15:43:47 -0500 Subject: [PATCH 2/6] Updating install instructions --- docs/apple_m1_instructions.rst | 89 +------------------------- docs/non_developer_installation.rst | 14 ++-- tutorial/development_example.qmd | 2 +- tutorial/introduction_to_firecrown.qmd | 2 +- 4 files changed, 9 insertions(+), 98 deletions(-) diff --git a/docs/apple_m1_instructions.rst b/docs/apple_m1_instructions.rst index 0b04c271a..8bbb7aaf1 100644 --- a/docs/apple_m1_instructions.rst +++ b/docs/apple_m1_instructions.rst @@ -4,92 +4,5 @@ Instructions for installation of Firecrown on Apple M1 and M2 hardware .. role:: bash(code) :language: bash -The ability to install Firecrown on Apple M1 and M2 hardware (not on Intel hardware) is currently incomplete because of difficulties in obtaining a consistent build of the CosmoSIS Standard Library on M1 and M2 Macs, and the unavailability of an M1 or M2 build of CosmoSIS through conda. -Until this is fixed, we recommend the following procedure. - -.. note:: +Special directions are no longer needed for installation of Firecrown on Apple M1 and M2 hardware. - - This procedure is *not* recommended for other platforms. - It involves *building* the "head" versions of CosmoSIS and using (parts of) the "head" version of the CosmoSIS Standard Library. - The normal installation instructions give you a specified version known to be consistent with the rest of the code. - In addition, because this involves *building* CosmoSIS code, if you have something else in your environment that is accidentally found by the build, you may encounter a difficult-to-debug build failure, or worse yet a subtly inconsistent build that will perform incorrectly only some of the time. - -Note that this installation procedure will give you an environment in which you have a copy of the Firecrown code and can do development, including producing pull requests to submit code back to Firecrown. - -To do development work on Firecrown you need both the Firecrown source code and all the packages upon which Firecrown depends or is used with. -To get the Firecrown source code you will need to clone the Firecrown repository. -Most (but not all) of the dependencies of Firecrown are available through conda. -It is not currently possible to build the CosmoSIS Standard Library on M1 or M2 Macs. -However, you will be able to use the portions of the CosmoSIS Standard Library that do not require compilation. -This includes CAMB, but does not include many other modules. - -These instructions include details on how to obtain the samplers used with Firecrown. -This is important because if you are doing development it is important to make sure what you change or add works with both of the supported samplers. - -You only need to clone the Firecrown repository once, and to create the conda environment once. -Every time you want to do development in a new shell session you will need to activate the conda environment and set the environment variables. - -Clone the Firecrown repository -============================== - -Choose a directory in which to work. -In this directory, you will be cloning the Firecrown repository and later building some of the non-Firecrown code that is not installable through conda. - -.. code:: bash - - cd /directory/for/firecrown/work - git clone https://github.com/LSSTDESC/firecrown.git - - -Installation of dependencies -============================ - -These instructions will create a new conda environment containing all the packages used in development. -This includes testing and code verification tools used during the development process. - -It is best to execute these commands while in the same directory as you were in when you cloned the Firecrown repository above. -Note that we do not build the CosmoSIS Standard Library. -Only the pure-python parts of the CSL will be available for use. - -.. code:: bash - - cd /directory/for/firecrown/work - conda create --name firecrown_developer -c conda-forge sacc pyccl fitsio fuzzywuzzy urllib3 PyYAML portalocker idna dill charset-normalizer requests matplotlib flake8 pylint black pytest coverage - conda activate firecrown_developer - export CC=clang CXX=clang++ FC=gfortran - python -m pip install cosmosis cobaya - source cosmosis-configure - git clone https://github.com/joezuntz/cosmosis-standard-library.git - - -Setting your environment for development -======================================== - -Each time you want to do development in a new shell session you need to activate the conda environment and set some environment variables. - -Begin by `cd`-ing to the working directory you used during the installation (which should contain both `firecrown` and `cosmosis-standard-library` directories). - -.. code:: bash - - cd /directory/for/firecrown/work - conda activate firecrown_developer - export CSL_DIR=${PWD}/cosmosis-standard-library - export FIRECROWN_DIR=${PWD}/firecrown - export PYTHONPATH=${FIRECROWN_DIR}/build/lib - -To build the Firecrown code you should be in the Firecrown directory: - -.. code:: bash - - cd ${FIRECROWN_DIR} - python setup.py build - -The tests can be run with :bash:`pytest`, after building: - -.. code:: bash - - pytest - -Examples can be run by `cd`-ing into the specific examples directory and following the instructions in the local README file. -Note that any example that uses a compiled module from the CosmoSIS Standard Library will fail. diff --git a/docs/non_developer_installation.rst b/docs/non_developer_installation.rst index 4e45d1a67..c523aed8d 100644 --- a/docs/non_developer_installation.rst +++ b/docs/non_developer_installation.rst @@ -6,19 +6,13 @@ Installation for non-development use of Firecrown .. role:: bash(code) :language: bash -.. warning:: - - These instructions do not work for Macs with M1 processors. - For installation on that platform, please use the :doc:`Apple M1 installation instructions`. - Using Firecrown in non-development mode does not require cloning the repository. Instead, you can use a conda environment that contains Firecrown and its dependencies. Most (but not all) of the dependencies of Firecrown are available through conda. - -These instructions include details on how to obtain the samplers. +The CosmoSIS Standard Library (CSL) is not available through conda; instead, a conda package that allows you to build your own copy of the CSL is available. You only need to create the conda environment once. -Every time you want to do development in a new shell session you will need to activate the conda environment and set the environment variables. +Every time you want to do development in a new shell session you will need to activate the conda environment. Creation of the conda environment @@ -27,11 +21,15 @@ Creation of the conda environment These instructions will create a new conda environment containing all the packages used to support Firecrown, and Firecrown itself. It is best to execute these commands in a new directory established for your work with Firecrown. + + The `cosmosis-build-standard-library` command below will clone and then build the CosmoSIS Standard Library. This will create a directory `cosmosis-standard-library` in whatever is your current directory when you execute the command. .. code:: bash + conda create --name firecrown_user -c conda-forge firecrown + cd /directory/where/you/want/to/clone/cosmosis-standard-library conda create --name firecrown_user -c conda-forge cosmosis cosmosis-build-standard-library dill firecrown fuzzywuzzy getdist portalocker pybobyqa conda activate firecrown_user diff --git a/tutorial/development_example.qmd b/tutorial/development_example.qmd index 3cf3aeeb9..3f7b24a3b 100644 --- a/tutorial/development_example.qmd +++ b/tutorial/development_example.qmd @@ -1,6 +1,6 @@ --- title: An Introduction to Firecrown -subtitle: "Version 1.6.0" +subtitle: "Version 1.6.1a0" authors: - Marc Paterno - Sandro Vitenti diff --git a/tutorial/introduction_to_firecrown.qmd b/tutorial/introduction_to_firecrown.qmd index 242e13926..1ee895e9d 100644 --- a/tutorial/introduction_to_firecrown.qmd +++ b/tutorial/introduction_to_firecrown.qmd @@ -1,6 +1,6 @@ --- title: An Introduction to Firecrown -subtitle: "Version 1.6.0" +subtitle: "Version 1.6.1a0" authors: - Marc Paterno - Sandro Vitenti From e7563c114e2b51e7662c5a60346779aaf5661ffd Mon Sep 17 00:00:00 2001 From: Marc Paterno Date: Fri, 20 Oct 2023 14:35:02 -0500 Subject: [PATCH 3/6] Change order of pylint runs --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c4c74804e..0b485e769 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -92,9 +92,9 @@ jobs: - name: Running pylint shell: bash -l {0} run: | + pylint firecrown pylint --rcfile tests/pylintrc tests pylint --rcfile firecrown/models/pylintrc firecrown/models - pylint firecrown - name: Running pytest shell: bash -l {0} run: python -m pytest -vv From 3692ba9252074477ddbafb651cac6cb6ca95a8f8 Mon Sep 17 00:00:00 2001 From: Marc Paterno Date: Fri, 20 Oct 2023 14:35:20 -0500 Subject: [PATCH 4/6] Overhaul of installation/devel documentation --- docs/basic_usage.rst | 4 +- docs/contrib.rst | 28 +++++++----- docs/dev-notes.rst | 20 +++++---- docs/developer_installation.rst | 70 ++++++++++++++++++++--------- docs/environment.yml | 1 + docs/index.rst | 12 ++--- docs/install_quick.rst | 5 --- docs/non_developer_installation.rst | 45 +++++++++---------- docs/release-dependency-policy.rst | 41 ++++++----------- 9 files changed, 116 insertions(+), 110 deletions(-) diff --git a/docs/basic_usage.rst b/docs/basic_usage.rst index 57f110d9b..64a097591 100644 --- a/docs/basic_usage.rst +++ b/docs/basic_usage.rst @@ -1,10 +1,8 @@ - - Using Firecrown =============== The documentation for Firecrown is still under development. There are examples in the `examples folder `_ -that show some use of Firecrown with both Cobaya and CosmoSIS. +that show some use of Firecrown with all of the supported samplers. diff --git a/docs/contrib.rst b/docs/contrib.rst index 52c0c7a35..750aaae46 100644 --- a/docs/contrib.rst +++ b/docs/contrib.rst @@ -1,4 +1,3 @@ - Contributing ============ @@ -7,15 +6,18 @@ Contributing Contributions to Firecrown are welcome. -For any contribution, please start by `opening an issue `_, -and using the GitHub interface to create a branch for that issue. +For any contribution, please start by `opening a discussion `_. +We are intending to use GitHub discussions to come to a consensus on the ideas for new additions. +Once a consensus is reached, we will convert the discussion into a GitHub issue that can be used to track the progress of the work. +New development for issues should be done on a branch. To create a branch you will need write access; if you don't have write access, please send a request to the @LSSTDESC/firecrown-devs team. You can also fork the repository and send a pull request from your fork. When you have completed the task, push your commits to the branch you created for the issue and create a pull request. We are using several tools to help keep the code tidy and correct; these are described below. +These tools are all applied by the continuous integration (CI) system that is run on every pull request. Type checking ------------- @@ -33,29 +35,31 @@ and fix any errors reported before pushing commits to the GitHub repository. Testing ------- - .. warning:: - We are working on improving the coverage of testing for Firecrown; it is currently very inadequate. + We are working on improving the coverage of testing for Firecrown; it is currently inadequate. As the coverage improves, we will provide instructions for writing tests for new code. We are using :bash:`pytest` to run tests on Firecrown. -Before running tests, one must first build the code. -In addition, the environment variable :bash:`PYTHONPATH` must be correctly set to run the tests. -Please see the instructions, above, for this setup. Use of :bash:`pylint` --------------------- We are using :bash:`pylint` to check for a variety of possible problems. -Firecrown is not currently "clean" of all :bash:`pylint` issues, so we are not yet using :bash:`pylint` in the CI testing. +`pylint` is run in the CI system with the following flags: + +.. code:: bash -We are actively working on getting a "clean" report from :bash:`pylint`. -When this is achieved, we plan to activate :bash:`pylint` in the CI checking. -This will require that all new code pass :bash:`pylint`'s checks. + pylint firecrown + pylint --rcfile tests/pylintrc tests + pylint --rcfile firecrown/models/pylintrc firecrown/models Code formatting --------------- We are using the command-line tool :bash:`black` to auto-format Python code in Firecrown. Please make sure to run black on your code before creating any commits. + +.. code:: bash + + black firecrown examples tests diff --git a/docs/dev-notes.rst b/docs/dev-notes.rst index e8ae6d82f..2b5b2b454 100644 --- a/docs/dev-notes.rst +++ b/docs/dev-notes.rst @@ -5,15 +5,17 @@ Developer Notes .. role:: bash(code) :language: bash -To run the current version, one needs to *build* (but not yet install) Firecrown. -In this directory, run: +To run the development version, one needs to do an *editable installation* of firecrown. +This will create an entry in the conda environment that knows about the local code. +You must have the `:bash:firecrown_developer` conda environment activated before running this installation. - python3 setup.py build +Note that we use the :bash:`--no-deps` flag to prevent the installation from accidentally taking in any new dependencies through :bash:`pip`. +If the installation fails because of the lack of a dependency, install that dependency using :bash:`conda` and not :bash:`pip`. +If you find a dpendency on a package not available through :bash:`conda` please file an issue on the issue tracker. -This will put modules into the subdirectory :bash:`build/lib`. -Set the environment variable :bash:`FIRECROWN_DIR` to the full path to that directory. -Set the environment variable :bash:`FIRECROWN_EXAMPLES_DIR` to be the full path to the :bash:`examples` subdirectory. - -These environment variables are needed by the example :bash:`ini` files. -The directory :bash:`$FIRECROWN_DIR` should also be on :bash:`PYTHONPATH`. +.. code:: bash + + python -m pip install --no-deps --editable ${PWD} +Some of the examples and tests depend on the environment variables :bash:`FIRECROWN_DIR` and :bash:`CSL_DIR`. +These environment variables are defined for you every time you activate the conda environment. diff --git a/docs/developer_installation.rst b/docs/developer_installation.rst index b8aa2991b..e073c63a9 100644 --- a/docs/developer_installation.rst +++ b/docs/developer_installation.rst @@ -5,15 +5,16 @@ Installation for development of Firecrown .. role:: bash(code) :language: bash -.. warning:: +.. note:: - These instructions do not work for Macs with M1 processors. - For installation on that platform, please use the :doc:`Apple M1 installation instructions`. + Earlier versions of these instructions did not work for Macs with Apple Silicon processors. + The current instructions support all platform; the special instructions are no longer needed. To do development work on Firecrown you need both the Firecrown source code and all the packages upon which Firecrown depends or is used with. To get the Firecrown source code you will need to clone the Firecrown repository. Most (but not all) of the dependencies of Firecrown are available through `conda`. We use `pip` to install only those dependencies not available through `conda`. +The CosmoSIS Standard Library can be delivered only in source form, and must be built into your conda environment These instructions include details on how to obtain the samplers used with Firecrown. This is important because if you are doing development it is necessary to make sure what you change or add works with both of the supported samplers. @@ -38,8 +39,7 @@ Note that this is *not* the directory in which the conda environment is created, .. code:: bash - git clone https://github.com/LSSTDESC/firecrown.git - + git clone https://github.com/LSSTDESC/firecrown.git Installation of dependencies ============================ @@ -47,12 +47,14 @@ Installation of dependencies These instructions will create a new conda environment containing all the packages used in development. This includes testing and code verification tools used during the development process. We use the command `conda` in these instructions, but you may prefer instead to use `mamba`. -The Mamba version of Conda is typically faster when "solving" environments, which is done both on installation and during updates of the environment. +The Mamba version of Conda is typically faster when *solving* environments, which is done both on installation and during updates of the environment. -It is best to execute these commands while in the same directory as you were in when you cloned the Firecrown repository above. +We recommend that you execute these commands starting in the same directory as you were in when you cloned the Firecrown repository above. The `cosmosis-build-standard-library` command below will clone and then build the CosmoSIS Standard Library. We recommend doing this in the directory in which the conda environment resides. We have found this helps to make sure that only one version of the CSL is associated with any development efforts using the associated installation of CosmoSIS. +It also makes it easier to keep all of the products in the conda environment consistent when updating is needed. +Because the CI system is typically using the newest environment available, developers will periodoically need to update their own development environments. .. code:: bash @@ -70,15 +72,18 @@ We have found this helps to make sure that only one version of the CSL is associ conda activate firecrown_developer # 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 - pushd ${CONDA_PREFIX} + # We want to put the CSL into the same directory as conda environment upon which it depends + cd ${CONDA_PREFIX} cosmosis-build-standard-library - popd + # Now change directory into the firecrown repository + cd ${FIRECROWN_DIR} + # And finally make an editable (developer) installation of firecrown into the conda environment + python -m pip install --no-deps --editable ${PWD} Setting your environment for development ======================================== -Each time you want to do development in a new shell session you need to activate the conda environment and set some environment variables. +Each time you want to do development in a new shell session you need to activate the conda environment. When you activate the conda environment, you can use the environment variable you defined when creating the environment to find your Firecrown directory: @@ -87,20 +92,14 @@ When you activate the conda environment, you can use the environment variable yo conda activate firecrown_developer cd ${FIRECROWN_DIR} -To "build" the Firecrown code you should be in the Firecrown directory: - -.. code:: bash - - python -m pip install --no-deps --editable ${PWD} - -The tests can be run with :bash:`pytest`, after building: +The tests can be run with :bash:`pytest`: .. code:: bash python -m pytest -vv Examples can be run by `cd`-ing into the specific examples directory and following the instructions in the local README file. -You can also consult `firecrown/.github/workflows/ci.yml`, which contains the full test of examples and tests run by the CI system. +You can also consult `firecrown/.github/workflows/ci.yml`, which contains the full list of examples and tests run by the CI system. Before committing code ====================== @@ -110,6 +109,7 @@ Before committing any code, please use the following tools, and address any comp All of these are used as part of the CI system as part of the checking of all pull requests. .. code:: bash + # We are using black to keep consistent formatting across all python source files. black firecrown examples tests @@ -128,8 +128,36 @@ All of these are used as part of the CI system as part of the checking of all pu Keeping your conda environment up-to-date ========================================= -Why to do it. +Many of the packages in the ecosystem upon which Firecrown depends are under continuous development. +In order to keep up with these developments it is necessary to periodically update your conda environment. +How often you do so is a matter of personal taste. +However, since the CI system typically uses the most up-to-date version of all dependencies, it is generally a good idea to make sure your environment is up-to-date before pushing commits to the repository. +If you find that you have run all the required tests and tools (described above) successfully in your development build, but the CI system rejects a PR because of failures, the issue may be out-of-date dependencies. +In this situation, updating your development environment is the easiest way to reproduce, and then fix, the problems found by the CI system. + +Because not all of the products upon which Firecrown depends are installed with `conda` the instructions to update your environment have several steps. +The order of these steps is important. +If you get any errors regarding missing packages from the `pip` step, please try installing those packages with `conda` and then repeat the `pip` step. +Please also file an issue in the GitHub issue tracker describing the failure. -How to do it. +.. code:: bash + + # Update the packages installed with conda + # Make sure you have the firecrown_developer environment active. + conda update --all + + # Update the pip-installed products. + # The --no-deps flag is critical to avoid accidentally installing new packages + # with pip (rather than with conda). + python -m pip install --upgrade --no-deps autoclasstoc cobaya + # Rebuild the CSL + cd ${CSL_DIR} + # Optionally, you may want to update to the newest version of the CSL + # To do so, use the following: + # git pull + source ${CONDA_PREFIX}/bin/cosmosis-configure + make + # Move back to the firecrown repository + cd ${FIRECROWN_DIR} diff --git a/docs/environment.yml b/docs/environment.yml index 4993140e4..0f6b43b54 100644 --- a/docs/environment.yml +++ b/docs/environment.yml @@ -8,6 +8,7 @@ dependencies: - cosmosis-build-standard-library - flake8 - mypy + - numcosmo>=0.18.2 - numpy>=1.16 - plantuml - pip diff --git a/docs/index.rst b/docs/index.rst index 37c6b5516..ce7db5b3d 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -4,20 +4,16 @@ Welcome to firecrown's documentation! Introduction ------------ -Firecrown is a Python package that provides the DESC *framework* to implement -likelihoods, as well as specific likelihood implementations. Firecrown is intended to -be usable *from* external statistical analysis tools. +Firecrown is a Python package that provides the DESC *framework* to implement likelihoods, as well as specific likelihood implementations. +Firecrown is intended to be usable *from* external statistical analysis tools. -Currently, it supports Cobaya, CosmoSIS, and NumCosmo, providing the necessary -classes or modules to allow users the sampling frameworks to call any Firecrown -likelihood from within those samplers. +Currently, it supports Cobaya, CosmoSIS, and NumCosmo, providing the necessary classes or modules to allow users the sampling frameworks to call any Firecrown likelihood from within those samplers. * `Cobaya `_ * `CosmoSIS `_ * `NumCosmo `_ -It can also be used as a library in other contexts, and so the installation of -Firecrown does not *require* the installation of a sampler. +It can also be used as a library in other contexts, and so the installation of Firecrown does not *require* the installation of a sampler. .. toctree:: :maxdepth: 2 diff --git a/docs/install_quick.rst b/docs/install_quick.rst index f5741548a..ca03915a4 100644 --- a/docs/install_quick.rst +++ b/docs/install_quick.rst @@ -5,9 +5,6 @@ Installation Quickstart There are several ways to obtain Firecrown for your own use. The method you should use to obtain Firecrown depends on how you want to use it. -Currently, the installation instructions for users installing on Mac machines with M1 or M2 (also called Apple Silicon) chips are different from other installation instructions. -If you are installing on such a machine please use the :doc:`Apple M1 and M2 installation instructions`. - * *Developer use*: If you want to modify existing Firecrown code, or if you may produce new code and may produce a `pull request `_ to submit your code to Firecrown, use the :doc:`developer installation `. * *Non-developer usage*: If you want to write your own likelihood script or even create subclasses of classes already in Firecrown, but do not intend to submit code back to Firecrown, you can use the :doc:`non-development installation `. If you choose this installation and decide later that you do want to submit your code back to Firecrown you will need to copy the new code files you write into a developer-usage environment at a later date. @@ -18,5 +15,3 @@ If you are installing on such a machine please use the :doc:`Apple M1 and M2 ins Developer installation Non-development installation - Apple M1 installation instructions - diff --git a/docs/non_developer_installation.rst b/docs/non_developer_installation.rst index c523aed8d..f9f1cd34e 100644 --- a/docs/non_developer_installation.rst +++ b/docs/non_developer_installation.rst @@ -6,52 +6,49 @@ Installation for non-development use of Firecrown .. role:: bash(code) :language: bash -Using Firecrown in non-development mode does not require cloning the repository. +Using Firecrown in non-development mode does *not* require cloning the repository. Instead, you can use a conda environment that contains Firecrown and its dependencies. -Most (but not all) of the dependencies of Firecrown are available through conda. -The CosmoSIS Standard Library (CSL) is not available through conda; instead, a conda package that allows you to build your own copy of the CSL is available. +Most (but not all) of the dependencies of Firecrown are available through `conda`. +Some of the dependencies are available only through `pip`. +The CosmoSIS Standard Library (CSL) is not available through `conda`; instead, a Conda package that allows you to build your own copy of the CSL is available. -You only need to create the conda environment once. -Every time you want to do development in a new shell session you will need to activate the conda environment. +You only need to create the Conda environment once. +Every time you want to do development in a new shell session you will need to activate the Conda environment. Creation of the conda environment ================================= These instructions will create a new conda environment containing all the packages used to support Firecrown, and Firecrown itself. +We use the command `conda` in these instructions, but you may prefer instead to use `mamba`. +The Mamba version of Conda is typically faster when *solving* environments, which is done both on installation and during updates of the environment. It is best to execute these commands in a new directory established for your work with Firecrown. - - +Any sampler configuration files and any new likelihood factory functions you write will go into this directory. +None of the Firecrown code, nor the code for any of its dependencies, will be in this directory. The `cosmosis-build-standard-library` command below will clone and then build the CosmoSIS Standard Library. -This will create a directory `cosmosis-standard-library` in whatever is your current directory when you execute the command. +We recommend doing this in the directory in which the conda environment resides. +We have found this helps to make sure that only one version of the CSL is associated with any development efforts using the associated installation of CosmoSIS. +It also makes it easier to keep all of the products in the conda environment consistent when updating is needed. .. code:: bash conda create --name firecrown_user -c conda-forge firecrown - - cd /directory/where/you/want/to/clone/cosmosis-standard-library - conda create --name firecrown_user -c conda-forge cosmosis cosmosis-build-standard-library dill firecrown fuzzywuzzy getdist portalocker pybobyqa conda activate firecrown_user - python -m pip install cobaya + conda env config vars set CSL_DIR=${CONDA_PREFIX}/cosmosis-standard-library + conda deactivate + conda activate firecrown_user + cd ${CONDA_PREFIX} source ${CONDA_PREFIX}/bin/cosmosis-configure cosmosis-build-standard-library main +Setting your environment for work +================================= -Setting your environment for development -======================================== - -Each time you want to do development in a new shell session you need to activate the conda environment and set some environment variables. - -Begin by `cd`-ing to the working directory you used above (which should contain a `cosmosis-standard-library` directory). +Each time you want to do development in a new shell session you need to activate the conda environment. .. code:: bash - cd /path/to/directory/used above conda activate firecrown_user - source ${CONDA_PREFIX}/bin/cosmosis-configure - export CSL_DIR=${PWD}/cosmosis-standard-library - export FIRECROWN_SITE_PACKAGES=${COSMOSIS_SRC_DIR}/.. - -See the :doc:`example of non-developer mode usage ` for an example likelihood script and its use with both Cobaya and CosmoSIS. +See the :doc:`example of non-developer mode usage ` for an example likelihood script and its use with the samplers. diff --git a/docs/release-dependency-policy.rst b/docs/release-dependency-policy.rst index fa6da2d47..6fe26195a 100644 --- a/docs/release-dependency-policy.rst +++ b/docs/release-dependency-policy.rst @@ -10,36 +10,21 @@ Release and versioning policy Firecrown is following the practice of `semantic versioning `_. In brief, this means that Firecrown version numbers will be of the form `x.y.z`. -The *major version*, `x`, will be incremented whenever a change is made that is not -backwards-compatible. -The *minor version*, `y`, will be incremented when new features are added in a -backwards-compatible fashion. -The *point release version*, `z`, will be incremented for bug fixes that introduce no -new functionality (and are also backwards-compatible). -Firecrown development will hold to these policies for all tagged releases deployed to -`Conda Forge `_. +The *major version*, `x`, will be incremented whenever a change is made that is not backwards-compatible. +The *minor version*, `y`, will be incremented when new features are added in a backwards-compatible fashion. +The *point release version*, `z`, will be incremented for bug fixes that introduce no new functionality (and are also backwards-compatible). +Firecrown development will hold to these policies for all tagged releases deployed to `Conda Forge `_. Firecrown is currently under rapid development. It will remain so for the forseeable future. -In order to facilitate this rapid development, it is important to be able to resolve -pull requests in a timely fashion. -However, it is also important that we be able to maintain stability in released -interfaces, in accordance with our versioning policy. +In order to facilitate this rapid development, it is important to be able to resolve pull requests in a timely fashion. +However, it is also important that we be able to maintain stability in released interfaces, in accordance with our versioning policy. -To best statisfy both requirements, backward compatibility as denoted by the semantic -versioning is promised only for tagged releases. -The head of the `master` branch of `the repository on GitHub `_ is not subject to the same constraint. -This is to allow us to merge pull requests into `master` as quickly as possible, -without taking the extra time necessary to be sure they are following a design -suitable for longer-term stability. +To best statisfy both requirements, backward compatibility as denoted by the semantic versioning is promised only for tagged releases. +The head of the `master` branch of `the repository on GitHub `_ is not subject to the same constraint. +This is to allow us to merge pull requests into `master` as quickly as possible, without taking the extra time necessary to be sure they are following a design suitable for longer-term stability. -We recommend that projects which do *not* involve new development of Firecrown should -use tagged releases as distributed on Conda Forge. -We recommend that projects which do involve new development of Firecrown work on a -branch started from `master`. -For the most stability, it may be useful to start a branch from the most recent tag -on the `master` branch. -However, before making a pull request from such a branch, it is necessary to first -update the branch from which the pull request will be made to conform with the -current `HEAD` of the `master` branch. \ No newline at end of file +We recommend that projects which do *not* involve new development of Firecrown should use tagged releases as distributed on Conda Forge. +We recommend that projects which do involve new development of Firecrown work on a branch started from `master`. +For the most stability, it may be useful to start a branch from the most recent tag on the `master` branch. +However, before making a pull request from such a branch, it is necessary to first update the branch from which the pull request will be made to conform with the current `HEAD` of the `master` branch. \ No newline at end of file From d0a853e33ba30fb7068974819dcd2c1836d7e808 Mon Sep 17 00:00:00 2001 From: Marc Paterno Date: Fri, 20 Oct 2023 16:43:13 -0500 Subject: [PATCH 5/6] Updating of tutorial documentation --- tutorial/_developer_installation.qmd | 62 ++++++++----- ...ing_up_a_shell_session_for_development.qmd | 7 +- tutorial/_what_is_firecrown.qmd | 3 + tutorial/development_example.qmd | 6 +- tutorial/intro_article.qmd | 3 +- tutorial/introduction_to_firecrown.qmd | 87 ++++++++++--------- 6 files changed, 90 insertions(+), 78 deletions(-) diff --git a/tutorial/_developer_installation.qmd b/tutorial/_developer_installation.qmd index 7ec1dfebd..08c9d539d 100644 --- a/tutorial/_developer_installation.qmd +++ b/tutorial/_developer_installation.qmd @@ -9,36 +9,50 @@ The developer installation instructions (below) will: This installation only needs to be done once. -Note that for Apple computers using M1 chips, special instructions are necessary. -When Conda support for M1 hardware catches up to the support for Intel hardware this should no longer be needed. -These are available at [https://firecrown.readthedocs.io/en/stable/apple_m1_instructions.html](https://firecrown.readthedocs.io/en/stable/apple_m1_instructions.html). +## Clone the Firecrown repository + +Choose a directory in which to work. +In this directory, you will be cloning the Firecrown repository and later building some of the non-Firecrown code that is not installable through conda. +Note that this is *not* the directory in which the conda environment is created, nor is it the directory in which the CosmoSIS Standard Library (CSL) will be built. ```{.bash} -cd THE_DIRECTORY_INTO_WHICH_YOU_WANT_TO_INSTALL_THINGS git clone https://github.com/LSSTDESC/firecrown.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 firecrown/environment.yml -conda activate firecrown_developer -source ${CONDA_PREFIX}/bin/cosmosis-configure -cosmosis-build-standard-library # this may take a few minutes -export CSL_DIR=${PWD}/cosmosis-standard-library -export FIRECROWN_DIR=${PWD}/firecrown -export PYTHONPATH=${FIRECROWN_DIR}/build/lib ``` -Since conda V4.8 you can use the following command to include these environment variables in your conda environment: - -```{.bash} -conda env config vars set CSL_DIR="${PWD}/cosmosis-standard-library" FIRECROWN_DIR="${PWD}/firecrown" PYTHONPATH="${PWD}/firecrown/build/lib" -``` +## Installation of dependencies -Thus, every time you activate the environment, these variables will be set. +These instructions will create a new conda environment containing all the packages used in development. +This includes testing and code verification tools used during the development process. +We use the command `conda` in these instructions, but you may prefer instead to use `mamba`. +The Mamba version of Conda is typically faster when *solving* environments, which is done both on installation and during updates of the environment. -If you do not wish to build the CosmoSIS standard library, perhaps because you intend either to not use it or to use only those parts that do not require compilation, you can instead just clone the CSL repository: +We recommend that you execute these commands starting in the same directory as you were in when you cloned the Firecrown repository above. +The `cosmosis-build-standard-library` command below will clone and then build the CosmoSIS Standard Library. +We recommend doing this in the directory in which the conda environment resides. +We have found this helps to make sure that only one version of the CSL is associated with any development efforts using the associated installation of CosmoSIS. +It also makes it easier to keep all of the products in the conda environment consistent when updating is needed. +Because the CI system is typically using the newest environment available, developers will periodoically need to update their own development environments. ```{.bash} -# Make sure you are doing this in the same directory as you run the rest of the -# commands above -git clone https://github.com/joezuntz/cosmosis-standard-library -``` \ No newline at end of file +# 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 firecrown/environment.yml +conda activate firecrown_developer +# We define two environment variables that will be defined whenever you activate +# the conda environment. +conda env config vars set CSL_DIR=${CONDA_PREFIX}/cosmosis-standard-library FIRECROWN_DIR=${PWD}/firecrown +# The command above does not immediately defined 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 firecrown_developer +# 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 firecrown repository +cd ${FIRECROWN_DIR} +# And finally make an editable (developer) installation of firecrown into the conda environment +python -m pip install --no-deps --editable ${PWD} +``` diff --git a/tutorial/_setting_up_a_shell_session_for_development.qmd b/tutorial/_setting_up_a_shell_session_for_development.qmd index 4ca1960d4..15ebf9b1e 100644 --- a/tutorial/_setting_up_a_shell_session_for_development.qmd +++ b/tutorial/_setting_up_a_shell_session_for_development.qmd @@ -2,16 +2,11 @@ These instructions assume you have already done the installation, above, presuma If you have just completed the installation and are in the same shell session, you do not need to execute these commands --- you have already done so! ```{.bash} -cd THE_DIRECTORY_INTO_WHICH_YOU_DID_INSTALL_THINGS conda activate firecrown_developer -export CSL_DIR=${PWD}/cosmosis-standard-library -export FIRECROWN_DIR=${PWD}/firecrown -export PYTHONPATH=${FIRECROWN_DIR}/build/lib +cd ${FIRECROWN_DIR} ``` Each of the three defined environment variables is used for a different purpose: 1. `CSL_DIR` is used in CosmoSIS *ini* files to allow the `cosmosis` command to be run from any directory. 2. `FIRECROWN_DIR` is used in the examples that come with Firecrown. -3. `PYTHONPATH` is used by Python itself to find Firecrown modules - Note that `PYTHONPATH` refers not to the top of the Firecrown repository, but to the subdirectory `build/lib` where later instructions will build the Firecrown code. diff --git a/tutorial/_what_is_firecrown.qmd b/tutorial/_what_is_firecrown.qmd index 77ea992e9..ae64dce9b 100644 --- a/tutorial/_what_is_firecrown.qmd +++ b/tutorial/_what_is_firecrown.qmd @@ -5,6 +5,9 @@ So Firecrown provides a single framework for writing likelihoods that allows DES Moreover, Firecrown is intended to provide a well-defined environment in which all the DESC tools needed for likelihood-dependent analysis tasks are present. To accomplish this objective, Firecrown directly uses the DESC Core Cosmology Library [CCL](https://github.com/LSSTDESC/CCL) and the [SACC](https://github.com/LSSTDESC/SACC) data format library. +Note that Firecrown itself does not do sampling, nor does it run the sampling frameworks. +Instead, whichever sampling framework you are using calls (through the Firecrown connector code) the Firecrown likelihood you configure. + [^firecrown]: A firecrown is a hummingbird native to Chile and Argentina. The reasons this software is named Firecrown are now lost to the mists of history. ![](green-backed-firecrown.jpg){fig-alt="A green-backed firecrown."} diff --git a/tutorial/development_example.qmd b/tutorial/development_example.qmd index 3f7b24a3b..cb5a5039d 100644 --- a/tutorial/development_example.qmd +++ b/tutorial/development_example.qmd @@ -202,13 +202,9 @@ flake8 firecrown examples tests mypy -p firecrown -p examples -p tests # We are using pylint to enforce a variety of rules. -# Not all of the code is "clean" according to pylint; this is a work in progress +pylint firecrown pylint --rcfile pylintrc_for_tests tests pylint --rcfile firecrown/models/pylintrc firecrown/models -pylint firecrown/connector -pylint firecrown/*.py -pylint firecrown/likelihood/*.py -pylint firecrown/likelihood/gauss_family/*.py # Run the unit test suite. Note that the coverage is incomplete. python -m pytest -v tests diff --git a/tutorial/intro_article.qmd b/tutorial/intro_article.qmd index e93c8a6b2..1bf361b5d 100644 --- a/tutorial/intro_article.qmd +++ b/tutorial/intro_article.qmd @@ -18,7 +18,8 @@ citation-location: margin ## Prologue This document is based on the Firecrown tutorial given at the Feb 2023 DESC Meeting Sprint Session. -A [recording of this talk](https://stanford.zoom.us/rec/play/L5kfslcPirRmw2-9_75LwU796mHKm7GFAXqKIeF63PFQ7hOd31FbPYWkaLKVIIScflbD45hQJjYcuiQS.MdJLz5hbgThzouy7?continueMode=true&_x_zm_rtaid=pNHwX_FqRpS5HdZOJi3SwA.1679252612462.2f1b7c989ab44f7d7bcf282addeaa789&_x_zm_rhtaid=945) is available. +It has been updated to work with the version of Firecrown noted on the title slide. +A [recording of the original talk](https://stanford.zoom.us/rec/play/L5kfslcPirRmw2-9_75LwU796mHKm7GFAXqKIeF63PFQ7hOd31FbPYWkaLKVIIScflbD45hQJjYcuiQS.MdJLz5hbgThzouy7?continueMode=true&_x_zm_rtaid=pNHwX_FqRpS5HdZOJi3SwA.1679252612462.2f1b7c989ab44f7d7bcf282addeaa789&_x_zm_rhtaid=945) is available. ## What is Firecrown? {{< include _what_is_firecrown.qmd >}} diff --git a/tutorial/introduction_to_firecrown.qmd b/tutorial/introduction_to_firecrown.qmd index 1ee895e9d..7c145ddaf 100644 --- a/tutorial/introduction_to_firecrown.qmd +++ b/tutorial/introduction_to_firecrown.qmd @@ -133,56 +133,64 @@ Firecrown supports a few different installation modes. - The following commands will: - 1. create a *conda* environment - 2. clone the Firecrown repository + 1. clone the Firecrown repository + 2. create a *conda* environment 3. build the CosmoSIS standard library for use with Firecrown - Installation only needs to be done once. -```{{bash}} -cd THE_DIRECTORY_INTO_WHICH_YOU_WANT_TO_INSTALL_THINGS -git clone https://github.com/LSSTDESC/firecrown.git -# conda env update, when run as suggested, is able to create a new environment, -# as well as updating an existing environment. + +## Clone the Firecrown repository + +Choose a directory in which to work. +In this directory, you will be cloning the Firecrown repository and later building some of the non-Firecrown code that is not installable through conda. +Note that this is *not* the directory in which the conda environment is created, nor is it the directory in which the CosmoSIS Standard Library (CSL) will be built. + +```{.bash} +git clone https://github.com/LSSTDESC/firecrown.git +``` + +## Installation of dependencies + +These instructions will create a new conda environment containing all the packages used in development. +(Note you may need to scroll down in the listing of instructions.) + +```{.bash} +# 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 firecrown/environment.yml conda activate firecrown_developer +# We define two environment variables that will be defined whenever you activate +# the conda environment. +conda env config vars set CSL_DIR=${CONDA_PREFIX}/cosmosis-standard-library FIRECROWN_DIR=${PWD}/firecrown +# The command above does not immediately defined 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 firecrown_developer +# Now we can finish building the CosmoSIS Standard Library. source ${CONDA_PREFIX}/bin/cosmosis-configure -cosmosis-build-standard-library # this may take a few minutes -export CSL_DIR=${PWD}/cosmosis-standard-library -export FIRECROWN_DIR=${PWD}/firecrown -export PYTHONPATH=${FIRECROWN_DIR}/build/lib +# 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 firecrown repository +cd ${FIRECROWN_DIR} +# And finally make an editable (developer) installation of firecrown into the conda environment +python -m pip install --no-deps --editable ${PWD} ``` -There are special instructions for [installation on an M1 Mac](https://firecrown.readthedocs.io/en/latest/apple_m1_instructions.html). +## Setting your environment for development -## Setting up a shell session for development +Each time you want to do development in a new shell session you need to activate the conda environment. -- This assumes that you have already (once, presumably in a previous shell session) done the installation described [on the previous slide](#developer-installation). +When you activate the conda environment, you can use the environment variable you defined when creating the environment to find your Firecrown directory: -``` {{bash}} -cd THE_DIRECTORY_INTO_WHICH_YOU_DID_INSTALL_THINGS +```{.bash} conda activate firecrown_developer -export CSL_DIR=${PWD}/cosmosis-standard-library -export FIRECROWN_DIR=${PWD}/firecrown -export PYTHONPATH=${FIRECROWN_DIR}/build/lib +cd ${FIRECROWN_DIR} ``` - `CSL_DIR` is used in CosmoSIS *ini* files to allow CosmoSIS to be run from any directory. - `FIRECROWN_DIR` is used in examples. -- `PYTHONPATH` is used by Python itself to find Firecrown modules. - -## Building Firecrown - -- We recommend against using a "developer install" using `pip install -e` because: - - That installation does not deal gracefully with the removal of files during development. - - Removing the *build* directory assures that no old artifacts are ever used. -- We recommend instead building directly using `setup.py`. - -``` {{bash}} -cd ${FIRECROWN_DIR} -# We clean up any previous build to ensure stale code is never found by python. -rm -rf build/* -python setup.py build -``` ## Code development hygiene @@ -195,24 +203,19 @@ python setup.py build - We are using `flake8` to help verify PEP8 compliance. - We are using type hints and `mypy` to help catch type-related errors. - We are using `pylint` to enforce a variety of rules. - - Not all of the code is "clean" according to pylint; this is a work in progress ::: :::{.column width="50%"} - We are using `pytest` to run our unit test suite. - - Note the coverage is incomplete; we are working on this. - - All new code should be accompanied by unit tests. + ```{.bash code-copy=true} black --check firecrown/ examples/ tests/ flake8 firecrown examples tests mypy -p firecrown -p examples -p tests -pylint --rcfile pylintrc_for_tests tests +pylint firecrown pylint --rcfile firecrown/models/pylintrc firecrown/models -pylint firecrown/connector -pylint firecrown/*.py -pylint firecrown/likelihood/*.py -pylint firecrown/likelihood/gauss_family/*.py +pylint --rcfile pylintrc_for_tests tests python -m pytest -v tests ``` ::: From 1276af19c44fd4bc451b07e56ab04c406775b1e3 Mon Sep 17 00:00:00 2001 From: Sandro Dias Pinto Vitenti Date: Mon, 23 Oct 2023 14:16:53 -0300 Subject: [PATCH 6/6] Update dev-notes.rst Minor typo correction. --- docs/dev-notes.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/dev-notes.rst b/docs/dev-notes.rst index 2b5b2b454..2016780a2 100644 --- a/docs/dev-notes.rst +++ b/docs/dev-notes.rst @@ -11,7 +11,7 @@ You must have the `:bash:firecrown_developer` conda environment activated before Note that we use the :bash:`--no-deps` flag to prevent the installation from accidentally taking in any new dependencies through :bash:`pip`. If the installation fails because of the lack of a dependency, install that dependency using :bash:`conda` and not :bash:`pip`. -If you find a dpendency on a package not available through :bash:`conda` please file an issue on the issue tracker. +If you find a dependency on a package not available through :bash:`conda` please file an issue on the issue tracker. .. code:: bash