Skip to main content

Python package and API wrapper for the ParOSol micro-FE solver

Project description

parosol-py

parosol-py is the Python package and runtime wrapper for the ParOSol micro-FE solver. It provides Python helpers for creating solver inputs, running the bundled native executable, reading outputs, and mapping label or density images to material stiffness.

The bundled native ParOSol solver was written by Cyril Flaig and is distributed under the GNU General Public License, version 2 or later. The Python package is therefore distributed as GPL-2.0-or-later.

Install

Prebuilt wheels include the native ParOSol executable and the platform MPI runtime needed to launch multi-process solves:

python -m pip install parosol-py

For local development:

python -m pip install -e .[dev]

Source installs require CMake, an MPI C++ compiler/runtime, HDF5 C++ libraries, and Eigen headers. Release wheels are built for Python 3.11, 3.12, and 3.13. macOS wheels currently target macOS 15 or newer.

Bundled MPI runtimes remain under their own upstream licenses and notices. Windows wheels bundle Microsoft MPI runtime files under Microsoft/MIT terms. macOS and Linux wheels bundle OpenMPI runtime files under OpenMPI's BSD-style terms. These MPI runtime files are not relicensed as GPL by parosol-py.

Local Check

Before relying on GitHub Actions, run the local verification gate from an environment that has the native build tools:

python scripts/local_check.py

Add --smoke-install to install the built wheel into a temporary virtual environment and import it.

Workflows And Cases

ParOSol-py separates reusable recipes from concrete runs:

  • A workflow/profile recipe is a reusable .parosol-workflow or future .parosol-profile file. SlicerParOSol creates and edits these recipes.
  • A ParOSol case is one materialized run. Shortcut commands write a parosol_case.yaml file with concrete input, output, solver, material, boundary-condition, and postprocessing settings.
  • A .parosol bundle is a portable case bundle for solving the same case on another machine.

Built-in reusable workflows are selected by name:

parosol distal-radius.AIM --profile XtremeCTII --output outputs/distal-radius

parosol 10001_QCT.nii.gz \
  --mask 10001_SEG.nii.gz \
  --profile spine-compression \
  --output outputs/10001_spine

parosol 10001_QCT.nii.gz \
  --mask 10001_SEG.nii.gz \
  --profile hip-sideways-fall-left \
  --output outputs/10001_hip_left

Slicer-authored workflows can be replayed headlessly:

parosol new_scan.nii.gz \
  --mask new_mask.nii.gz \
  --profile interactive_custom \
  --template my_workflow.parosol-workflow \
  --output outputs/new_scan

To run a fully materialized case directly:

parosol run outputs/10001_spine/parosol_case.yaml

Python API

import numpy as np

from parosol_py import solve

material = np.ones((10, 10, 10), dtype=np.float32) * 1000.0

result = solve(
    material=material,
    spacing=(0.061, 0.061, 0.061),
    material_unit="MPa",
    test="axial",
    test_axis="z",
    strain=-0.01,
    outputs=("sed",),
    export_dir="outputs/example",
)

print(result.summary)
print(result.exported)

Use dry_run=True to write the ParOSol HDF5 input and command without launching the solver:

result = solve(
    material=material,
    spacing=(0.061, 0.061, 0.061),
    material_unit="MPa",
    test="axial",
    test_axis="z",
    strain=-0.01,
    dry_run=True,
    export_dir="outputs/dry_run",
)

Material Mapping

Label images can be mapped through an explicit material table:

import numpy as np

from parosol_py import LinearIsotropicMaterials, labels_to_material_map

labels = np.array([[[100, 127]]], dtype=np.uint16)
table = LinearIsotropicMaterials(
    youngs_modulus_mpa={100: 8748.0, 127: 8748.0},
    poisson_ratio={100: 0.3, 127: 0.3},
)

mapped = labels_to_material_map(labels, table)

Continuous density images can be converted with one of the supported equations:

from parosol_py import density_to_material_map

mapped = density_to_material_map(
    density_image,
    equation="power",
    coefficient=10000.0,
    exponent=1.7,
    reference_density=1000.0,
    poisson_ratio=0.3,
)

The Mulder grayscale BMD law is available as mulder2007:

mapped = density_to_material_map(
    density_image,
    equation="mulder2007",
    active_mask=outer_contour,
    floor_e_mpa=2.0,
    poisson_ratio=0.3,
)

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

parosol_py-0.1.19.tar.gz (26.3 MB view details)

Uploaded Source

Built Distributions

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

parosol_py-0.1.19-cp314-cp314-win_amd64.whl (4.3 MB view details)

Uploaded CPython 3.14Windows x86-64

parosol_py-0.1.19-cp314-cp314-manylinux_2_28_x86_64.whl (20.0 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.28+ x86-64

parosol_py-0.1.19-cp314-cp314-macosx_15_0_x86_64.whl (10.5 MB view details)

Uploaded CPython 3.14macOS 15.0+ x86-64

parosol_py-0.1.19-cp314-cp314-macosx_15_0_arm64.whl (9.1 MB view details)

Uploaded CPython 3.14macOS 15.0+ ARM64

parosol_py-0.1.19-cp313-cp313-win_amd64.whl (4.2 MB view details)

Uploaded CPython 3.13Windows x86-64

parosol_py-0.1.19-cp313-cp313-manylinux_2_28_x86_64.whl (20.0 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

parosol_py-0.1.19-cp313-cp313-macosx_15_0_x86_64.whl (10.5 MB view details)

Uploaded CPython 3.13macOS 15.0+ x86-64

parosol_py-0.1.19-cp313-cp313-macosx_15_0_arm64.whl (9.1 MB view details)

Uploaded CPython 3.13macOS 15.0+ ARM64

parosol_py-0.1.19-cp312-cp312-win_amd64.whl (4.2 MB view details)

Uploaded CPython 3.12Windows x86-64

parosol_py-0.1.19-cp312-cp312-manylinux_2_28_x86_64.whl (20.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

parosol_py-0.1.19-cp312-cp312-macosx_15_0_x86_64.whl (10.5 MB view details)

Uploaded CPython 3.12macOS 15.0+ x86-64

parosol_py-0.1.19-cp312-cp312-macosx_15_0_arm64.whl (9.1 MB view details)

Uploaded CPython 3.12macOS 15.0+ ARM64

parosol_py-0.1.19-cp311-cp311-win_amd64.whl (4.2 MB view details)

Uploaded CPython 3.11Windows x86-64

parosol_py-0.1.19-cp311-cp311-manylinux_2_28_x86_64.whl (20.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

parosol_py-0.1.19-cp311-cp311-macosx_15_0_x86_64.whl (10.5 MB view details)

Uploaded CPython 3.11macOS 15.0+ x86-64

parosol_py-0.1.19-cp311-cp311-macosx_15_0_arm64.whl (9.1 MB view details)

Uploaded CPython 3.11macOS 15.0+ ARM64

File details

Details for the file parosol_py-0.1.19.tar.gz.

File metadata

  • Download URL: parosol_py-0.1.19.tar.gz
  • Upload date:
  • Size: 26.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for parosol_py-0.1.19.tar.gz
Algorithm Hash digest
SHA256 adcc473361a0d87803a5cac44a9139145315c146f55c5b0d1666d56c61e90bf9
MD5 e9a353ae6e3cefc2e2a527dc465dd1e8
BLAKE2b-256 db699bd1b71971446c8687ed8c5b08a0ecc08d17f1ea274f85329d8d4ca23fd3

See more details on using hashes here.

Provenance

The following attestation bundles were made for parosol_py-0.1.19.tar.gz:

Publisher: build-wheels.yml on wallematthias/parosol-py

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

File details

Details for the file parosol_py-0.1.19-cp314-cp314-win_amd64.whl.

File metadata

File hashes

Hashes for parosol_py-0.1.19-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 7a51fc423090529393a72989af5dcb1ce45aeba34a224b0a043ccd2907b67714
MD5 175253b42d2a45b6956a910ffc0aa9cf
BLAKE2b-256 e3778a1c1bf32b9bf07fcfcb46a46a18dbad22f4a82797e92d75b02a7c3945e0

See more details on using hashes here.

Provenance

The following attestation bundles were made for parosol_py-0.1.19-cp314-cp314-win_amd64.whl:

Publisher: build-wheels.yml on wallematthias/parosol-py

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

File details

Details for the file parosol_py-0.1.19-cp314-cp314-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for parosol_py-0.1.19-cp314-cp314-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8385a0a494b4ccd8098d041268bc4c41a0fb0690e2a650ff614477b0094f083f
MD5 c06863ab01205ae103de1d1c3ef8a050
BLAKE2b-256 660f58d84f8deb0243927c2dc6a0311cc7afa820e43b3517595c4a4224fe1427

See more details on using hashes here.

Provenance

The following attestation bundles were made for parosol_py-0.1.19-cp314-cp314-manylinux_2_28_x86_64.whl:

Publisher: build-wheels.yml on wallematthias/parosol-py

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

File details

Details for the file parosol_py-0.1.19-cp314-cp314-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for parosol_py-0.1.19-cp314-cp314-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 0e1a9c6b4bbb34c75e675ea0e7dbabdb19205cd03a19f6617eda505a11f2b683
MD5 e3ac355cca0f5dfe46668d714b9be465
BLAKE2b-256 6cd8182ad4bac63937498f73f6a62ad47c66569738ac852b6bd31035897f3e35

See more details on using hashes here.

Provenance

The following attestation bundles were made for parosol_py-0.1.19-cp314-cp314-macosx_15_0_x86_64.whl:

Publisher: build-wheels.yml on wallematthias/parosol-py

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

File details

Details for the file parosol_py-0.1.19-cp314-cp314-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for parosol_py-0.1.19-cp314-cp314-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 eca8956c7b41f0caba73448a03b0aa02f681feb24a717dd640538951233fd3ed
MD5 d14d1824e812c341a360f3358de5324e
BLAKE2b-256 7d071a00e5013b9c0e590e4d05e3f84b84b77294a443b0188c95ba65654cf9f2

See more details on using hashes here.

Provenance

The following attestation bundles were made for parosol_py-0.1.19-cp314-cp314-macosx_15_0_arm64.whl:

Publisher: build-wheels.yml on wallematthias/parosol-py

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

File details

Details for the file parosol_py-0.1.19-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for parosol_py-0.1.19-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 069a41d838f4a6efb03fbe01eaca48d0976faeae5de98f20da30274e883b272a
MD5 80309f7728bebcc61ee9d0153ffb75d6
BLAKE2b-256 81c696da92623df8e7b90cddab60ad76dd7eaa9d1dd6a2d53493f2b4cb9eaf10

See more details on using hashes here.

Provenance

The following attestation bundles were made for parosol_py-0.1.19-cp313-cp313-win_amd64.whl:

Publisher: build-wheels.yml on wallematthias/parosol-py

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

File details

Details for the file parosol_py-0.1.19-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for parosol_py-0.1.19-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 5e81ef8bdc2b7c4e3deaa45e518268ba87a3f9deb1c0615d67ac3b19a9486334
MD5 1d0bbfcb243f13f7149dddc0ec6c9a7a
BLAKE2b-256 fb46ed6e2bd39785cac2a076bd688cd8117145441080e434aebd7b9edda645eb

See more details on using hashes here.

Provenance

The following attestation bundles were made for parosol_py-0.1.19-cp313-cp313-manylinux_2_28_x86_64.whl:

Publisher: build-wheels.yml on wallematthias/parosol-py

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

File details

Details for the file parosol_py-0.1.19-cp313-cp313-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for parosol_py-0.1.19-cp313-cp313-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 e3f6d9f818d0d73296170f47637ab7d06c732f90462e0468451af41733ab262b
MD5 1b52d09600f86ecedb49e214d3746226
BLAKE2b-256 c04ccbe8e9c07e202843cd7d2a8a0cff6d87f26f2a534194e3aac694562542ba

See more details on using hashes here.

Provenance

The following attestation bundles were made for parosol_py-0.1.19-cp313-cp313-macosx_15_0_x86_64.whl:

Publisher: build-wheels.yml on wallematthias/parosol-py

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

File details

Details for the file parosol_py-0.1.19-cp313-cp313-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for parosol_py-0.1.19-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 d927d3a72ecd0ad3760265d9756c72fb972161182e27019cb859c5e9e8f4bb95
MD5 bb8e4345e91f3abc741b49c429ea72b9
BLAKE2b-256 cf26e84f329cb956661b6eac34376df39f685087dbd3f2c57e13889d21179416

See more details on using hashes here.

Provenance

The following attestation bundles were made for parosol_py-0.1.19-cp313-cp313-macosx_15_0_arm64.whl:

Publisher: build-wheels.yml on wallematthias/parosol-py

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

File details

Details for the file parosol_py-0.1.19-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for parosol_py-0.1.19-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 61b5e70837ae022cb711a9f9512cd5085db69f4224a14aede9d7589f54504f2e
MD5 9a3e721072c4ae3f0ecc874c4da9b73e
BLAKE2b-256 d610077868a35b0a5cedf364cd4bdb56d1512053159e02c68d5cdfaf1f56a344

See more details on using hashes here.

Provenance

The following attestation bundles were made for parosol_py-0.1.19-cp312-cp312-win_amd64.whl:

Publisher: build-wheels.yml on wallematthias/parosol-py

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

File details

Details for the file parosol_py-0.1.19-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for parosol_py-0.1.19-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2c27d89c295a7d0cb37c63d440b41c1df1c6f09c8a16e227c382d5cd83081424
MD5 a60eb0865ebafb9111ed6cfb8e05f3a2
BLAKE2b-256 60f69c549fd84a1503302ae4bd6f371937e0e967373589eda839640b14a653fe

See more details on using hashes here.

Provenance

The following attestation bundles were made for parosol_py-0.1.19-cp312-cp312-manylinux_2_28_x86_64.whl:

Publisher: build-wheels.yml on wallematthias/parosol-py

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

File details

Details for the file parosol_py-0.1.19-cp312-cp312-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for parosol_py-0.1.19-cp312-cp312-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 9343a56cddfaeca821e1cacada35a8a95341c213d07f1cd1786a60ffbf492b54
MD5 dc2f2bc453f1fe1365c05dc8015b5f0d
BLAKE2b-256 7bd0ed0b328dc53a3bbb9f984fd3e7858be8466843fadd50402c397d1fae2173

See more details on using hashes here.

Provenance

The following attestation bundles were made for parosol_py-0.1.19-cp312-cp312-macosx_15_0_x86_64.whl:

Publisher: build-wheels.yml on wallematthias/parosol-py

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

File details

Details for the file parosol_py-0.1.19-cp312-cp312-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for parosol_py-0.1.19-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 bc60611261807c8675641c683c93d9f7f95f09823e3c67c345c23d801851ca9c
MD5 afb2fc361b74c4cda2971c258236ed73
BLAKE2b-256 a437dce0cf6fefcd711ab75bd3e80c1fa142e572f54624d2e2bdc798f6dbd9ab

See more details on using hashes here.

Provenance

The following attestation bundles were made for parosol_py-0.1.19-cp312-cp312-macosx_15_0_arm64.whl:

Publisher: build-wheels.yml on wallematthias/parosol-py

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

File details

Details for the file parosol_py-0.1.19-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for parosol_py-0.1.19-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 e214c2c91944e6a1916354c915d6a042d80c130ff6cdb449b0ada61ea0425ff4
MD5 6e23ae36fdd02f9cbdaac3d7997ca8c4
BLAKE2b-256 f86732c2697a9b5a0b8c374ea8829ef429cb0015cd83a26da3f5b6def9120c62

See more details on using hashes here.

Provenance

The following attestation bundles were made for parosol_py-0.1.19-cp311-cp311-win_amd64.whl:

Publisher: build-wheels.yml on wallematthias/parosol-py

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

File details

Details for the file parosol_py-0.1.19-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for parosol_py-0.1.19-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e360d173eec67b31eaf204ef71727283ba6127b9443ced688f80ff31eac8f506
MD5 ecfbfe4ece31b804b0f8600532e4d9a0
BLAKE2b-256 e7bdafef2f526a0fc3129bf8088cc513b99217ec4922b05623bcdc06ebe56811

See more details on using hashes here.

Provenance

The following attestation bundles were made for parosol_py-0.1.19-cp311-cp311-manylinux_2_28_x86_64.whl:

Publisher: build-wheels.yml on wallematthias/parosol-py

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

File details

Details for the file parosol_py-0.1.19-cp311-cp311-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for parosol_py-0.1.19-cp311-cp311-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 6d80beb958566c6efcd4b85d9fae6c3692a01c5f83150faf48f7b6bc749a549e
MD5 ae8a71fa19b6f68e733a4c95618b14fa
BLAKE2b-256 1683e12fb35b7ecb12ddb2f7100cc30269840e1c3e5b7260c26484076678ce35

See more details on using hashes here.

Provenance

The following attestation bundles were made for parosol_py-0.1.19-cp311-cp311-macosx_15_0_x86_64.whl:

Publisher: build-wheels.yml on wallematthias/parosol-py

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

File details

Details for the file parosol_py-0.1.19-cp311-cp311-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for parosol_py-0.1.19-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 659c8b22f9ed65b2f41ac6803d0e526dc7fbe550fc1c194215541779d5564919
MD5 fa76dbedf539226e46712c6b900014e5
BLAKE2b-256 632b9162903e5b6921fa9d807bbfeed038b7a44422f6ff7b81abc03d59fd6fc0

See more details on using hashes here.

Provenance

The following attestation bundles were made for parosol_py-0.1.19-cp311-cp311-macosx_15_0_arm64.whl:

Publisher: build-wheels.yml on wallematthias/parosol-py

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