Skip to main content

OpenGHG logo

OpenGHG - a cloud platform for greenhouse gas data analysis and collaboration

License codecov OpenGHG tests

OpenGHG is a project based on the prototype HUGS platform which aims to be a platform for collaboration and analysis of greenhouse gas (GHG) data.

The platform will be built on open-source technologies and will allow researchers to collaborate on large datasets by harnessing the power and scalability of the cloud.

For more information please see our documentation.

Cloud

You can login to our OpenGHG Cloud JupyterHub and use OpenGHG in the cloud. This will allow you to use the full power of OpenGHG from your local device. Once you're logged in please checkout some of our tutorials to help you get started.

Install locally

To run OpenGHG locally you'll need Python 3.8 or later on Linux or MacOS, we don't currently support Windows.

You can install OpenGHG using pip or conda, though conda allows the complete functionality to be accessed at once.

Using pip

To use pip, first create a virtual environment

python -m venv openghg_env

Then activate the environment

source openghg_env/bin/activate

It's best to make sure you have the most up to date versions of the packages that pip will use behind the scenes when installing OpenGHG.

pip install --upgrade pip wheel setuptools

Then we can install OpenGHG itself

pip install openghg

Each time you use OpenGHG please make sure to activate the environment using the source step above.

NOTE: Some functionality is not completely accessible when OpenGHG is installed with pip. This only affects some map regridding functionality. See the Additional Functionality section below for more information.

Using conda

To get OpenGHG installed using conda we'll first create a new environment

conda create --name openghg_env

Then activate the environment

conda activate openghg_env

Then install OpenGHG and its dependencies from our conda channel and conda-forge.

conda install --channel conda-forge --channel openghg openghg

Note: the xesmf library is already incorporated into the conda install from vx.x onwards and so does not need to be installed separately.

Additional functionality

Some optional functionality is available within OpenGHG to allow for multi-dimensional regridding of map data (openghg.tranform sub-module). This makes use of the xesmf package. This Python library is built upon underlying FORTRAN and C libraries (ESMF) which cannot be installed directly within a Python virtual environment.

To use this functionality these libraries must be installed separately. One suggestion for how to do this is as follows.

If still within the created virtual environment, exit this using

deactivate

We will need to create a conda environment to contain just the additional C and FORTRAN libraries necessary for the xesmf module (and dependencies) to run. This can be done by installing the esmf package using conda

conda create --name openghg_add esmf -c conda-forge

Then activate the Python virtual environment in the same way as above:

source openghg_env/bin/activate

Run the following lines to link the Python virtual environment to the installed dependencies, doing so by installing the esmpy Python wrapper (a dependency of xesmf):

ESMFVERSION='v'$(conda list -n openghg_add esmf | tail -n1 | awk '{print $2}')
$ export ESMFMKFILE="$(conda env list | grep openghg_add | awk '{print $2}')/lib/esmf.mk"
$ pip install "git+https://github.com/esmf-org/esmf.git@${ESMFVERSION}#subdirectory=src/addon/ESMPy/"

Note: The pip install command above for esmf module may produce an AttributeError. At present (19/07/2022) an error of this type is expected and may not mean the xesmf module cannot be installed. This error will be fixed if PR #49 is merged.

Now the dependencies have all been installed, the xesmf library can be installed within the virtual environment

pip install xesmf

Setting the object store path

On first import OpenGHG will create a configuration file at ~/.config/openghg/openghg.conf. This file contains the path to the object store, which by default is set to ~/openghg_store.

The contents of the file will look like this

[object_store]
local_store = "/home/your_username/openghg_store"

or on macOS

[object_store]
local_store = "/Users/your_username/openghg_store"

Change this path to set the object store path.

Developers

If you'd like to contribute to OpenGHG please see the contributing section of our documentation. If you'd like to take a look at the source and run the tests follow the steps below.

Clone

git clone https://github.com/openghg/openghg.git

Install dependencies

We recommend you create a virtual environment first

python -m venv openghg_env

Then activate the environment

source openghg_env/bin/activate

Then install the dependencies

cd openghg
pip install --upgrade pip wheel setuptools
pip install -r requirements.txt -r requirements-dev.txt

Next you can install OpenGHG in editable mode using the -e flag. This installs the package from the local path and means any changes you make to the code will be immediately available when using the package.

pip install -e .

OpenGHG should now be installed in your virtual environment.

See above for additional steps to install the xesmf library as required.

Run the tests

To run the tests

pytest -v tests/

NOTE: Some of the tests require the udunits2 library to be installed.

The udunits package is not pip installable so we've added a separate flag to specifically run these tests. If you're on Debian / Ubuntu you can do

sudo apt-get install libudunits2-0

You can then run the cfchecks marked tests using

pytest -v --run-cfchecks tests/

If all the tests pass then you're good to go. If they don't please open an issue and let us know some details about your setup.

Documentation

For further documentation and tutorials please visit our documentation.

Community

If you'd like further help or would like to talk to one of the developers of this project, please join our Gitter at gitter.im/openghg/lobby.

Metadata

Release files for openghg 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for openghg 0.4.0
File Size Uploaded
openghg-0.4.0.tar.gz 280.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for openghg 0.4.0
File Interpreter ABI Platform
openghg-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 557.1 kB

Release files / openghg-0.4.0.tar.gz

Download URL openghg-0.4.0.tar.gz
Size 280.7 kB
Tags Source
SHA-256 checksum
How to use checksums
dccee684b233511b113dd58dc83a3b6cbf8a4d8f6c2d044cee332c084b35453a
BLAKE2b-256 checksum
How to use checksums
71eb44478ad491ba329fb995686b0a04db519cb4cdf90224c50207b97965b2bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.1

Release files / openghg-0.4.0-py3-none-any.whl

Download URL openghg-0.4.0-py3-none-any.whl
Size 276.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
599c9abf3c3866dafef1c624dc3cdffcd49af073718e7d5f86efcaed0c48f540
BLAKE2b-256 checksum
How to use checksums
a883c246250d64991b54ae681e9a4eab0ee6c25463235d30d71d4e38e4eac3bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.1

Release history Release notifications | RSS feed

1.0.0

2 release files

0.19.0

2 release files

0.18.0

2 release files

0.17.0

2 release files

0.16.0

2 release files

0.15.0

2 release files

0.14.0

1 release file

0.13.0

2 release files

0.12.0

2 release files

0.11.1

2 release files

0.11.0

2 release files

0.10.1

2 release files

0.10.0

2 release files

0.9.0

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.1

2 release files

0.5.0

2 release files

This release

0.4.0 This release

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page