Skip to content

Installing OM4Labs as a Developer

John Krasting edited this page Aug 25, 2021 · 1 revision

Setting up a development environment:

You are welcome to develop in any Python environment with Python 3.7 or greater. However, you may find it easier to set up a dedicated environment for developing new analyses for the package. The advantage a dedicated environment is that OM4Labs will not interfere or attempt to change versions of any existing packages you might rely on. Here is a recipe for a basic environment:

Get the source code:

git clone https://github.com/raphaeldussin/om4labs.git

Create a conda environment:

conda env create -f om4labs/ci/environment.yml
conda activate om4labs

Installing OM4Labs in developer mode

When you install most Python packages, the code is stored deep inside Python's site_packages structure making it difficult to edit. Installing the package in developer mode allows to you access the code more easily and to edit the code under version control.

To install the OM4Labs package in developer mode:

cd om4labs
pip install -e .

Testing the installation

After installing the package, you should verify the installation. This Makefile will download sample model data and observations (~1.5 GB) and run some basic tests. This data might also be useful as you develop your own diagnostics.

Test the installation:

cd testing
make domain=OM4p125
make domain=OM4p25