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 uniquementLinux : 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).

Download files

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

Source Distribution

pyrucast-0.5.0.tar.gz (1.4 MB view details)

Uploaded Source

Built Distributions

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

pyrucast-0.5.0-cp311-abi3-win_amd64.whl (3.7 MB view details)

Uploaded CPython 3.11+Windows x86-64

pyrucast-0.5.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.6 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.17+ x86-64

pyrucast-0.5.0-cp311-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (7.3 MB view details)

Uploaded CPython 3.11+macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

File details

Details for the file pyrucast-0.5.0.tar.gz.

File metadata

  • Download URL: pyrucast-0.5.0.tar.gz
  • Upload date:
  • Size: 1.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pyrucast-0.5.0.tar.gz
Algorithm Hash digest
SHA256 c594294580e3a0363e0b9c30b5253547bd2e13d14c29534ebf2c886f006a130f
MD5 b253b7d77cdc32e8774c4ff641871a39
BLAKE2b-256 11a239e07c6c68c0d7acc33fed4ce35539b1004293a582c8cfe1f07a293aa2f7

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyrucast-0.5.0.tar.gz:

Publisher: release.yml on Pyrucast/pyrucast

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

File details

Details for the file pyrucast-0.5.0-cp311-abi3-win_amd64.whl.

File metadata

  • Download URL: pyrucast-0.5.0-cp311-abi3-win_amd64.whl
  • Upload date:
  • Size: 3.7 MB
  • Tags: CPython 3.11+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pyrucast-0.5.0-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 5ee54929ce8f51aea3fd5771f12cec5e28a687c4f9e2727ca7ba575f9076926a
MD5 35e3bb5801dbed2f0d993010557a8cdf
BLAKE2b-256 e99ee410188f1c3b826affffb4d8775c3e0e1ce55962830a16b663b1e28d31a1

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyrucast-0.5.0-cp311-abi3-win_amd64.whl:

Publisher: release.yml on Pyrucast/pyrucast

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

File details

Details for the file pyrucast-0.5.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyrucast-0.5.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2b8a7c038752aa3927b3a749d3438d8256c8e84260514acbc0f37e3243c0fe49
MD5 2011ccc66c3f2f526666e99620abdc3b
BLAKE2b-256 d245cb7177224dde632406822fe3f5cd54e05ec9fef890799e7d327fb620c546

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyrucast-0.5.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on Pyrucast/pyrucast

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

File details

Details for the file pyrucast-0.5.0-cp311-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for pyrucast-0.5.0-cp311-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 d1267377614a7a49b47069d26d4da92cac3f44d4d6e1f8df0b6612d9bf9b61d3
MD5 ea5f662f63b9435f5ff976a8b6bcf318
BLAKE2b-256 3b466b872293169e4260a452b1d2c43e40ea31a2b9b0ba79084c022b9fa1be00

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyrucast-0.5.0-cp311-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl:

Publisher: release.yml on Pyrucast/pyrucast

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

Release history Release notifications | RSS feed

0.7.0

4 files

0.6.0

4 files

0.5.1

4 files

This release

0.5.0 This release

4 files

0.4.1

4 files

0.4.0

4 files

0.3.3

4 files

0.3.1

4 files

0.3.0

4 files

0.2.1

4 files

0.2.0

4 files

0.1.4

4 files

0.1.3

4 files

0.1.2

3 files

0.1.0

3 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