A modern pure-Python implementation of FieldML 0.5 with evaluation engine and biomechanics model zoo.
Project description
pyfieldml
A modern, pure-Python implementation of FieldML 0.5 with a full evaluation engine, interop bridges (meshio, PyVista, XDMF, scikit-fem, OpenSim-adjacent), and a curated biomechanics model zoo.
FieldML is the Physiome Project's declarative markup language for representing mathematical fields over discrete meshes — used across computational physiology (cardiac, musculoskeletal, respiratory modeling). The original C++ FieldML-API has been effectively unmaintained since 2015. pyfieldml is an independent reimplementation that brings FieldML into the modern scientific-Python ecosystem.
Status: v1.0 — feature-complete for Phase-1 through Phase-5 scope. See the design spec and CHANGELOG for what's in and what's deferred to later minor releases.
What it will do (v1.0)
- Full FieldML 0.5 read + write, round-trip validated against the C++ reference test suite
- Legacy read of FieldML 0.3 and 0.4 (auto up-conversion to 0.5)
- Evaluation engine with Lagrange (orders 1–2) and cubic Hermite-with-scaling bases
Field.evaluate(element, xi), vectorizedField.sample(points), Jacobians- High-level builders:
add_lagrange_mesh,add_fiber_field,add_material_field,add_landmark_set, … - Interop:
meshio(two-way), PyVista (doc.plot(),doc.explore()), XDMF,scikit-fem, OpenSim-compatible asset export - CLI:
pyfieldml inspect | validate | convert | plot | lint | diff - Curated model zoo:
pyfieldml.datasets.load_femur(),load_rectus_femoris(),load_myocardium() - Docs site with
jupyter-litein-browser runnable notebooks - JOSS paper submitted alongside v1.0
License
Apache 2.0. See LICENSE and NOTICE.
Install
pip install pyfieldml
Development:
git clone https://github.com/kchemorion/pyfieldml
cd pyfieldml
uv sync --extra dev
uv run pytest
Quickstart
import pyfieldml as fml
from pyfieldml import datasets
# Load a bundled synthetic dataset
doc = datasets.load_rectus_femoris()
# Inspect the evaluator graph
for name, ev in doc.evaluators.items():
print(f"{name:30s} {type(ev).__name__}")
# Evaluate the coordinate field at an element centroid
coords = doc.field("coordinates")
print("centroid of element 1:", coords.evaluate(element=1, xi=(0.25, 0.25, 0.25)))
# Export to VTK for ParaView
m = doc.to_meshio()
Cite this work
If you use pyfieldml in academic work, please cite it — see
CITATION.cff for the canonical metadata, and
docs/cite.md for BibTeX snippets.
Acknowledgments
pyfieldml is an independent Python reimplementation inspired by and validated against the C++ FieldML-API. Credit to its original authors — Caton Little, Alan Wu, Richard Christie, Andrew Miller, and Auckland Uniservices Ltd / the Auckland Bioengineering Institute — and to the Physiome Project community that maintains the FieldML specification.
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 pyfieldml-1.0.0.tar.gz.
File metadata
- Download URL: pyfieldml-1.0.0.tar.gz
- Upload date:
- Size: 200.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9aaf2244e6e927f3625e8508f9e53b4b406e84143288c02043118eac0654fd2d
|
|
| MD5 |
690597479b784c6924bf6e471e05429b
|
|
| BLAKE2b-256 |
4f4409d3f23055eb008f552285afc49462e8f53251ab975e994b694c52cd960d
|
Provenance
The following attestation bundles were made for pyfieldml-1.0.0.tar.gz:
Publisher:
release.yml on kchemorion/pyfieldml
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyfieldml-1.0.0.tar.gz -
Subject digest:
9aaf2244e6e927f3625e8508f9e53b4b406e84143288c02043118eac0654fd2d - Sigstore transparency entry: 1340178011
- Sigstore integration time:
-
Permalink:
kchemorion/pyfieldml@65941cf7f132fec61781d52d80ff53afd2cba7bf -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/kchemorion
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@65941cf7f132fec61781d52d80ff53afd2cba7bf -
Trigger Event:
push
-
Statement type:
File details
Details for the file pyfieldml-1.0.0-py3-none-any.whl.
File metadata
- Download URL: pyfieldml-1.0.0-py3-none-any.whl
- Upload date:
- Size: 89.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2a225c0cbb74c63bf56a2acdec1f4b761bdf5af89fe1faf6961f4a86196edd9b
|
|
| MD5 |
ef6b2ed60cd2be38bb46a2a6a965d696
|
|
| BLAKE2b-256 |
7e5488e34c5884f2a23d6c8ebf36d14ef7ac948b4bdbdf94c3a45a151cfea4da
|
Provenance
The following attestation bundles were made for pyfieldml-1.0.0-py3-none-any.whl:
Publisher:
release.yml on kchemorion/pyfieldml
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyfieldml-1.0.0-py3-none-any.whl -
Subject digest:
2a225c0cbb74c63bf56a2acdec1f4b761bdf5af89fe1faf6961f4a86196edd9b - Sigstore transparency entry: 1340178019
- Sigstore integration time:
-
Permalink:
kchemorion/pyfieldml@65941cf7f132fec61781d52d80ff53afd2cba7bf -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/kchemorion
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@65941cf7f132fec61781d52d80ff53afd2cba7bf -
Trigger Event:
push
-
Statement type: