NEMO-Cmd Package Development

Licensed under the Apache License, Version 2.0 Python Version Git on GitHub pre-commit The uncompromising Python code formatter Hatch project Documentation Status Sphinx linkcheck Pytest with Coverage Status Codecov Testing Coverage Report CodeQL analysis Issue Tracker

Python Versions

Python Version

The NEMO-Cmd package is developed using Python 3.11. The minimum supported Python version is 3.10. The Continuous Integration workflow on GitHub ensures that the package is tested for all versions of Python>=3.10. An old version of the package running under Python 3.5 is depoloyed on the Westgrid orcinus HPC platform. That version is tagged in the repository as orcinus-python-3.5.

Getting the Code

Git on GitHub

Clone the code and documentation repository from GitHub with:

$ git clone

Development Environment

Setting up an isolated development environment using Conda is recommended. Assuming that you have Miniconda3 installed, you can create and activate an environment called nemo-cmd that will have all of the Python packages necessary for development, testing, and building the documentation with the commands below.

$ cd NEMO-Cmd
$ conda env create -f envs/environment-dev.yaml
$ conda activate nemo-cmd

NEMO-Cmd is installed in editable install mode as part of the conda environment creation process. That means that the package is installed from the cloned repo via symlinks so that it will be automatically updated as the repo evolves.

To deactivate the environment use:

(nemo-cmd)$ conda deactivate

Coding Style

pre-commit The uncompromising Python code formatter

The NEMO-Cmd package uses Git pre-commit hooks managed by pre-commit to maintain consistent code style and and other aspects of code, docs, and repo QA.

To install the pre-commit hooks in a newly cloned repo, activate the conda development environment, and run pre-commit install:

$ cd NEMO-Cmd
$ conda activate nemo-cmd
(nemo-cmd)$ pre-commit install


You only need to install the hooks once immediately after you make a new clone of the NEMO-Cmd repository and build your Development Environment.

Building the Documentation

Documentation Status

The documentation for the NEMO-Cmd package is written in reStructuredText and converted to HTML using Sphinx.

If you have write access to the repository on GitHub, whenever you push changes to GitHub the documentation is automatically re-built and rendered at

Additions, improvements, and corrections to these docs are always welcome.

The quickest way to fix typos, etc. on existing pages is to use the Edit on GitHub link in the upper right corner of the page to get to the online editor for the page on GitHub.

For more substantial work, and to add new pages, follow the instructions in the Development Environment section above. In the development environment you can build the docs locally instead of having to push commits to GitHub to trigger a build on and wait for it to complete. Below are instructions that explain how to:

  • build the docs with your changes, and preview them in Firefox

  • check the docs for broken links

Building and Previewing the Documentation

Building the documentation is driven by the docs/Makefile. With your mohid-cmd development environment activated, use:

(nemo-cmd)$ (cd docs && make clean html)

to do a clean build of the documentation. The output looks something like:

Removing everything under '_build'...
Running Sphinx v3.3.0
making output directory... done
loading intersphinx inventory from
loading intersphinx inventory from
loading intersphinx inventory from
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 9 source files that are out of date
updating environment: [new config] 9 added, 0 changed, 0 removed
reading sources... [100%] subcommands
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [100%] subcommands
generating indices... genindex done
highlighting module code... [100%] nemo_cmd.prepare
writing additional pages... search done
copying static files... done
copying extra files... done
dumping search index in English (code: en)... done
dumping object inventory... done
build succeeded.

The HTML pages are in _build/html.

The HTML rendering of the docs ends up in NEMO-Cmd/docs/_build/html/. You can open the index.html file in that directory tree in your browser to preview the results of the build before committing and pushing your changes to GitHub.

Whenever you push changes to the NEMO-Cmd repository on GitHub the documentation is automatically re-built and rendered at

Running the Unit Tests

The test suite for the NEMO-Cmd package is in NEMO-Cmd/tests/. The pytest tools is used for test fixtures and as the test runner for the suite.

With your nemo-cmd development environment activated, use:

(salishsea-cmd)$ cd NEMO-Cmd/
(salishsea-cmd)$ pytest

to run the test suite. The output looks something like:

=========================== test session starts =============================
platform linux -- Python 3.6.1, pytest-3.0.5, py-1.4.32, pluggy-0.4.0
rootdir: /media/doug/warehouse/MEOPAR/NEMO-Cmd, inifile:
collected 166 items

tests/ ........
tests/ ............
tests/ ...
tests/ ...
tests/ .............
tests/ .....................................................................................
tests/ ..........................................

======================== 166 passed in 1.68 seconds ========================

You can monitor what lines of code the test suite exercises using the and pytest-cov tools with the command:

(salishsea-cmd)$ cd NEMO-Cmd/
(salishsea-cmd)$ pytest --cov=./

The test coverage report will be displayed below the test suite run output.

Alternatively, you can use

(salishsea-cmd)$ pytest --cov=./ --cov-report html

to produce an HTML report that you can view in your browser by opening NEMO-Cmd/htmlcov/index.html.

Continuous Integration

Pytest with Coverage Status Codecov Testing Coverage Report

The NEMO-Cmd package unit test suite is run and a coverage report is generated whenever changes are pushed to GitHub. The results are visible on the repo actions page, from the green checkmarks beside commits on the repo commits page, or from the green checkmark to the left of the “Latest commit” message on the repo code overview page . The testing coverage report is uploaded to

The GitHub Actions workflow configuration that defines the continuous integration tasks is in the .github/workflows/pytest-coverage.yaml file.

Version Control Repository

Git on GitHub

The NEMO-Cmd package code and documentation source files are available from the Git repository at

Issue Tracker

Issue Tracker

Development tasks, bug reports, and enhancement ideas are recorded and managed in the issue tracker at


Licensed under the Apache License, Version 2.0

The NEMO command processor and documentation are copyright 2013 – present by the SalishSeaCast Project Contributors and The University of British Columbia.

They are licensed under the Apache License, Version 2.0. Please see the LICENSE file for details of the license.

Release Process

Releases are done at Doug’s discretion when significant pieces of development work have been completed.

The release process steps are:

  1. Use hatch version release to bump the version from .devn to the next release version identifier

  2. Edit docs/CHANGES.rst to update the version identifier and replace unreleased with the release date

  3. Commit the version bump and change log update

  4. Create and annotated tag for the release with Git -> New Tag… in PyCharm or git tag -e -a vyy.n

  5. Push the version bump commit and tag to GitHub

  6. Use the GitHub web interface to create a release, editing the auto-generated release notes as necessary

  7. Use the GitHub Issues -> Milestones web interface to edit the release milestone:

    • Change the Due date to the release date

    • Delete the “when it’s ready” comment in the Description

    • Close the release milestone

  8. Use the GitHub Issues -> Milestones web interface to create a milestone for the next release:

    • Set the Title to the next release version, prepended with a v; e.g. v23.1

    • Set the Due date to the end of the year of the next release

    • Set the Description to something like v23.1 release - when it's ready :-)

    • Create the next release milestone

  9. Use hatch version minor,dev to bump the version for the next development cycle, or use hatch version major,minor,dev for a year rollover version bump

  10. Edit docs/CHANGES.rst to add a new section for the unreleased dev version

  11. Commit the version bump and change log update

  12. Push the version bump commit to GitHub