Skip to main content

pyrucast

Bibliothèque d'éléments finis en Rust, inspirée de cast3m, exposée à Python — et utilisable telle quelle en Rust pur (pyo3 est une dépendance optionnelle : un build par défaut ne tire ni pyo3 ni libpython).

  • Documentation complète : le book mdbook dans book/ (architecture, modèle mémoire, maillage, champs, physiques…) — mdbook build book pour le HTML.
  • Référence API Rust : cargo doc --no-deps --lib --open.

Prérequis

Outil Version Installation
Rust ≥ 1.89 (rust-version du crate), édition 2024 rustup
Python ≥ 3.11 API Python uniquement — inutile en Rust pur
En-têtes Python — API Python uniquement — Linux : python3-dev (Debian/Ubuntu) ou python3-devel (Fedora/RHEL). Windows : inclus dans l'installateur officiel.

Usage en Rust pur (sans Python)

[dependencies]
pyrucast = { git = "…", default-features = false }   # pas de pyo3, pas de libpython
use pyrucast::atoms::ElementType;
let mesh = pyrucast::ops::mesh::triangulate_surface(&contour, ElementType::TRI3, Some(1.0))?;

cargo build / cargo test (sans feature) compilent le cœur en Rust pur — ni Python ni venv requis. L'API Python (#[pyclass]) vit derrière la feature python-api, activée automatiquement par maturin.

Compilation dans un venv (API Python)

Pour les builds avec l'API Python (maturin, ou cargo --features python-api), pyo3 localise l'interpréteur via VIRTUAL_ENV : activez toujours le venv avant cargo ou maturin, sinon la compilation échoue avec error: failed to run the Python interpreter at .... (Un cargo build pur n'a pas cette contrainte.)

Linux / macOS

python3 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip maturin
maturin develop --release

Windows (PowerShell)

python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install --upgrade pip maturin
maturin develop --release

maturin develop compile le module et l'installe dans le venv. Vérification :

python -c "import pyrucast; c = pyrucast.Coords(2); print(c)"

Après toute modification du Rust, relancer simplement maturin develop --release.

Développement

pip install pytest ruff     # en plus de maturin, dans le venv
cargo build                 # cœur Rust pur (sans pyo3 ; pas besoin du venv)
cargo test                  # tests unitaires + intégration + doctests (Rust pur)
maturin develop && python -m pytest   # tests Python
cargo fmt && ruff format .  # formatage standard (Rust + Python)
bash script/check_all.sh    # enchaîne toutes les vérifications (formatage inclus)
bash script/check_doc.sh    # ou un seul bloc : format / rust / python / examples / doc

Le chapitre Compilation et tests du book détaille les features Cargo (viz, viz-interactive, stub-gen…), la génération du stub python/pyrucast/_pyrucast/__init__.pyi et le dépannage courant.

Licence

Distribué sous licence Mozilla Public License 2.0 (MPL-2.0).

C'est un copyleft au fichier : toute modification d'un fichier source de pyrucast doit être republiée sous MPL, mais on peut librement construire du code propriétaire au-dessus de la bibliothèque et l'y combiner. La MPL est par ailleurs compatible GPL/CeCILL (« Secondary Licenses », §3.3).

Release files for pyrucast 0.7.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyrucast 0.7.1
File Size Uploaded
pyrucast-0.7.1.tar.gz 1.5 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for pyrucast 0.7.1
File Interpreter ABI Platform
pyrucast-0.7.1-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details
pyrucast-0.7.1-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 abi3 Linux glibc 2.17+ x86-64 Details
pyrucast-0.7.1-cp311-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl CPython 3.11 abi3 macOS 10.12+ universal2 (ARM64, x86-64), macOS 10.12+ x86-64, macOS 11.0+ ARM64 Details

Total release size: 19.1 MB

Release files / pyrucast-0.7.1.tar.gz

Download URL pyrucast-0.7.1.tar.gz
Size 1.5 MB
Tags Source
SHA-256 checksum
How to use checksums
b9e8615a7ae561406f80f765ad67c67d155ae00c30376251deecc1cdbe74b10a
BLAKE2b-256 checksum
How to use checksums
21efcaf43ce0dac7283f8237067d741cdc741bd63ecdce122f3aabaf8fc09771
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 15, 2026.

Transparency log

Release files / pyrucast-0.7.1-cp311-abi3-win_amd64.whl

Download URL pyrucast-0.7.1-cp311-abi3-win_amd64.whl
Size 3.7 MB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
508e67d604b0ca1f18feb38978af3dd76f4d0652db152909f572325c13de52ab
BLAKE2b-256 checksum
How to use checksums
71fc5d023487694c2b813a4e75ba3d3b4912c0488a2e0b71ac4bdf486b26a808
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 15, 2026.

Transparency log

Release files / pyrucast-0.7.1-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pyrucast-0.7.1-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 6.6 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
3a8c4293a62ceb8ddf349ca3fc20a20f6df38bfa627a2430928bdb940f4215f3
BLAKE2b-256 checksum
How to use checksums
1cf551c3aedd0a40cec2204e63d0c7e7f30eb1bd12580b538a121cd7acbf60f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 15, 2026.

Transparency log

Release files / pyrucast-0.7.1-cp311-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl

Download URL pyrucast-0.7.1-cp311-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Size 7.3 MB
Tags CPython 3.11 abi3 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
a3ef409bc613fa89a6711185d2890cf527da96215f5272fe3aa0989d94a95696
BLAKE2b-256 checksum
How to use checksums
43254a333adeb47690f04057733d0ea1421ff592508f4aa97a3836e47ff4b610
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 15, 2026.

Transparency log

Release history Release notifications | RSS feed

0.10.0

4 release files

0.9.1

4 release files

0.9.0

4 release files

0.8.0

4 release files

This release

0.7.1 This release

4 release files

0.7.0

4 release files

0.6.0

4 release files

0.5.1

4 release files

0.5.0

4 release files

0.4.1

4 release files

0.4.0

4 release files

0.3.3

4 release files

0.3.1

4 release files

0.3.0

4 release files

0.2.1

4 release files

0.2.0

4 release files

0.1.4

4 release files

0.1.3

4 release files

0.1.2

3 release files

0.1.0

3 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page