NOAA-ORR-ERD / model_catalogs

Python library for developing and working with catalogs of oceanographic model results
https://model-catalogs.readthedocs.io/en/latest/index.html
MIT License
6 stars 1 forks source link

model_catalogs

Build Status Code Coverage License:MIT Documentation Status Code Style Status Conda Version Python Package Index

Provides access through Intake catalogs to a set of ocean models, especially the NOAA OFS models. In particular, this package is good for working with unaggregated NOAA OFS models.

Specific functionality includes:

Installation

PyPI

To install from PyPI:

pip install model_catalogs

conda-forge

To install from conda with channel conda-forge:

conda install -c conda-forge model_catalogs

Install Optional Dependencies

Install additional dependencies for full functionality and running the demonstration notebooks. Activate your Python environment, then:

$ mamba install -c conda-forge --file conda-requirements-opt.txt

or use conda in place of mamba if you don't have mamba installed.

Develop Package

Choose environment approach

Use provided environment

Clone the repo:

$ git clone http://github.com/NOAA-ORR-ERD/model_catalogs.git

In the model_catalogs directory, install conda environment:

$ conda env create -f environment.yml

Install model_catalogs into new environment (still in model_catalogs directory):

$ conda activate model_catalogs
$ pip install -e .

Use other environment

Alternatively, if you have an existing environment you want to add to, clone the repo:

$ git clone http://github.com/NOAA-ORR-ERD/model_catalogs.git
$ cd model_catalogs

Make sure the desired environment is activated and then:

$ conda install -c conda-forge --file conda-requirements.txt
$ pip install -r pip-requirements.txt

Install model_catalogs into the environment (still in model_catalogs directory):

$ pip install -e .

Install development packages

To develop the code, follow instructions above for "Use provided environment" or "Use other environment" as appropriate. Then you can install additional dependencies for development and testing with

$ conda install -c conda-forge --file conda-requirements-dev.txt

Run tests

Run tests that haven't been marked as "slow" with

$ pytest

Run all tests, including slow tests, with:

$ pytest --runslow

Check precommits locally before pushing

To then check code before committing and pushing it to github, locally run

$ pre-commit run --all-files

These checks can change your files so it is best to check the changes before pushing to github.

Compile docs

Compile the docs locally after having installed the developer packages (see "Install development packages") or after making the docs environment with

$ conda env create -f docs/environment.yml

and activating that environment.

Navigate to the docs folder and build the html documentation with

$ make html

Finally you can make sure the documentation looks right by opening "_build/html/index.html".