Skip to main content

parosol-py icon

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.

Author: Matthias Walle.

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,
)

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.23.tar.gz (28.4 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.23-cp314-cp314-manylinux_2_28_x86_64.whl (21.0 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.28+ x86-64

parosol_py-0.1.23-cp314-cp314-macosx_15_0_x86_64.whl (11.4 MB view details)

Uploaded CPython 3.14macOS 15.0+ x86-64

parosol_py-0.1.23-cp314-cp314-macosx_15_0_arm64.whl (10.1 MB view details)

Uploaded CPython 3.14macOS 15.0+ ARM64

parosol_py-0.1.23-cp313-cp313-manylinux_2_28_x86_64.whl (21.0 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

parosol_py-0.1.23-cp313-cp313-macosx_15_0_x86_64.whl (11.4 MB view details)

Uploaded CPython 3.13macOS 15.0+ x86-64

parosol_py-0.1.23-cp313-cp313-macosx_15_0_arm64.whl (10.1 MB view details)

Uploaded CPython 3.13macOS 15.0+ ARM64

parosol_py-0.1.23-cp312-cp312-manylinux_2_28_x86_64.whl (21.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

parosol_py-0.1.23-cp312-cp312-macosx_15_0_x86_64.whl (11.4 MB view details)

Uploaded CPython 3.12macOS 15.0+ x86-64

parosol_py-0.1.23-cp312-cp312-macosx_15_0_arm64.whl (10.1 MB view details)

Uploaded CPython 3.12macOS 15.0+ ARM64

parosol_py-0.1.23-cp311-cp311-manylinux_2_28_x86_64.whl (21.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

parosol_py-0.1.23-cp311-cp311-macosx_15_0_x86_64.whl (11.4 MB view details)

Uploaded CPython 3.11macOS 15.0+ x86-64

parosol_py-0.1.23-cp311-cp311-macosx_15_0_arm64.whl (10.1 MB view details)

Uploaded CPython 3.11macOS 15.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for parosol_py-0.1.23.tar.gz
Algorithm Hash digest
SHA256 566f4f6e47e6c4224bfce55e798c2747eae124d0526d0f255bbb52ce5653bfe9
MD5 a2cfbb221cfb057f1c724a0c2c435efa
BLAKE2b-256 1a97b69d0d816aadfa8fc325e1334b2f06a9998ec0664d4d62766d119249456c

See more details on using hashes here.

Provenance

The following attestation bundles were made for parosol_py-0.1.23.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.23-cp314-cp314-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for parosol_py-0.1.23-cp314-cp314-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 462f6dd84cb46ce47a0ac1d2b24530740e77b5383c7409e6dd71771790954be0
MD5 e4de9ebac046eec48243683dfc7e9513
BLAKE2b-256 87164e4b48f65418efacd1ebd341ff3a765be7660c8ff1be949d3aabbb8074ec

See more details on using hashes here.

Provenance

The following attestation bundles were made for parosol_py-0.1.23-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.23-cp314-cp314-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for parosol_py-0.1.23-cp314-cp314-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 556f125f5beed40e00f502156b8ab58084a6c72b9c30d1b54315121732622c2b
MD5 7cff23ed37306cc922738d9a93c60e89
BLAKE2b-256 bf30706ee9259a201db4648d576cc6925bb3c390157b1b856bf95defa7a14935

See more details on using hashes here.

Provenance

The following attestation bundles were made for parosol_py-0.1.23-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.23-cp314-cp314-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for parosol_py-0.1.23-cp314-cp314-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 ee4f60d7acf50741ad0ece49d3b24a4204d2d1cdada669a85f84a39658fcc7e3
MD5 82c1a45775cba4b9d792caf6a0745f1a
BLAKE2b-256 453e60c486c7b9d41c493027d8f9424e39e21051fc0511d3b50935a4368b1f77

See more details on using hashes here.

Provenance

The following attestation bundles were made for parosol_py-0.1.23-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.23-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for parosol_py-0.1.23-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a43e3e45052a6763709d17766cfe97bebfe436c0149e3854223faebaa7d1127b
MD5 f1bffd79109f9fcd0f842a8087f57404
BLAKE2b-256 45bbe5aeda51ae03174256903a714db81c3b8be53c61f03622429306240aed23

See more details on using hashes here.

Provenance

The following attestation bundles were made for parosol_py-0.1.23-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.23-cp313-cp313-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for parosol_py-0.1.23-cp313-cp313-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 5c19c9e748b30fc0df37b850ffd30fe92b7906b7f50402e33c0c92db2cd5fd3a
MD5 462fb3004b3c9069ca7c1c8f653d8553
BLAKE2b-256 9ae565bb6e8c72c1e2d80507049579a98137759436a679960b819c6056b54f6d

See more details on using hashes here.

Provenance

The following attestation bundles were made for parosol_py-0.1.23-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.23-cp313-cp313-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for parosol_py-0.1.23-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 b670cee8abe573adce4d7a851003517ca048b90f3b4c3a4768c3507f3c339d4b
MD5 6ae3617688389569e2132f2f79de30fc
BLAKE2b-256 1c11234310b0413b9de10d0ffed77d39d4cdf76a5dc1f539a9275a078e357d0b

See more details on using hashes here.

Provenance

The following attestation bundles were made for parosol_py-0.1.23-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.23-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for parosol_py-0.1.23-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ef797130e937065a534fb50686d79398b4b7583c0f13bc197eb9ca483d4ba77c
MD5 55061aa8849443fd739540210ef0c9f8
BLAKE2b-256 81179d166dc7af30a0d661dad5abb103a15a30999dddaeeedc355e32f666a924

See more details on using hashes here.

Provenance

The following attestation bundles were made for parosol_py-0.1.23-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.23-cp312-cp312-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for parosol_py-0.1.23-cp312-cp312-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 21c445bbc5ade5d605f7cebfa108597b484122eb00e4a5124df1f58a8fcbeff3
MD5 d9399dcae5ea295f148c212b448b7ab7
BLAKE2b-256 819a623ff0513a198e3f7514635727b5f92f7d0dafa807f959a3d4a4cec40682

See more details on using hashes here.

Provenance

The following attestation bundles were made for parosol_py-0.1.23-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.23-cp312-cp312-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for parosol_py-0.1.23-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 4c8fad1b04573578b44640596f6ca3e0f5a1dd3edea5a25804763741d53a60f6
MD5 32c95124b074490326f786eb57b8c8a9
BLAKE2b-256 9bef2c8b0468c02c42a3c8884d5508c5bdcffcf26eef89781824b7e66534c9bf

See more details on using hashes here.

Provenance

The following attestation bundles were made for parosol_py-0.1.23-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.23-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for parosol_py-0.1.23-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e139e4a13929f37b2a40f52bda174deae2f3e4e1c44da6306c069559fd01ccb5
MD5 b3b2175addfaf68df79a3d7cc26427f0
BLAKE2b-256 82b0352e2bcd3ff86240c56d3772337327fb464dc07b792012eb3ece5b10fa61

See more details on using hashes here.

Provenance

The following attestation bundles were made for parosol_py-0.1.23-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.23-cp311-cp311-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for parosol_py-0.1.23-cp311-cp311-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 7bf776a68e798c91382e8d533da8586d9249099d83c4cd84dd260dd9ab68a668
MD5 c1911ea4155d6af6b13e96d1b9f3ed2b
BLAKE2b-256 9ea3ad5307ed14ee6787252827519d07b32bb051e5c5a042668831eacce6e910

See more details on using hashes here.

Provenance

The following attestation bundles were made for parosol_py-0.1.23-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.23-cp311-cp311-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for parosol_py-0.1.23-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 a6546eee5bd041ad944affc7b6d5678a52a4ba3c62c00a43109b464429a2bb88
MD5 2aebb1ecfd8c9fb692b32ef6b9cb5ad6
BLAKE2b-256 1a2938b028f9bb9f29bf75f209e8476770aa629af7877d3561090ad78895e4c3

See more details on using hashes here.

Provenance

The following attestation bundles were made for parosol_py-0.1.23-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.

Release history Release notifications | RSS feed

This release

0.1.23 This release

13 files

0.1.21

17 files

0.1.20

17 files

0.1.19

17 files

0.1.18

13 files

0.1.17

13 files

0.1.13

13 files

0.1.12

13 files

0.1.11

13 files

0.1.10

13 files

0.1.9

13 files

0.1.8

13 files

0.1.7

13 files

0.1.6

13 files

0.1.5

13 files

0.1.4

13 files

0.1.3

13 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