fremorizer CMORizes FRE output with CMOR. It is a conda package and it's documentation can be found on
readthedocs.
fremorizer is a model output rewriter (CMORizer) for FRE/FMS based models and output. It was originally the fre.cmor
submodule of NOAA-GFDL/fre-cli. fremorizer (or fremor for short) is geared
for rewriting NOAA-GFDL datasets for further quality control checks, assessments and data publishing pipelines in the
context of CMIP7 using the CMOR library.
python>=3.11click>=8.2cmor>=3.14.2netCDF4>=1.7numpy>=2pyyaml
For development and testing, pylint, pytest, and pytest-cov are all highly recommended as helpful additions.
If you're trying to gain access to fremor functionality as quickly as possible:
# the current post-release in main
module load fremorizer/test
# a tagged version of fremorizer, post-releases will never be named modules
module load fremorizer/X.Y.ZIf you have a path to a fremorizer environment you can activate it like so:
conda activate some/path/to/fremorizer_envIf you want your own fremorizer environment:
# the environment will be named fremorizer_en
conda create -n fremorizer_env ilaflott::fremorizer
# see fremorizer_env in the list --> activate it by name
conda env list
conda activate fremorizer_envor, if you've already activated a conda environment
conda create -n empty_env
conda activate empty_env
conda install -c ilaflott fremorizer
# equivalent syntax
conda install ilaflott::fremorizerIf you're trying to develop fremorizer capabilities, or edit the code to your liking in either a big or small way,
this is for you. This checks out the code, creates and activates an environment, installs into the environment,
and runs all unit-tests and pylint checks:
# omit --recursive if you don't want tables as submodules
git clone --recursive https://github.com/ilaflott/fremorizer.git
cd fremorizer
# create an environment and install the local checkout
conda env create -f environment.yaml
conda actiavte fremorizer
pip install -e .
# Run tests
pytest fremorizer/tests/
# Run linter
pylint --rcfile pylintrc fremorizer/The CLI entry point is fremor, currently a suite of (currently) six routines for facillitating data preparation for
CMIP7.
# The full list of subcommands
fremor init # Initialize CMOR configuration resources: generate template user config, fetch tables
fremor find # Find and print variables in MIP tables according to your variable lists or other input
fremor varlist # Create a simple variable list of netCDF files in a directory
fremor config # Generate a basic CMOR YAML configuration from a pp directory tree
fremor yaml # Bulk routine for processing data based on a CMOR YAML config, calls fremor run many times
fremor run # Lowest-level routine, no CMOR YAML needed, rewrites output files in a directory with CMORThe CLI offers full logging and verbosity control independent of the command chosen:
# verbosity and logging
fremor -v ... # INFO level logging
fremor -vv ... # DEBUG level logging
fremor -q ... # ERROR level only (quiet)
fremor -l mylog.txt ... # Log to file (appends)If you've used the previous fre cmor command, there is a direct mapping of syntax:
# past fre-cli command
fre -vv -l logfile.txt cmor <COMMAND> [OPTIONS]
# fremorizer equivalent
fremor -vv -l logfile.txt <COMMAND> [OPTIONS]Each CLI subcommand (run, yaml, etc.) maps to an API under under fremor, so the CLI functionality
is equivalently available via import in scripts as a proper python module
For an overview of required inputs and sample commands, see the CMOR Quickstart.
The wcrp_compliance_check workflow validates CMORized NetCDF outputs against WCRP project
specifications using cc-plugin-wcrp, a plugin for
the IOOS compliance-checker. This pipeline:
- Runs automatically on pull requests and via manual dispatch
- Executes unit tests to generate CMORized output files
- Gathers and categorizes outputs by CMIP version (CMIP6, CMIP7)
- Validates outputs using the
wcrp_cmip6compliance checker - Uploads compliance reports as workflow artifacts (retained for 30 days)
To view compliance results from a workflow/CI run:
- Navigate to the Actions tab in GitHub
- Select the
wcrp_compliance_checkworkflow run - Download the
wcrp-compliance-reportsartifact
| Python 3.11 | Python 3.12 | Python 3.13 | Python 3.14 |
|---|---|---|---|
Apache License 2.0 — see LICENSE.md
fremorizer uses a post-release scheme to identify development beyond the latest tagged version and tie the current main branch to a
conda package versioned as develop. To avoid confusion with fre-workflows and fre-cli, which often demand that the version tags
match, fremorizer's version format is X.Y.Z[.post].
To publish new release carefully follow the below procedure:
- create a new branch off of
main, which is already published tocondaunderdevelop/the previous tagged version +.post - edit the version number in
fremorizer/_version.pyfrom the current one, to the desired version tag, remove.post, then open a PR. edit nothing else (usually). - confirm the branch is functional by letting workflows finish, if you see green checks only, proceed. otherwise, stop and debug.
- draft a new release pointing to the PR branch, click release. the publishing workflow should trigger and finish, and you should see the
X.Y.Zversion in the conda channel. - releases in this repository are immutable, so even if the release workflow fails, breathe and move on to the next step.
- edit the version number in
fremorizer/_version.pytoX.Y.Z.post, and merge the PR to main workflow steps passed.publish_condawill trigger again and upload what is inmainunder thecondaversiondevelopandpipversionX.Y.Z.post