Skip to main content

infrasys

CI Codecov PyPI Ruff Python Conventional Commits License Docs release-please Docs (GitHub Pages)

infrasys is a lightweight data store that keeps track of components, their attributes, and time series for energy infrastructure models. The core package is opinionated about validation, unit handling, and data migration so that downstream modeling packages can focus on solving their domain problems instead of managing persistence concerns.

Highlights

  • Typed components with pint validation: Base models derive from pydantic and use pint quantities whenever a physical unit is involved.
  • Flexible time-series storage: Arrow, HDF5, Chronify, and in-memory backends are available via System configuration to match your compute environment.
  • Efficient serialization: Components, supplemental attributes, and nested systems are serialized to JSON with automatic metadata and optional migration hooks.
  • Designed for extension: Derive your own System classes, override component addition logic, or ship supplemental attributes alongside the core storage.

Getting started

Install

pip install git+https://github.com/NREL/infrasys.git@main
pip install "infrasys[chronify]"  # optional backend for Chronify/duckdb-based storage

Don’t forget to install pre-commit hooks so your push meets project quality checks:

pre-commit install

Quick example

from infrasys import Component, System
from infrasys.location import Location


class Bus(Component):
    voltage: float
    location: Location | None = None


system = System(name="demo-grid")
bus = Bus(name="bus-1", voltage=1.05, location=Location(x=0.0, y=0.0))
system.add_components(bus)
system.to_json("demo-grid/system.json")

Instantiate a System, add a few components, and dump everything to JSON. Time series data gets written to a sibling directory alongside the JSON file so you can externalize it with System.to_json(...) and System.from_json(...).

Documentation

  • How To guides: step-by-step recipes in docs/how_tos.
  • Tutorials: opinionated walkthroughs for custom systems under docs/tutorials.
  • API Reference: auto-generated reference material lives in docs/reference.
  • Explanation articles: deeper dives on the storage backends, migrations, and behavior in docs/explanation.

To build the docs locally, install docs extras and run make html from the docs directory.

Development

  • Clone this repository and install the dev dependency group before hacking:
pip install -e ".[dev]"
  • Run the test suite and coverage reporting via:
pytest
  • Formatting and linting are managed by ruff and configured through its pyproject.toml section. Keep your hooks healthy by installing them via pre-commit install (see Getting started) and running pre-commit run --all-files before pushing.

Support & Contribution

infrasys is being developed under NREL Software Record SWR-24-42. Report issues and feature requests at https://github.com/NREL/infrasys/issues. Review the docs/reference and docs/how_tos material before submitting a change so your diff is aligned with the project conventions.

License

infrasys is released under the BSD 3-Clause License. See LICENSE.txt for details.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

infrasys-1.2.1.tar.gz (70.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

infrasys-1.2.1-py3-none-any.whl (87.2 kB view details)

Uploaded Python 3

File details

Details for the file infrasys-1.2.1.tar.gz.

File metadata

  • Download URL: infrasys-1.2.1.tar.gz
  • Upload date:
  • Size: 70.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for infrasys-1.2.1.tar.gz
Algorithm Hash digest
SHA256 c8f752e94efe9582496b9fff3b54392ce574d9ad30cb46725ae059845f3f13c2
MD5 d7bf9de9ffe6f568ce0bdbebed9a1b84
BLAKE2b-256 6b44f0d55517e3c7d8321bf25de367fb4603b396e3f364108e7c50855fb2c540

See more details on using hashes here.

Provenance

The following attestation bundles were made for infrasys-1.2.1.tar.gz:

Publisher: release.yaml on NatLabRockies/infrasys

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file infrasys-1.2.1-py3-none-any.whl.

File metadata

  • Download URL: infrasys-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 87.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for infrasys-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2ecec0fe004f02f3abe577290af8a9193ddc4833d4e5dd45ab17a33027970715
MD5 ae0159f6d67f075ca17fa1c4a6e0db0e
BLAKE2b-256 349658545fb6a6b3e1a0ae7da020a94143713ecf65646c76eae35b67858663d9

See more details on using hashes here.

Provenance

The following attestation bundles were made for infrasys-1.2.1-py3-none-any.whl:

Publisher: release.yaml on NatLabRockies/infrasys

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

1.2.1 This release

2 files

1.2.0

2 files

1.1.2

2 files

1.1.1

2 files

1.0.1

2 files

1.0.0

2 files

0.5.2

2 files

0.5.1

2 files

0.5.0

2 files

0.4.0

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.5

2 files

0.2.4

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

0.0.4

2 files

0.0.3

2 files

0.0.2

2 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