Skip to content

For developers

Karsten Bolding edited this page Sep 13, 2023 · 2 revisions

Downloading and maintaining the code

To install from code both the pygetm and fabmos source codes must be available. In principle the code can be installed in any folder and in the following the following base-folder is assumed ./source/repos. If installed in a different folder the commands associated with changing directories in the following must be adjusted accordingly.

The only prerequisite for installing the code is git.

Create a base base folder:

mkdir source
cd source
mkdir repos
cd repos

The above can be copy and pasted verbatim on Windows, Mac and Linux.

Now clone the code using the following two commands - assuming being in the repos dir:

git clone --recursive https://github.com/BoldingBruggeman/getm-rewrite.git
git clone --recursive https://github.com/BoldingBruggeman/fabmos.git

This will create two new folders getm-rewrite and fabmos with the most up to date source code as available from the repositories.

To update the code in the future the following commands can be used:

In the getm-rewrite and fabmos folders issue the command git pull --recurse-submodules to update the code and all its dependencies to the latest version.

There are two different methods to create the build environment - i.e. assure that the necessary tools are available. The first is to use condaand the other is to manually assure all requirements are available.

Installation from source in a Conda environment

In the getm-rewrite folder do:

conda env create -f environment.yml -n fabmos
conda activate fabmos

source ./install

cd ../fabmos
conda install -c conda-forge h5py
pip install .

with the following notes:

  • -n fabmos overwrites the name of the environment from the default pygetm
  • use the provided install file to build and install pygetm
  • fabmos depends on h5py
  • use pip to install fabmos

To check if the installation is correct the following commands can be executeted - be sure to be in an active fabmosconda environment.

python
import fabmos
fabmos.__version__
Clone this wiki locally