Install

You can either install RADIS from pip, the Python package manager. But if you want to access the latest features, or modify the code and contribute, we suggest that you Clone or Fork the source code from GitHub.

Use-only version : cant modify the code

In a terminal, run:

pip install --user radis -v

The ‘pip’ module has to be installed (by default if you’ve installed Python with Anaconda).

If you later want to update the package:

pip install radis --upgrade

Developer version: to modify the code and contribute to the project.

We suggest that you fork the RADIS repository and use that url for the clone step below. This will make submitting changes easier in the long term for you:

In a terminal, run:

git clone https://github.com/<GITHUB USERNAME>/radis.git
cd radis
pip install -e .[dev] -v
  • The -e (editable) argument creates a link from the local folder ./ into Python site-packages.

  • [dev] is optional, but installs additional developer packages that may be useful for testing and linting your code.

To make sure the install worked, run the first example from the Quick Start page. Then, you’re all set.

Test your changes

If you want to modify the source code, you need to ensure that you don’t break any of the existing tests. Refer to the Test Section to learn how to run the tests locally.

Update your changes

Submit a Pull Request from GitHub.

Online tests will be run automatically. They will check for:

  • Physical test cases

  • Code format (see Code linting below)

Code linting

Radis follows Black style for code linting to maintain consistent coding style across modules. Code style is checked using CI services which run automatically on each pull request. Black is automatically installed when radis is set-up in developer mode.

To format any file/files:

black /path/to/file/or/directory/

You can include Black coding style directly in some text editors

Alternatively, Black coding style can be checked automatically before each commit. For that all you need to do is to run the following command once:

cd radis
pre-commit install

On each commit, format will be fixed if it was incorrect. All you need to do is to commit a second time. Exemple:

$ git commit -am "test"
black....................................................................Failed
- hook id: black
- files were modified by this hook

reformatted [ALL FAILING FILES]
All done!
1 file reformatted.

$ git commit -am "test"
black....................................................................Passed
[develop XXX] test
 1 file changed, 1 insertion(+)

Note that pre-commit will always require you to commit again after a test was failed, because it’s safer. If for any reason you want to skip formatting you can commit with the --no-verify argument.

Update

With Pip you can keep the package up-to-date with:

pip install radis --upgrade

If using the latest developer version (cloned from GitHub and installed with pip install -e .[dev]), use git to pull the latest changes.

Help

If you encounter any problem, please report an Issue on GitHub.

You can also ask for advice on the Q&A forum or the community chat:

Gitter Slack