Skip to main content

Generate Time Series (GenTS)

Available on pypi Docs GitHub License

The GenTS (Generate Time Series) is an open-source Python Package designed to simplify the post-processing of history files into time series files. This package includes streamlined functions that require minimal input to operate and a documented API for custom workflows.

Features

  • Robust Python API with immutable framework that simplifies integration with existing post-processing workflows and development of new ones
  • Command line interface with sensible defaults for common CESM/E3SM cases and flags for edge/custom cases
  • Supports parallel processing for maximizing data throughput
  • Checks existing time series output for integrity to generate only the remaining files needed
  • Adaptive re-chunking for compliance with CMOR (Climate Model Output Rewriter) standards
  • Comprehensive testing suite for ensuring accuracy and reliability
  • ASV benchmarking suite for maintaining performance across releases
  • Docker/Apptainer/Singularity containers for bypassing complicated environment setups
  • Detailed documentation for self-debugging and quickly on-boarding contributors

Installation

GenTS can be installed in a Python environment using pip. This requires a conda, uv, or Python virtual environment for installing GenTS dependencies (namely numpy, netCDF4, and cftime).

For maximum portability and to avoid environment issues, use the containerized version of GenTS.

PyPI

pip install gents

To install from source, please view the ReadTheDocs Documentation.

Container

Apptainer and Singularity container platforms are typically employed over Docker in HPC environments. Luckily, these platforms (and most others) support running directly from Docker images. The form thus varies across institutions and systems:

For Derecho and Casper (NCAR):

module load apptainer
apptainer run --bind /glade/derecho --cleanenv docker://agentoxygen/gents:latest run_gents --help

For TACC Systems:

module load apptainer
apptainer run docker://agentoxygen/gents:latest run_gents --help

For Perlmutter (NERSC):

shifterimg -v pull docker:agentoxygen/gents:latest
shifter --image=docker:agentoxygen/gents:latest run_gents --help

Running GenTS

Note

It is bad practice to run GenTS on a login node due to the large number of IO-heavy processes it can create. Instead, submit GenTS in a batch job or run it interactively on a compute node. Here are reference pages for deploying interactive sessions on compute nodes for popular HPC centers:

Derecho/Casper Instructions

TACC Instructions

Perlmutter Instructions

GenTS comes with a pre-configured CLI that can be run on most CESM model output and E3SM (atm-only) model output by calling run_gents. The CLI is built on a robust API which can also be configured in a Python script or Jupyter Notebook for custom cases/workflows.

CLI

To view options for running in the command line:

run_gents --help

API Example

Example run.py:

from gents.hfcollection import HFCollection
from gents.timeseries import TSCollection


if __name__ == "__main__":
    input_head_dir = "... case directory with model output ..."
    output_head_dir = "... scratch directory to output time series to ..."

    hf_collection = HFCollection(input_head_dir, num_processes=64)
    hf_collection = hf_collection.include(["*/atm/*", "*/ocn/*", "*.h4.*"])

    ts_collection = TSCollection(hf_collection.include_years(0, 5), output_head_dir, num_processes=32)
    ts_collection = ts_collection.apply_overwrite("*")
    ts_collection.execute()

Then execute the script in a Conda or Python virtual environment with gents installed:

python run.py

Or run from the container:

apptainer run docker://agentoxygen/gents:latest python run.py

Contributor/Bug Reporting Guidelines

Please report all issues to the GitHub issue tracker. When submitting a bug, run gents.utils.enable_logging(verbose=True) at the top of your script to include all log output. This will aid in reproducing the bug and quickly developing a solution.

For development, it is recommended to use the Docker method for testing. These tests are automatically run in the GitHub workflow, but should be run before committing changes.

Citation

If our software package helps you with your research, please consider citing it:

In BibTeX:

@Manual{         cummins2026gents,
 title         = {{GenTS}: Generate Time Series Python Package (Software)},
 author        = {Cameron Cummins},
 year          = {2026},
 url           = {https://github.com/AgentOxygen/GenTS}
}

Acknowledgements

The following people made the development of GenTS possible. Thank you!

Portions of this work were supported by the Regional and Global Model Analysis (RGMA) component of the Earth and Environmental System Modeling Program of the U.S. Department of Energy's Office of Biological & Environmental Research (BER) under Lawrence Livermore National Lab subaward DE-AC52-07NA27344, Lawrence Berkeley National Lab subaward DE-AC02-05CH11231, and Pacific Northwest National Lab subaward DE-AC05-76RL01830. This work was also supported by the National Science Foundation (NSF) National Center for Atmospheric Research, which is a major facility sponsored by NSF under Cooperative Agreement No. 1852977.

Release files for GenTS 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for GenTS 1.2.0
File Size Uploaded
gents-1.2.0.tar.gz 246.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for GenTS 1.2.0
File Interpreter ABI Platform
gents-1.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 357.4 kB

Release files / gents-1.2.0.tar.gz

Download URL gents-1.2.0.tar.gz
Size 246.2 kB
Tags Source
SHA-256 checksum
How to use checksums
46244d716f716b9facea338d71d625c5530828f4608bc8f9c14f219b84e0721e
BLAKE2b-256 checksum
How to use checksums
409a2d20059f714ddf60f4a1c35a8f855567e4ee75cb3d780d28213779b0f012
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / gents-1.2.0-py3-none-any.whl

Download URL gents-1.2.0-py3-none-any.whl
Size 111.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f365cc39ffba211ea9283deae18a7d6975711312845ef6eb731cb9e48804ec77
BLAKE2b-256 checksum
How to use checksums
c917657f8425f04a8e1a2da6d4504786e42a644329c050ebe3950c0793c65ceb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release history Release notifications | RSS feed

1.3.0

2 release files

This release

1.2.0 This release

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.9.9

2 release files

0.9.8

2 release files

0.9.7

2 release files

0.9.6

2 release files

0.9.5

2 release files

0.9.4

2 release files

0.9.3

2 release files

0.9.2

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.5.0

2 release files

0.3.1

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page