Model output rewriter (CMORizer) for FRE/FMS based models
Project description
fremor
fremor CMORizes FRE output with CMOR. It is a conda package and it's documentation can be found on
readthedocs.
License
Apache License 2.0 — see LICENSE.md
Background and Purpose
fremor is a model output rewriter (CMORizer) for FRE/FMS based models and output. It is specifically geared for standardizing
NOAA-GFDL datasets for further quality control checks, assessments and data publishing pipelines in the context of CMIP7
using the CMOR library.
Relationship to fre-cli
fremor was originally the fre.cmor submodule of NOAA-GFDL/fre-cli and so stands
on the shoulders of it's contributors, retaining it's general structure and lessons learned from it. Future re-integrations
back into fre-cli, as a formal package dependency, are being assessed.
Contributors
AI Disclaimer
AI was heavily used in the creation of this repository, primarily github's copilot with Claude (opus4.6, sonnet4.6,
and haiku), and Gemini and Chat-GPT models to a lesser extent, in agent mode. Claude and Codex agents have also
contributed.
Quickstart
For an overview of required inputs and sample commands, see the CMOR Quickstart.
Installation / Access
Requirements
python>=3.11click>=8.2cmor>=3.15.0netCDF4>=1.7numpy>=2pyyaml
For development and testing, pylint, pytest, and pytest-cov are all highly recommended as helpful additions.
via PPAN / modules (COMING SOON/TODO)
If you're trying to gain access to fremor functionality as quickly as possible:
# the current post-release in main
module load fremor/test
# a tagged version of fremor, post-releases will never be named modules
module load fremor/X.Y.Z
via conda and/or conda-forge
If you have a path to a fremor environment you can activate it like so:
conda activate some/path/to/fremor_env
If you want your own fremor environment:
# the environment will be named fremor_en
conda create -n fremor_env conda-forge::fremor
# see fremor_env in the list --> activate it by name
conda env list
conda activate fremor_env
or, if you've already activated a conda environment
conda create -n empty_env
conda activate empty_env
conda install -c conda-forge fremor
# equivalent syntax
conda install conda-forge::fremor
pip install source/checkout into a virtual environment (conda/venv)
If you're trying to develop fremor 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/NOAA-GFDL/fremor.git
cd fremor
# create an environment and install the local checkout
conda env create -f environment.yaml
conda activate fremor
pip install -e .
# Run tests
pytest fremor/tests/
# Run linter
pylint --rcfile pylintrc fremor/
Usage
as a command line interface (CLI)
The CLI entry point is fremor, currently a suite of (currently) six routines for facilitating 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 CMOR
The 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]
# fremor equivalent
fremor -vv -l logfile.txt <COMMAND> [OPTIONS]
as a python module
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
CI/CD Workflows and QA
WCRP Compliance Checking (under development)
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
Versioning and tags
fremor uses a post-release scheme to identify development beyond the latest tagged version. To avoid confusion
with fre-workflows and fre-cli, which often demand that the version tags match, fremor's version format is
X.Y.Z[.post].
New Release Procedure
This procedure is being actively tested and checked now, and may change in the future. Document any deviations taken from this guide!
To publish new release, cease merging new PRs to main, and carefully follow the below procedure:
first, create a new tag for release
- create a new branch off of
main, which should be the previous tagged version +.post, give it a name different than the exact tag you are creating - edit the version number in
fremor/_version.pyfrom the current one, to the desired version tag, remove.post, then open a PR tomainin this repository. - confirm the branch is functional by letting workflows finish, if you see green checks only, proceed. otherwise, stop and debug.
- at this point, light clean up style edits are OK, but functional edits are not. Do so until happy and keep the checks passing.
- now create the tag from the branch at this point locally in your terminal with
git tag X.Y.Z;
second, publish release to PyPI, then github, in that order
WARNING: any problems or mistakes after the next step are irreversible due to package immutability so make sure things are working before continuing
- now push your tag you created locally with
git checkout X.Y.Z; git push origin HEAD:refs/tags/X.Y.Z - workflow checks are triggered by the new push to the new tag
X.Y.Z, and one of the workflows will to publish the built package toPyPI, check the actions tab - on github, create a new release from the new tag, generate release notes automatically comparing to the previous
tag, and upload the built
X.Y.Zpackage downloaded fromPyPIyou cannot do this later due to immutability of releases
third, publish release to conda-forge via fremor-feedstock fork
- use (create if needed) a fork (e.g. https://github.com/ilaflott/fremor-feedstock) to create a new branch called
fremorX.Y.Z, e.g. https://github.com/ilaflott/fremor-feedstock/tree/fremor0.9.3 - adjust the version to
X.Y.Zand update thesha256to what it says on PyPI inrecipe.yaml - open a PR to the
conda-forge/fremor-feedstocke.g. https://github.com/conda-forge/fremor-feedstock/pull/3 - once checks pass, a reviewer with access to
conda-forge/fremor-feedstockcan approve and merge, kicking off the rest of the publishing pipeline toconda-forge
wrap-up
- back to the
fremorPR we opened intially. - edit the version number in
fremor/_version.pytoX.Y.Z.post, let the checks pass - merge the PR branch you used for creating the release to
main
what a published release on PyPI looks like: https://pypi.org/project/fremor/0.9.3/#fremor-0.9.3.tar.gz
what a published PyPI package on github looks like: https://github.com/NOAA-GFDL/fremor/releases/tag/0.9.3
what a published PyPI package on conda-forge looks like: https://anaconda.org/channels/conda-forge/packages/fremor/files
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fremor-0.9.4.tar.gz.
File metadata
- Download URL: fremor-0.9.4.tar.gz
- Upload date:
- Size: 11.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9dc05baeb819d7083456331f1edac499576f4fdfb803a3cb094a189caa71ae7a
|
|
| MD5 |
f8345ce7c8fe45ebb1e23d4ea80dd9ea
|
|
| BLAKE2b-256 |
03a552f47ab38ebf6719a0f08795171b992f7d31c48a2a4f170b3d1f7e4f1154
|
Provenance
The following attestation bundles were made for fremor-0.9.4.tar.gz:
Publisher:
publish_pip.yml on NOAA-GFDL/fremor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fremor-0.9.4.tar.gz -
Subject digest:
9dc05baeb819d7083456331f1edac499576f4fdfb803a3cb094a189caa71ae7a - Sigstore transparency entry: 1539404944
- Sigstore integration time:
-
Permalink:
NOAA-GFDL/fremor@de577f34d465a4eafa00216f8d53861a08b1fdb7 -
Branch / Tag:
refs/tags/0.9.4 - Owner: https://github.com/NOAA-GFDL
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_pip.yml@de577f34d465a4eafa00216f8d53861a08b1fdb7 -
Trigger Event:
push
-
Statement type:
File details
Details for the file fremor-0.9.4-py3-none-any.whl.
File metadata
- Download URL: fremor-0.9.4-py3-none-any.whl
- Upload date:
- Size: 11.6 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a0f6788f8202874717a6d4a6d111b0f25392e29b8500ad496b9b631dbaf84105
|
|
| MD5 |
b63beb8d34ab14fc4c029c4c5ad02309
|
|
| BLAKE2b-256 |
e6f27d8e4ea88257ef2b6d7ac47e3dfbe0b6c67a87e2bdd735b3ea459f848da3
|
Provenance
The following attestation bundles were made for fremor-0.9.4-py3-none-any.whl:
Publisher:
publish_pip.yml on NOAA-GFDL/fremor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fremor-0.9.4-py3-none-any.whl -
Subject digest:
a0f6788f8202874717a6d4a6d111b0f25392e29b8500ad496b9b631dbaf84105 - Sigstore transparency entry: 1539405030
- Sigstore integration time:
-
Permalink:
NOAA-GFDL/fremor@de577f34d465a4eafa00216f8d53861a08b1fdb7 -
Branch / Tag:
refs/tags/0.9.4 - Owner: https://github.com/NOAA-GFDL
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_pip.yml@de577f34d465a4eafa00216f8d53861a08b1fdb7 -
Trigger Event:
push
-
Statement type: