Installation for developer

Here is the step-by-step guide for the library developer of irfpy.aspera.

Here “developer” means the persons who will change the codes under src/irfpy/ in the source tree.

  1. Clone the source code of irfpy.aspera.

git clone git@gitlab.irf.se:irfpy/aspera irfpy.aspera
  1. (Optional, but recommended) Create a new environment in Anaconda.

% conda create -n irfpy.aspera-develop -y anaconda

This will create a new python environment. (See http://conda.pydata.org/docs/using/envs.html for details about environment.)

Everytime you work on this environment, you use

% conda activate irfpy.aspera-develop

for command line.

If you are working with development environment (e.g. PyCharm, Spyder, etc), you can point the python interpreter to ~/anaconda/envs/irfpy.aspera-develop/bin/python by setting of each program.

  1. Install depending software

cd irfpy.aspera
conda install -c conda-forge netcdf4
conda install -c conda-forge spiceypy
# pip install "git+https://github.com/AndrewAnnex/SpiceyPy.git" # If the above does not work
git clone git@gitlab.irf.se:irfpy/util irfpy-deps/irfpy.util
git clone git@gitlab.irf.se:irfpy/planets irfpy-deps/irfpy.planets
git clone git@gitlab.irf.se:irfpy/spice irfpy-deps/irfpy.spice
  1. Install the irfpy with “develop” option

python setup.py develop
cd irfpy-deps/irfpy.util
python setup.py develop
cd ../irfpy.planets
python setup.py develop
cd ../irfpy.spice
python setup.py develop

The difference from the python setup.py install is

  • “develop” installs the python codes as editable. Thus, when you modify the code, the change is automatically reflected. It is very useful option when you develop library, and test it. (In other words, the installation by “develop” is like a link.)

  • “install” installs the python codes as fixed installation. Thus, when you modify the code under “src/irfpy”, the change will not propagate to the installation. If you want to reflect the change, you need to install again by python setup.py install explicitly. (In other words, the installation by “install” is like a copy.)

  1. Check if the installation is successful.

% pip list | grep irfpy
irfpy.aspera (4.3.0a9, /home/...)
irfpy.planets (4.0.2a2, /home/...)
irfpy.spice (4.0.1a2, /home/...)
irfpy.util (4.4.3a7, /home/...)