Installation for developer¶
Here is the step-by-step guide for the library developer of irfpy.sara
.
Here “developer” means the persons who will change the codes
under src/irfpy/
in the source tree.
Clone the source code of
irfpy.sara
.% git clone git@gitlab.irf.se:irfpy/sara
Clone depending source code tree(s)
% git clone git@gitlab.irf.se:irfpy/util % git clone git@gitlab.irf.se:irfpy/planets
(Optional, but recommended) Create a new environment in Anaconda.
% conda create -n irfpy.sara-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
% source activate irfpy.sara-develop
from command line.
If you are working with development environment (e.g. PyCharm, Spyder, etc), you can point the python interpreter to
~/anaconda/envs/irfpy.sara-develop/bin/python
by setting of each program.Install the depending libraries
irfpy.sara
depends on Spiceypy and basemap.% conda install -c conda-forge spiceypy % conda install -c conda-forge basemap
Install
Sadppac
Sadppac should be intalled, following the instruction here.
Install the
irfpy
with “develop” option% cd sara % python setup.py develop % cd ../util % python setup.py develop % cd ../planets % 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.)
Check if the installation is successful.
% pip list | grep irfpy irfpy.jcat (4.0.1a1, /home/user/Documents/my-development/jcat/src) irfpy.planets (4.0.1, /home/user/Documents/my-development/planets/src) irfpy.util (4.2.5, /home/user/Documents/my-development/util/src)
Install Sadppac
% cd irfpy-deps/libsadppac-mirror % python setup.py install
Check if Sadppac is installed.
% pip list | grep Sadppac Sadppac 0.4
Note
2020-06-03: Sadppac >=0.4 should be used.