Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
2ee55cc
Add loguru logging to LEX
mkstratos Oct 20, 2025
af62cd1
Add check for livv exe per @czender
mkstratos Oct 20, 2025
a4b6622
Add log lines to indicate being finished
mkstratos Oct 20, 2025
b1e3b44
Fix paths, redirect stderr for field check too
mkstratos Oct 28, 2025
01586e4
Improve conda env activation
mkstratos Oct 28, 2025
3f64532
Update venv instructions
mkstratos Oct 28, 2025
ae00fcc
Add overwrite flag to ncra commands
mkstratos Nov 3, 2025
8bb6002
Find the lex_env conda environment a little better
mkstratos Nov 3, 2025
b59ae66
Remove conda activation from batch script
mkstratos Nov 3, 2025
0512c10
Use yaml anchor for simple test
mkstratos Dec 16, 2025
3092dac
Add Jinja template and script for generating config
mkstratos Dec 17, 2025
132041f
Add initial tests for lex.common
mkstratos Dec 17, 2025
704c034
Add parsing of sets/icesheets, NERSC defaults
mkstratos Dec 18, 2025
15c115a
Add fields to export / merge list
mkstratos Dec 18, 2025
e7a1efc
Improve conda env checking
mkstratos Dec 18, 2025
41c634d
Refactor away from Basemap
mkstratos Dec 18, 2025
ea094be
Fix timeseries directory template
mkstratos Dec 18, 2025
835c525
Fix formatting
mkstratos Dec 18, 2025
ac1fa76
Use correct mask per icesheet
mkstratos Dec 18, 2025
3494778
Add high-res template, update run_livv for pm-cpu
mkstratos Dec 18, 2025
eb9c3a7
Update python version for testing
mkstratos Dec 22, 2025
410d993
Use mache to detect machine and fill in e3sm diags path
mkstratos Dec 22, 2025
783323c
Make generate_cfg a package script
mkstratos Dec 22, 2025
1c0a539
Fix formatting
mkstratos Dec 22, 2025
7e615ab
Rework loading files to work with zppy
mkstratos Jan 26, 2026
5a6de3e
Fix for grid path on chrysalis
mkstratos Feb 2, 2026
878a85f
Format grid and elevation netCDF links
mkstratos Feb 2, 2026
63f3b60
Update LIVVkit version requirement
mkstratos Feb 2, 2026
cac2a27
Fix issues with standalone LEX
mkstratos Feb 2, 2026
646b9c5
Update README with new name and supported machines
mkstratos Feb 2, 2026
d54734c
Switch to Pixi for environment management
mkstratos Feb 4, 2026
3560a0b
Switch to Pixi for dev environment
mkstratos Feb 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 21 additions & 11 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,28 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13",]
include:
- python-version: "3.10"
pixi-env: py310dev
- python-version: "3.11"
pixi-env: py311dev
- python-version: "3.12"
pixi-env: py312dev
- python-version: "3.13"
pixi-env: py313dev
- python-version: "3.14"
pixi-env: py314dev

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
- uses: actions/checkout@v6
- name: Set up Pixi ${{ matrix.python-version }}
uses: prefix-dev/setup-pixi@v0.9.4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
pixi-version: v0.62.2
# Project environment caching uses pixi.lock as the cache key input.
# If you don't commit a lockfile, disable caching to avoid ENOENT.
# cache: ${{ hashFiles('pixi.lock') != '' }}
environments: ${{ matrix.pixi-env }}
- name: Run tests
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -e .\[dev\]
- name: Test with pytest
run: |
pytest -vvv
pixi run -e ${{ matrix.pixi-env }} pytest -vvv
5 changes: 1 addition & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ repos:
- id: debug-statements
- id: destroyed-symlinks
- id: detect-private-key

- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.13.0
Expand All @@ -18,7 +19,3 @@ repos:
- id: ruff-check
# Run the formatter.
- id: ruff-format
- repo: https://github.com/pycqa/isort
rev: 6.0.1
hooks:
- id: isort
62 changes: 35 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
![](https://raw.githubusercontent.com/wiki/LIVVkit/LIVVkit/imgs/livvkit.png)

# LIVVkit Extensions (LEX)
# LIVVkit Extensions (LivvEX)

This repository holds a collection of extensions to
[LIVVkit](https://livvkit.github.io/Docs/index.html) for validation and
Expand All @@ -19,41 +19,43 @@ machines, including Perlmutter at NERSC, and Chrysalis at ANL\'s LCRC.
The Python package itself is described in `pyproject.toml`, which is used by
`pip` to install this package

Currently, LEX is designed to run on Perlmutter, but future work is
planned to support other machines.
Currently, LEX is designed to run on NERSC's Perlmutter, and ANL-LCRC's Chrysalis,
but future work is planned to support other machines where E3SM runs.

## Environment setup

For setting up an environment to which lex and dependencies will be
installed, conda and Python virtualenv are documented here. **NB** this
will only currently work on NERSC's Perlmutter, the environment should be
installed, Pixi and conda are documented here. **NB** this
will only currently work on Perlmutter and Chrysalis, the environment should be
created there.

### Conda environment
### Pixi environment
[pixi](https://pixi.sh/latest/) is a package management tool, and the primary
environment management tool for LEX.
First, it must be [installed](https://pixi.prefix.dev/latest/installation/) locally.
Then an enviornment for lex development can be created:
```bash
$ git clone https://github.com/LIVVkit/lex.git
$ cd lex
$ {conda, mamba} create -n lex_env python --file requirements.txt
$ {conda, mamba} activate lex_env
$ pip install -e . # Installs the lex module as an editable Python package to the lex_env environment.
$ pixi install # This will install the default environment
$ pixi shell -e default # To activate the default (runtime) environment
```

### Python virtualenv
If development tools are needed (e.g. `pytest`), install and activate the `dev` environment:
```bash
$ git clone https://github.com/LIVVkit/lex.git
$ cd lex python -m venv .env
$ source .env/bin/activate
$ pip install --upgrade pip # Needed if the system pip version < 21.3
$ pip install -e .
$ pixi install -e dev # Installs the environment
$ pixi shell -e dev # Activates the dev environment (for code testing and checks)
```
**N.B.** it is not recommended to do `pixi install --all`, as this will install the environment versions used for testing.

This will create a virtual environment at `lex/.env`, and install the
LEX package as editable with all its Python requirements to run.

### Other available environment management solutions
Not documented here, but also available for environment management
- [uv](https://docs.astral.sh/uv/)
- [pixi](https://pixi.sh/latest/)
### Conda environment
```bash
$ git clone https://github.com/LIVVkit/lex.git
$ cd lex
$ {conda, mamba} env create -n lex_env python --file env.yml
$ {conda, mamba} activate lex_env
$ pip install -e . # Installs the lex module as an editable Python package to the lex_env environment.
```

## Basic usage

Expand All @@ -72,7 +74,9 @@ website you\'d run this command:
```bash
$ livv -V config/example/example.yml -o vv_test -s
```
This will create a directory in the current directory called `vv_test` (~7.5 MB), and spawn an HTTP server, which should only be used for testing purposes. (This works best if the output is in the current directory)
This will create a directory in the current directory called `vv_test` (~7.5 MB), and
spawn an HTTP server, which should only be used for testing purposes.
(This works best if the output is in the current directory)

*Note:* All the extension configurations files assume you are working
from the top level `lex` directory. You *can* run any of these
Expand Down Expand Up @@ -103,20 +107,24 @@ $ sbatch run_lex_pm-cpu.sbatch
## Running new cases on PM-CPU

### Generate a single timeseries file from ELM h0 outputs
- `ncrcat -v topo,landfrac,QSNOFRZ,FSRND,FSRVD,FSDSVD,FSDSND,EFLX_LH_TOT,FIRA,FLDS,FSA,FSDS,FSH,QICE,QRUNOFF,QSNOMELT,QSOIL,RAIN,SNOW,TSA elm*h0*.nc -o ${CASE}.nc`
- `CASE="The case name"`
- `ncrcat -v topo,landfrac,QSNOFRZ,FSRND,FSRVD,FSDSVD,FSDSND,EFLX_LH_TOT,FIRA,FLDS,FSA,FSDS,FSH,QICE,QRUNOFF,QSNOMELT,QSOIL,RAIN,SNOW,TSA,SNOWICE,SNOWLIQ,H2OSNO ${CASE}.elm.h0*.nc -o ${CASE}.nc`

### Perform post-processing on a single time series ELM h0 output
- Edit the `lex/lex/postproc/e3sm/postproc.sbatch` batch file to mach the new run

Key variables:
- `INDIR`: Path which contains single output time series file
- `OUTCASE`: Name of the new case which is the name of the netCDF file without extension (e.g. `v2.1.r025.IGERA5ELM_MLI-deep_firn_1980_2020`)
- `OUTCASE`: Name of the new case which is the name of the netCDF file without
extension (e.g. `v2.1.r025.IGERA5ELM_MLI-deep_firn_1980_2020`)
- `RES`: ELM output resolution (currently accepts `R05` and `R025`)
- `OUTDIR`: Scratch directory into which climatology files will be written, defaults to `${SCRATCH}/lex/data/e3sm/${OUTCASE}`
- `OUTDIR`: Scratch directory into which climatology files will be written,
defaults to `${SCRATCH}/lex/data/e3sm/${OUTCASE}`
- Run the post-processing script:
- `cd lex/lex/postproc/e3sm; sbatch postproc.sbatch`

**NB**: the `postproc.sbatch` script will create the configuration for your case (based on `OUTCASE` and `OUTDIR`), then run LIVVkit on it with `lex/run_livv.sh`
**NB**: the `postproc.sbatch` script will create the configuration for your case
(based on `OUTCASE` and `OUTDIR`), then run LIVVkit on it with `lex/run_livv.sh`

## Developing a custom extension

Expand Down
Loading