Installation¶
IDStools is a Python package, so the Python environment is mandatory. Its functioning depends on IMAS-Python. As a result, before running IDStools scripts, the IMAS environment must be loaded.
For users¶
Install using pip
$ git clone https://github.com/iterorganization/IDStools.git
$ pip install --upgrade pip
$ pip install --upgrade wheel setuptools
$ pip install .
Also it is possible to install it in the Python virtual environment
$ git clone https://github.com/iterorganization/IDStools.git
$ cd idstools
$ python -m venv idsenv
$ source idsenv/bin/activate
$ pip install --upgrade pip
$ pip install .
$ deactivate
$ idslist -h
Note
If you are using ITER sdcc cluster then IDStools is available by doing module load as shown below
$ module load IDStools/*
Note
There are development versions of IDStools on SDCC. These can be used if you need functionalities/bug fixes before next release
$ module av -i -t idstools/dev
/work/imas/etc/modules/all:
IDStools/dev-*
For Developers¶
Note
IDStools is currently hosted on GitHub. Get access to https://github.com/iterorganization/IDStools repository if you don’t have it already
Clone IDStools repository.
$ git clone https://github.com/iterorganization/IDStools.git
If you wish to include additional tools or expand functionalities, submit pull requests.
The IDStools test suite should be run as follows.: To run pytest
$ cd idstools
$ export PYTHONPATH=$PWD:$PYTHONPATH
$ pytest
To run tests scripts and verify functionalities
you may need additional Linux commands if it is not installed e.g. bc
sudo yum install bc
$ cd idstools
$ tests/st01_test_ids_scripts_with_uri.sh
$ tests/st02_test_db_scripts.sh
$ tests/st03_test_analysis_scripts_with_uripath.sh
$ tests/st03_test_analysis_scripts_with_uri.sh
$ tests/st04_test_scenario_scripts.sh
To build the IDStools documentation, execute:
$ pip install .[docs]
$ make -C docs realclean
$ make -C docs html
$ make -C docs man
Code formatting is done with the black
black -l 120 idstools
Append commits related to the formatting of the code .git-blame-ignore-revs file which is placed in the root of the repository
Configure git to ignore formatting related commits
$ git config blame.ignoreRevsFile .git-blame-ignore-revs
pre-commit hooks are used in the repository, It just need to be configured Ensure pre-commit is aready installled
$ pip install pre-commit
$ pre-commit install
pre-commit installed at .git/hooks/pre-commit
More information: https://black.readthedocs.io/en/stable/integrations/source_version_control.html https://pre-commit.com/#install