From the Python Package Index (PyPI)
Requires python 3.8, 3.9, 3.10 or 3.11. Probably the easiest way to get up and running.
pip install fair
conda install -c chrisroadmap fair
The latest release can be obtained from https://github.com/OMS-NetZero/FAIR/releases as zip or tarball files, or the most current unreleased version can be cloned from https://github.com/OMS-NetZero/FAIR.
pip install -e .[dev]
This will also give access to the notebooks in the examples directory, so you can experiment with the model using these as a starting point. For this to work, you should launch notebooks from the same directory in which you install FAIR locally.
Guide for developers
Navigate to the GitHub repository, fork to your personal account, then clone it to your local disk. cd to the FAIR directory in your working copy.
Create a new branch for your changes:
git checkout -b <branch_name>
The development package includes a Makefile which will set up a virtual environment for you along with other tools, keeping your base installation clean. python 3.11 is used for developing FaIR. To set this up, run:
Make your code changes.
Write a test that tests your new feature (in the
testsdirectory of the repository).
Format your code, and run tests locally:
make format make checks make test make test_notebooks
If you find errors at this point, they will need fixing before GitHub will allow merging to the master branch. Running the test suite ensures that your code change does not break or change existing functionality. The remote and local tests will also fail if you have not increased the code coverage (basically, if you haven’t written a test for your change).
Commit and push your changes:
git add <file> git commit -m "informative commit message" git push origin <branch_name>
Create a pull request on the parent repository to merge in your changes. You will see there’s a checklist of processes to go through…
One of which is adding a line to CHANGELOG.rst with a summary of the changes made.
The checks and tests will run using GitHub actions. If all pass, you should be able to submit the pull request for review.
If the codeowners are happy, the branch will be merged in.