Skip to main content

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: design phase. The approved design spec lives at docs/superpowers/specs/2026-04-18-pyfieldml-design.md. Implementation plan and phased build are next.

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), vectorized Field.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-lite in-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

doc = fml.read("model.fieldml")
print(doc.source_version)          # "0.5.0", "0.4", "0.3"
doc.validate()                     # XSD validation
doc.write("roundtripped.fieldml")

Phase 0 ships I/O and DOM-level round-trip. The semantic object model, evaluation engine, interop bridges, and model zoo arrive in later phases — see the design spec and plans.

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyfieldml-0.0.1.tar.gz (116.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyfieldml-0.0.1-py3-none-any.whl (19.0 kB view details)

Uploaded Python 3

File details

Details for the file pyfieldml-0.0.1.tar.gz.

File metadata

  • Download URL: pyfieldml-0.0.1.tar.gz
  • Upload date:
  • Size: 116.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pyfieldml-0.0.1.tar.gz
Algorithm Hash digest
SHA256 55b4bdfdc4c5e408b8081c1d23002c28dc57872c1494b9918b548e111d58c1e2
MD5 248a468c8d88142068f68a8f3e4c9f04
BLAKE2b-256 dbba78890567044401f8ea064a32c63e2f5ef002566b922594c2d7e44c082ffe

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyfieldml-0.0.1.tar.gz:

Publisher: release.yml on kchemorion/pyfieldml

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

File details

Details for the file pyfieldml-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: pyfieldml-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 19.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pyfieldml-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8512383eb1886396d79996ea304cbd688043d9921e938c8d76ffae8c17e8d12c
MD5 e74bed69d3e9df501bbbe273e874d612
BLAKE2b-256 2e9b6838dcefee9f5b93f485d4f9e4023d7bee99177d29b7695598b85cc39102

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyfieldml-0.0.1-py3-none-any.whl:

Publisher: release.yml on kchemorion/pyfieldml

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