Skip to content

About

A simple library to help organise terminal-based sections of batch jobs on HPC systems

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

ucrel_sections

Lightweight, colourised console sections, timers and inline unit tests.

Install

pip install ucrel_sections
# or straight from GitHub
pip install git+https://github.com/UCREL/python-sections.git

Requires Python 3.10+.

Usage

from ucrel_sections import Section

with Section("Loading data") as s:
    with s.timer("read csv"):
        rows = load_rows()

    s.tryAssert(len(rows) > 0, "no rows loaded", name="non-empty")

    with s.test("schema", canFail=True) as t:
        t.reject("id" not in rows[0], "missing id column")

Development

python -m venv .venv && source .venv/bin/activate
pip install -e '.[dev]'
pytest

Releasing

The version comes from git tags (via hatch-vcs). To publish to PyPI:

  1. Tag and push: git tag v0.1.0 && git push origin v0.1.0
  2. Create a GitHub Release from that tag. The Publish workflow builds and uploads to PyPI.

About

A simple library to help organise terminal-based sections of batch jobs on HPC systems

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages