Lightweight utility for computing flow states
Project description
flow_state
Compressible flow state calculations for Python.
Install
pip install flow-state-calculator
Quick Start
from flow_state import solve
# From Mach and altitude
state = solve(mach=2.0, altitude=10000)
# From Mach and stagnation conditions (wind tunnel)
state = solve(mach=6, pres_stag=(140, "psi"), temp_stag=420)
# From Mach and target unit Reynolds number
state = solve(mach=5.3, re1=12.8e6)
# Access results
print(state) # Full summary
print(state.pres, state.temp, state.re1)
Features
- Smart solver: Automatically selects the right equations based on your inputs
- Unit support: Use SI or provide tuples like
(30000, "ft"),(140, "psi") - Atmosphere models: US Standard Atmosphere 1976 and CIRA-86
- Gas models: Perfect gas (air, nitrogen, custom)
- Transport: Sutherland viscosity law
- Output: JSON, TOML, or legacy
.datformat
CLI
# Create a config template
flow-state init
# Edit flow_config.toml, then solve
flow-state solve
Atmosphere Models
from flow_state import solve, atmosphere
# Default: US Standard Atmosphere 1976
state = solve(mach=2, altitude=10000)
# CIRA-86 with latitude and month
state = solve(mach=2, altitude=10000, atm=atmosphere.CIRA86(latitude=70, month=1))
Documentation
Full documentation: https://uahypersonics.github.io/flow_state
Citation
If you use flow_state in your research, please cite it:
@software{flow_state,
author = {Hader, Christoph},
title = {flow\_state: Compressible Flow State Calculations},
url = {https://github.com/uahypersonics/flow_state},
year = {2026}
}
Code Style
This project follows established Python community conventions so that contributors can focus on the physics rather than inventing formatting rules.
| Convention | What it covers | Reference |
|---|---|---|
| PEP 8 | Code formatting, naming, whitespace | Python standard style guide |
| PEP 257 | Docstring structure (triple-quoted, imperative mood) | Python standard docstring conventions |
| numpydoc | Docstring sections (Parameters, Returns, Attributes) |
NumPy/SciPy docstring standard — the norm for scientific Python |
| Ruff | Automated linting and formatting | Enforces PEP 8 compliance automatically |
| typing / TYPE_CHECKING | Type hints for IDE support and static analysis | Python standard library |
Releasing
This project uses Semantic Versioning (vMAJOR.MINOR.PATCH):
- MAJOR (
v1.0.0,v2.0.0): Breaking API changes - MINOR (
v0.3.0,v0.4.0): New features, backward-compatible - PATCH (
v0.3.1,v0.3.2): Bug fixes, minor corrections
To publish a new version to PyPI:
- Update the version in
src/flow_state/_version.py - Regenerate the API architecture diagram:
pydeps src/flow_state --noshow --max-bacon=4 --cluster -o docs/assets/architecture.svg
- Commit and push to
main - Tag and push:
git tag vMAJOR.MINOR.PATCH git push origin vMAJOR.MINOR.PATCH
The GitHub Actions workflow will automatically build and publish to PyPI via Trusted Publishing.
Contributors
chader2811 💻 📖 🎨 🤔 🚧 🔣 ⚠️ 💡 🚇 |
Contributions are welcome: code, documentation, verification data, and bug reports. See the contribution types recognized by this project.
License
BSD-3-Clause. See LICENSE for details.
Project details
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 flow_state_calculator-0.4.1.tar.gz.
File metadata
- Download URL: flow_state_calculator-0.4.1.tar.gz
- Upload date:
- Size: 57.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d2c9e3d432997b51f516d8aeacb1bfd630cd10ae614d709b946f8cb50e3dabb
|
|
| MD5 |
050f7c4aed699cddf0a5ee474319b2c9
|
|
| BLAKE2b-256 |
924e330872db7d8a9be5778c189ccb2d5ca32f3f95f25e57466d9debdb4fc443
|
Provenance
The following attestation bundles were made for flow_state_calculator-0.4.1.tar.gz:
Publisher:
publish.yml on uahypersonics/flow_state
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
flow_state_calculator-0.4.1.tar.gz -
Subject digest:
8d2c9e3d432997b51f516d8aeacb1bfd630cd10ae614d709b946f8cb50e3dabb - Sigstore transparency entry: 1044724549
- Sigstore integration time:
-
Permalink:
uahypersonics/flow_state@4c49a2f1370fe2b3508700be4590720c8ef474bd -
Branch / Tag:
refs/tags/v0.4.1 - Owner: https://github.com/uahypersonics
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4c49a2f1370fe2b3508700be4590720c8ef474bd -
Trigger Event:
push
-
Statement type:
File details
Details for the file flow_state_calculator-0.4.1-py3-none-any.whl.
File metadata
- Download URL: flow_state_calculator-0.4.1-py3-none-any.whl
- Upload date:
- Size: 50.7 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 |
d5aa52bf5a148fe86fb8bd925cc77f5e6a5f9db82a4f4bf915ced357ddf44a62
|
|
| MD5 |
e262a778b8300f0d69d6572af8a66ce4
|
|
| BLAKE2b-256 |
fb8be4667d341d5d053bdee9827b2ae266a4302a15862999693bf58183979e3f
|
Provenance
The following attestation bundles were made for flow_state_calculator-0.4.1-py3-none-any.whl:
Publisher:
publish.yml on uahypersonics/flow_state
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
flow_state_calculator-0.4.1-py3-none-any.whl -
Subject digest:
d5aa52bf5a148fe86fb8bd925cc77f5e6a5f9db82a4f4bf915ced357ddf44a62 - Sigstore transparency entry: 1044724608
- Sigstore integration time:
-
Permalink:
uahypersonics/flow_state@4c49a2f1370fe2b3508700be4590720c8ef474bd -
Branch / Tag:
refs/tags/v0.4.1 - Owner: https://github.com/uahypersonics
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4c49a2f1370fe2b3508700be4590720c8ef474bd -
Trigger Event:
push
-
Statement type: