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.8.0

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.8.0
File Size Uploaded
pyrucast-0.8.0.tar.gz 1.5 MB Details

Built distributions (wheels)

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

Total release size: 19.3 MB

Release files / pyrucast-0.8.0.tar.gz

Download URL pyrucast-0.8.0.tar.gz
Size 1.5 MB
Tags Source
SHA-256 checksum
How to use checksums
29d12151030438da9aa8656745de0ef94f983b7e4744670b97a5f49eaec3867e
BLAKE2b-256 checksum
How to use checksums
dd93f7ac158fe26db64d2de1df4816de98333f3439caf697310fa0c8ca83d9a8
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 17, 2026.

Transparency log

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

Download URL pyrucast-0.8.0-cp311-abi3-win_amd64.whl
Size 3.8 MB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
65155850082f25b728fb64890ef1030b212ddde4d0c66306545f1d9c9849cbad
BLAKE2b-256 checksum
How to use checksums
9a5c24669503914b9d13ff1e88a213eb28e2b857fdc341fca447868c935291e4
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 17, 2026.

Transparency log

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

Download URL pyrucast-0.8.0-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
412ac9376fc870a39e442e53873aad19ac818ce3e7e7d358044c5961a8f6a733
BLAKE2b-256 checksum
How to use checksums
4068105cc92b12a23ee3120ca1b55215396bd9ea4587e99e26fcd4cbe3eeaa5f
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 17, 2026.

Transparency log

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

Download URL pyrucast-0.8.0-cp311-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Size 7.4 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
de09d2a55753057b7a0b5065abad58658ae221ae0ca2a1b06879912bab8907a9
BLAKE2b-256 checksum
How to use checksums
2041165b3fc5081cefdabf15e27a286266a8a9269ca6a4e3d155796f5cb4ae5d
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 17, 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

This release

0.8.0 This release

4 release files

0.7.1

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