Package: openghg
OpenGHG - a cloud platform for greenhouse gas data analysis and collaborationOpenGHG is a project based on the prototypeHUGS platformwhich 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 seeour documentation.Install locallyTo 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 usingpiporconda, thoughcondaallows the complete functionality to be accessed at once.UsingpipTo usepip, first create a virtual environmentpython-mvenvopenghg_envThen activate the environmentsourceopenghg_env/bin/activateIt's best to make sure you have the most up to date versions of the packages thatpipwill use behind the scenes when installing OpenGHG.pipinstall--upgradepipwheelsetuptoolsThen we can install OpenGHG itselfpipinstallopenghgEach time you use OpenGHG please make sure to activate the environment using thesourcestep above.NOTE:Some functionality is not completely accessible when OpenGHG is installed withpip. This only affects some map regridding functionality. See the Additional Functionality section below for more information.UsingcondaTo get OpenGHG installed usingcondawe'll first create a new environmentcondacreate--nameopenghg_envThen activate the environmentcondaactivateopenghg_envThen install OpenGHG and its dependencies from ourconda channeland conda-forge.condainstall--channelconda-forge--channelopenghgopenghgNote: thexesmflibrary is already incorporated into the conda install from vx.x onwards and so does not need to be installed separately.Create the configuration fileOpenGHG stores object store and user data in a configuration file in the user's home directory at~/.config/openghg/openghg.conf. As this sets the path of the object store, the user must
create this file in one of two waysCommand lineUsing theopenghgcommand line toolopenghg --quickstart

OpenGHG configuration
---------------------

Enter path for object store (default /home/gareth/openghg_store):
INFO:openghg.util:Creating config at /home/gareth/.config/openghg/openghg.conf

INFO:openghg.util:Configuration written to /home/gareth/.config/openghg/openghg.confPythonUsing thecreate_configfunction from theopenghg.utilsubmodule.from openghg.util import create_config

create_config()

OpenGHG configuration
---------------------

Enter path for object store (default /home/gareth/openghg_store):
INFO:openghg.util:Creating config at /home/gareth/.config/openghg/openghg.conf

INFO:openghg.util:Configuration written to /home/gareth/.config/openghg/openghg.confYou will be prompted to enter the path to the object store, leaving the prompt empty tells OpenGHG to use the default path in the user's home directory at~/openghg_store.Additional functionalitySome optional functionality is available within OpenGHG to allow for multi-dimensional regridding of map data (openghg.tranformsub-module). This makes use of thexesmfpackage. 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 usingdeactivateWe will need to create acondaenvironment to contain just the additional C and FORTRAN libraries necessary for thexesmfmodule (and dependencies) to run. This can be done by installing theesmfpackage usingcondacondacreate--nameopenghg_addesmf-cconda-forgeThen activate the Python virtual environment in the same way as above:sourceopenghg_env/bin/activateRun the following lines to link the Python virtual environment to the installed dependencies, doing so by installing theesmpyPython wrapper (a dependency ofxesmf):ESMFVERSION='v'$(condalist-nopenghg_addesmf|tail-n1|awk'{print $2}')$exportESMFMKFILE="$(condaenvlist|grepopenghg_add|awk'{print $2}')/lib/esmf.mk"$pipinstall"git+https://github.com/esmf-org/esmf.git@${ESMFVERSION}#subdirectory=src/addon/ESMPy/"Note: The pip install command above foresmfmodule may produce an AttributeError. At present (19/07/2022) an error of this type is expected and may not mean thexesmfmodule cannot be installed. This error will be fixed ifPR #49is merged.Now the dependencies have all been installed, thexesmflibrary can be installed within the virtual environmentpipinstallxesmfDevelopersIf 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.Clonegitclonehttps://github.com/openghg/openghg.gitInstall dependenciesWe recommend you create a virtual environment firstpython-mvenvopenghg_envThen activate the environmentsourceopenghg_env/bin/activateThen install the dependenciescdopenghg
pipinstall--upgradepipwheelsetuptools
pipinstall-rrequirements.txt-rrequirements-dev.txtNext you can install OpenGHG in editable mode using the-eflag. 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.pipinstall-e.OpenGHG should now be installed in your virtual environment.See above for additional steps to install thexesmflibrary as required.Run the testsTo run the testspytest-vtests/NOTE:Some of the tests require theudunits2library to be installed.Theudunitspackage is notpipinstallable so we've added a separate flag to specifically run these tests. If you're on Debian / Ubuntu you can dosudoapt-getinstalllibudunits2-0You can then run thecfchecksmarked tests usingpytest-v--run-cfcheckstests/If all the tests pass then you're good to go. If they don't pleaseopen an issueand let us
know some details about your setup.DocumentationFor further documentation and tutorials please visitour documentation.CommunityIf 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.