Read, write, and convert structured CFD data between formats (Fortran binary, HDF5, Plot3D, Tecplot)
Project description
cfd-io
I/O toolkit for structured CFD data: read, write, and convert between formats.
Install
pip install cfd-io
Quick Start
from cfd_io import read_file, write_file, get_info
# inspect a file
info = get_info("flow.h5")
print(info.nx, info.ny, info.var_names)
# read data
grid, flow, attrs = read_file("flow.h5")
# write to a different format
write_file("flow.h5", grid, flow, attrs)
Features
- Unified API:
read_file/write_filedispatch by file extension - Format conversion:
do_convertreads one format, writes another - File inspection:
get_inforeturns structured metadata without loading data - CLI:
cfd-io convertandcfd-io infofor quick terminal use
CLI
# convert between formats
cfd-io convert grid.x grid.h5
# inspect a file
cfd-io info grid.h5
Testing
pytest tests/ --cov --cov-report=term-missing \
--ignore=tests/test_tecplot_ascii.py \
--ignore=tests/test_tecplot_binary.py \
--ignore=tests/test_plt.py -q
Documentation
Full documentation: https://uahypersonics.github.io/cfd-io
Citation
If cfd-io contributes to published work, please cite the software release:
GitHub also provides machine-readable citation metadata via CITATION.cff in this repository.
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 |
| Google style | Docstring sections (Args, Returns, Raises) |
Google Python style guide |
| Ruff | Automated linting and formatting | Enforces PEP 8 compliance automatically |
| typing / TYPE_CHECKING | Type hints for IDE support and static analysis | Python standard library |
Versioning & 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
pyproject.toml - Regenerate the API architecture diagram:
pydeps src/cfd_io --noshow --max-bacon=4 --cluster -o docs/assets/architecture.svg
- Commit and push to
main - Tag and push:
git tag -a vMAJOR.MINOR.PATCH -m "Release vMAJOR.MINOR.PATCH" git push origin vMAJOR.MINOR.PATCH
Use a signed tag when your GPG/SSH signing is configured:
git tag -s vMAJOR.MINOR.PATCH -m "Release vMAJOR.MINOR.PATCH"
git push origin vMAJOR.MINOR.PATCH
The GitHub Actions workflow will automatically build and publish to PyPI via Trusted Publishing.
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 cfd_io-0.2.5.tar.gz.
File metadata
- Download URL: cfd_io-0.2.5.tar.gz
- Upload date:
- Size: 87.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d9eb7540dd1578c616759b0a83762dba73e129bac72df93b6c572cc5c8cb8939
|
|
| MD5 |
0249abe7b157a33c7d650f7ab268cd3f
|
|
| BLAKE2b-256 |
42d4e5592100d0bfd3ef33c74bf8ba4f3585d10cc2880035175ba1091e017b1b
|
Provenance
The following attestation bundles were made for cfd_io-0.2.5.tar.gz:
Publisher:
publish.yml on uahypersonics/cfd-io
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cfd_io-0.2.5.tar.gz -
Subject digest:
d9eb7540dd1578c616759b0a83762dba73e129bac72df93b6c572cc5c8cb8939 - Sigstore transparency entry: 1227943303
- Sigstore integration time:
-
Permalink:
uahypersonics/cfd-io@ded2a47411c79ecd98aef75497546b6f91350711 -
Branch / Tag:
refs/tags/v0.2.5 - Owner: https://github.com/uahypersonics
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ded2a47411c79ecd98aef75497546b6f91350711 -
Trigger Event:
push
-
Statement type:
File details
Details for the file cfd_io-0.2.5-py3-none-any.whl.
File metadata
- Download URL: cfd_io-0.2.5-py3-none-any.whl
- Upload date:
- Size: 74.0 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 |
ed710797d04602cabe959682423d0bc7392bd2f228ae8bf0c84b6f7f07576385
|
|
| MD5 |
45754b8cc2ee077166ae7d21d8dd857f
|
|
| BLAKE2b-256 |
7111aa5a9de2d39535caec02a586497d8de4bdb75767ed67e315a7264d435d36
|
Provenance
The following attestation bundles were made for cfd_io-0.2.5-py3-none-any.whl:
Publisher:
publish.yml on uahypersonics/cfd-io
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cfd_io-0.2.5-py3-none-any.whl -
Subject digest:
ed710797d04602cabe959682423d0bc7392bd2f228ae8bf0c84b6f7f07576385 - Sigstore transparency entry: 1227943314
- Sigstore integration time:
-
Permalink:
uahypersonics/cfd-io@ded2a47411c79ecd98aef75497546b6f91350711 -
Branch / Tag:
refs/tags/v0.2.5 - Owner: https://github.com/uahypersonics
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ded2a47411c79ecd98aef75497546b6f91350711 -
Trigger Event:
push
-
Statement type: