Skip to content

Latest commit

 

History

History
90 lines (54 loc) · 2.42 KB

installing.rst

File metadata and controls

90 lines (54 loc) · 2.42 KB

Installing IMAS-Python

IMAS-Python is a pure Python package. While it can be used without it, for full functionality of the package you need an installation of the IMAS Core library. See :ref:`IMAS-Python 5 minute introduction` for a quick overview of its most basic functionalities.

To get started, you can install it from pypi.org:

pip install imas-python

You can also install optional dependencies (e.g. netCDF and xarray):

pip install imas-python[netcdf,xarray]

List of optional dependencies

  • netcdf: enables storing/loading of IDS to/from netCDF files
  • xarray: enables loading IDS (entire IDS or part of it) into an xarray dataset
  • h5py: enables analyze-db CLI option
  • docs: installs required packages to build the Sphinx documentation
  • test: installs required packages to run the tests with pytest and asv

Note

Some tests will be skipped unless you also have imas_core installed (it is not yet available on PyPI, so you will need to install it from sources if you have access to them at https://git.iter.org/projects/IMAS/repos/al-core)

Local installation from sources

We recommend using a :external:py:mod:`venv`. Then, clone the IMAS-Python repository and run pip install:

python3 -m venv ./venv
. venv/bin/activate

git clone git@github.com:iterorganization/IMAS-Python.git
cd IMAS-Python
pip install --upgrade pip
pip install --upgrade wheel setuptools
pip install .

Development installation

For development an installation in editable mode may be more convenient, and you will need some extra dependencies to run the test suite and build documentation.

pip install -e .[test,docs]

Test your installation by trying

cd ~
python -c "import imas; print(imas.__version__)"

This is how to run the IMAS-Python test suite:

# inside the IMAS-Python git repository
pytest imas --mini

# run with a specific backend, requires IMAS-Core installed
pytest imas --ascii --mini

And to build the IMAS-Python documentation, execute:

make -C docs html