Skip to main content

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.

Test codecov DOI PyPI Docs License Python Ruff

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_file dispatch by file extension
  • Format conversion: do_convert reads one format, writes another
  • File inspection: get_info returns structured metadata without loading data
  • CLI: cfd-io convert and cfd-io info for 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:

  1. Update the version in pyproject.toml
  2. Regenerate the API architecture diagram:
    pydeps src/cfd_io --noshow --max-bacon=4 --cluster -o docs/assets/architecture.svg
    
  3. Commit and push to main
  4. 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

cfd_io-0.2.0.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.

cfd_io-0.2.0-py3-none-any.whl (60.9 kB view details)

Uploaded Python 3

File details

Details for the file cfd_io-0.2.0.tar.gz.

File metadata

  • Download URL: cfd_io-0.2.0.tar.gz
  • Upload date:
  • Size: 70.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for cfd_io-0.2.0.tar.gz
Algorithm Hash digest
SHA256 0c34dcf4db3051b4e25e9ada3f14ed1640ec23b3b4fef0932a1c6d058dee7191
MD5 125fa7010a5401d56119e50ae1786cdd
BLAKE2b-256 cac4f66587e628959df39bb5e42f7b75515a3fc8ce278c7ababfde92e7fb74aa

See more details on using hashes here.

Provenance

The following attestation bundles were made for cfd_io-0.2.0.tar.gz:

Publisher: publish.yml on uahypersonics/cfd-io

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

File details

Details for the file cfd_io-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: cfd_io-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 60.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for cfd_io-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 08f5049877ed301a158688b45f638ff01bd37026ec6b2420cf4d3db25ea275b8
MD5 0ce453d144c660a33d0dac4db65f20ba
BLAKE2b-256 df180c6f9c2fcd7a08df01a1831a1ff5ef2fa4b46458fd11848b9e141596eef3

See more details on using hashes here.

Provenance

The following attestation bundles were made for cfd_io-0.2.0-py3-none-any.whl:

Publisher: publish.yml on uahypersonics/cfd-io

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

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page