Skip to content

ACCESS-NRI/umfile_utils

Repository files navigation

UMfile_utils

UMfile_util is a Python library that provides specific tools to process UM files.

Installation

umfile_utils is released as a conda package within the accessnri Anaconda.org channel. To install it, run:

conda install accessnri::umfile_utils

List of functions

perturbIC

Apply a random perturbation to a restart file, with an optional seed to control the random generation. This can be useful for simulations that fail due to random divergence or for generating multiple ensemble members in climate experiments.

Run pertubIC --help for detailed usage information.

um_fields_subset

Subset a UM file to generate an output containing only selected fields. Options are available to include or exclude specific STASH variables.

Run um_fields_subset --help for detailed usage information.

change_date

Change the time metadata of a UM restart file, without modifying its data content.

Run change_date --help for detailed usage information

Contributing

External contributions (not from ACCESS-NRI) are accepted in the form of issues and PRs from forked repos.

Development/Testing instructions

For development/testing, it is recommended to install umfile_utils as a development package within a micromamba/conda testing environment.

Clone/fork umfile_utils GitHub repo

Note

If you are not part of the ACCESS-NRI, you can fork the repo instead.

git clone [email protected]:ACCESS-NRI/umfile_utils.git

Create a micromamba/conda testing environment

Tip

In the following instructions micromamba can be replaced with conda.

cd umfile_utils
micromamba env create -n umfile_utils_dev --file .conda/env_dev.yml
micromamba activate umfile_utils_dev

Install umfile_utils as a development package

pip install --no-deps --no-build-isolation -e .

Running the tests

To manually run the tests, from the umfile_utils directory, you can:

  1. Activate your micromamba/conda testing environment
  2. Run the following command:
    pytest
    

License

Apache-2.0