No project description provided
Project description
infrasys
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
pydanticand usepintquantities whenever a physical unit is involved. - Flexible time-series storage: Arrow, HDF5, Chronify, and in-memory backends are available
via
Systemconfiguration 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
Systemclasses, 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
ruffand configured through itspyproject.tomlsection. Keep your hooks healthy by installing them viapre-commit install(see Getting started) and runningpre-commit run --all-filesbefore 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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file infrasys-1.1.2.tar.gz.
File metadata
- Download URL: infrasys-1.1.2.tar.gz
- Upload date:
- Size: 70.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
960161769b54336fcf0d028fb40ad3c7545130cbccf01474c7c423825616afbe
|
|
| MD5 |
261c37503cc8122a93a11899efc7086a
|
|
| BLAKE2b-256 |
2402499e4ce291bf7a1d579585e54af40c185589aabf31cf265deeedeb9b620d
|
Provenance
The following attestation bundles were made for infrasys-1.1.2.tar.gz:
Publisher:
release.yaml on NatLabRockies/infrasys
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
infrasys-1.1.2.tar.gz -
Subject digest:
960161769b54336fcf0d028fb40ad3c7545130cbccf01474c7c423825616afbe - Sigstore transparency entry: 1243781998
- Sigstore integration time:
-
Permalink:
NatLabRockies/infrasys@5ef301c6e578becc7518a465d68cf98ad169acb6 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/NatLabRockies
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@5ef301c6e578becc7518a465d68cf98ad169acb6 -
Trigger Event:
push
-
Statement type:
File details
Details for the file infrasys-1.1.2-py3-none-any.whl.
File metadata
- Download URL: infrasys-1.1.2-py3-none-any.whl
- Upload date:
- Size: 86.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c0e6fbf96c932fcb81d522b7d62b60c3d7e3c32d5692c671f7d2a241319a1d90
|
|
| MD5 |
bd0f6161317e77c221ec56f1f20ad33e
|
|
| BLAKE2b-256 |
962b689fc26d197631ac38860b638f09a2415903e9543af847342327af563370
|
Provenance
The following attestation bundles were made for infrasys-1.1.2-py3-none-any.whl:
Publisher:
release.yaml on NatLabRockies/infrasys
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
infrasys-1.1.2-py3-none-any.whl -
Subject digest:
c0e6fbf96c932fcb81d522b7d62b60c3d7e3c32d5692c671f7d2a241319a1d90 - Sigstore transparency entry: 1243782001
- Sigstore integration time:
-
Permalink:
NatLabRockies/infrasys@5ef301c6e578becc7518a465d68cf98ad169acb6 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/NatLabRockies
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@5ef301c6e578becc7518a465d68cf98ad169acb6 -
Trigger Event:
push
-
Statement type: