Skip to main content

Python bindings for the scinumtools3 C++ core

Project description

SciNumTools3 for Python

PyPI version Python License: MIT

Unit-safe quantities, runtime expressions, and validated scientific parameters for Python.

SciNumTools3 helps eliminate hidden assumptions in scientific software by providing:

  • ✅ Physical quantities with units
  • ✅ Automatic unit conversion
  • ✅ Runtime expression evaluation
  • ✅ Validated input parameters
  • ✅ Structured scientific configuration files
  • ✅ Consistent parameter handling across simulation and analysis workflows

Relationship to the C++ Core

scinumtools3 is the official Python binding for the SciNumTools3 C++ project.

The Python package exposes the same core concepts used by the C++ implementation, including:

  • Physical Units & Quantities (PUQ)
  • Dimensional Input Parameters (DIP)
  • Runtime expression evaluation
  • Unit-aware validation and conversion

This enables consistent parameter definitions and unit handling across Python analysis workflows and C++ simulation codebases.

C++ Project

The underlying C++ implementation is available on GitHub:

https://github.com/vrtulka23/scinumtools3

The C++ project serves as the reference implementation and provides high-performance support for scientific computing, numerical simulations, and HPC workflows.


Installation

Install directly from PyPI:

pip install scinumtools3

PyPI package:

https://pypi.org/project/scinumtools3/


Why SciNumTools3?

Scientific workflows frequently suffer from:

  • inconsistent unit handling
  • manual conversion mistakes
  • duplicated parameter definitions
  • missing validation
  • configuration drift between simulation and analysis code

SciNumTools3 provides a unified framework for defining, validating, and evaluating scientific parameters while preserving physical units throughout calculations.


Core Features

Physical Quantities

Create quantities with physical units and perform automatic conversions:

from scinumtools3.puq import Quantity

length = Quantity("1*m")
length = length.convert("km")

print(length)
# 1e-3*km

Unit-Aware Arithmetic

from scinumtools3.puq import Quantity

distance = Quantity("1000*m")
time = Quantity("100*s")

velocity = distance / time

print(velocity)
# 10*m*s-1

Validated Parameters (DIP)

Define scientific parameters with units, constraints, and dependencies.

from scinumtools3.dip import DIP

dip = DIP()

dip.add_string("temperature float = 300 K")
dip.add_string("pressure float = 1 atm")

env = dip.parse()

Example parameter specification:

simulation

  timestep float = 0.5 fs
    !condition ({?} > 0.0 fs)

  temperature float = 300 K
    !condition ({?} > 0 K)

  pressure float = 1 atm

  steps int = 1000000
    !condition ({?} > 1)

  duration float = ( {?simulation.timestep} * {?simulation.steps} )

  ensemble string = "NPT"
    !options ["NVE", "NVT", "NPT"]

Domain-Specific Languages

SciNumTools3 is built around two scientific DSLs.

PUEL — Physical Units Expression Language

A concise language for representing physical quantities, units, dimensions, uncertainties, and arrays.

Examples:

ESU_erg
m2*kg*s-2
kg2*ms3:2*cm
1.346591(30)e27*kg
[2,3,4,5]*km

PUEL powers:

  • quantity parsing
  • dimensional analysis
  • unit conversions
  • unit-aware calculations

DIPL — Dimensional Input Parameter Language

A declarative language for defining scientific parameters with:

  • types
  • units
  • constraints
  • dependencies
  • validation rules

This allows scientific applications to maintain a single source of truth for configuration and input validation.


Quick Example

from scinumtools3.puq import Quantity
from scinumtools3.dip import DIP

# Unit conversion
length = Quantity("1*m")
length = length.convert("km")

print(length)
# 1e-3*km

# Validated parameters
dip = DIP()

dip.add_string("foo int m")
dip.add_string("foo = 3 km")

env = dip.parse()

print(env.nodes[0])
# 3000 m

Documentation

Full documentation, API reference, language specifications, and examples:

https://vrtulka23.github.io/scinumtools3/

Documentation includes:

  • Python API reference
  • PUEL specification
  • DIPL specification
  • Tutorials and examples

Typical Use Cases

  • Scientific computing
  • Physics simulations
  • Engineering applications
  • Data analysis pipelines
  • Research software
  • Hybrid Python/C++ workflows
  • Unit-safe parameter management

Contributing

Contributions are welcome.

git clone https://github.com/vrtulka23/scinumtools3.git
cd scinumtools3

Please open an issue or pull request for bug fixes, improvements, or new features.


License

SciNumTools3 is released under the MIT License.

See the LICENSE file for details.


Links

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

scinumtools3-0.6.2.tar.gz (288.4 kB view details)

Uploaded Source

Built Distributions

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

scinumtools3-0.6.2-cp313-cp313-win_amd64.whl (25.4 MB view details)

Uploaded CPython 3.13Windows x86-64

scinumtools3-0.6.2-cp313-cp313-musllinux_1_2_x86_64.whl (13.5 MB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

scinumtools3-0.6.2-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (12.2 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

scinumtools3-0.6.2-cp313-cp313-macosx_11_0_arm64.whl (8.9 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

scinumtools3-0.6.2-cp312-cp312-win_amd64.whl (25.4 MB view details)

Uploaded CPython 3.12Windows x86-64

scinumtools3-0.6.2-cp312-cp312-musllinux_1_2_x86_64.whl (13.5 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

scinumtools3-0.6.2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (12.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

scinumtools3-0.6.2-cp312-cp312-macosx_11_0_arm64.whl (8.9 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

scinumtools3-0.6.2-cp311-cp311-win_amd64.whl (25.3 MB view details)

Uploaded CPython 3.11Windows x86-64

scinumtools3-0.6.2-cp311-cp311-musllinux_1_2_x86_64.whl (13.5 MB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ x86-64

scinumtools3-0.6.2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (12.2 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

scinumtools3-0.6.2-cp311-cp311-macosx_11_0_arm64.whl (8.9 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

Details for the file scinumtools3-0.6.2.tar.gz.

File metadata

  • Download URL: scinumtools3-0.6.2.tar.gz
  • Upload date:
  • Size: 288.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for scinumtools3-0.6.2.tar.gz
Algorithm Hash digest
SHA256 247b0e19e6468971fc6d19d002545728fe2df11d38fbbeaf8a6f63d0764da32f
MD5 1cc9fa8e4862f4960dbdf097ff64e753
BLAKE2b-256 20d434a6253633f564b9700b829da006979889154533436465517df4ea94a1a3

See more details on using hashes here.

Provenance

The following attestation bundles were made for scinumtools3-0.6.2.tar.gz:

Publisher: pypi-wheels.yml on vrtulka23/scinumtools3

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

File details

Details for the file scinumtools3-0.6.2-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for scinumtools3-0.6.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 601407cdd0801c7e5438003ccac359bd7eb55c121c7a289d2e936c28c127685a
MD5 bf9bd148f72a3754ec03c63cd4d7ae13
BLAKE2b-256 07c82206651fc959679159dedcbba5b06048afa7255bd71dda63f94bc0834075

See more details on using hashes here.

Provenance

The following attestation bundles were made for scinumtools3-0.6.2-cp313-cp313-win_amd64.whl:

Publisher: pypi-wheels.yml on vrtulka23/scinumtools3

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

File details

Details for the file scinumtools3-0.6.2-cp313-cp313-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for scinumtools3-0.6.2-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 ca5b6f5284b7ba0313434dcf1ae2d562cc45ae3fd30423aa09c0c57dea047a5a
MD5 c4dbb254bf51240f0891463bb0cdfefa
BLAKE2b-256 18d8156bd6283c8c0079a5131c181f5d2dadb888bc16ae51c70bdb578feef38c

See more details on using hashes here.

Provenance

The following attestation bundles were made for scinumtools3-0.6.2-cp313-cp313-musllinux_1_2_x86_64.whl:

Publisher: pypi-wheels.yml on vrtulka23/scinumtools3

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

File details

Details for the file scinumtools3-0.6.2-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for scinumtools3-0.6.2-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 99c97e98070f627551a884b5b4540c9539c6e2e8dd4b3ca8205f1aff6fe3e5f6
MD5 4d2c275a3904067a23ec2a12a7da947b
BLAKE2b-256 34df0bcf6ce6582a0e012e426bebe5739886ca6b58a76e9ac9ca6ca4697e4be8

See more details on using hashes here.

Provenance

The following attestation bundles were made for scinumtools3-0.6.2-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: pypi-wheels.yml on vrtulka23/scinumtools3

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

File details

Details for the file scinumtools3-0.6.2-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for scinumtools3-0.6.2-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c6d3bd8c682ffae527c661c0277b0223441dab7aa98c685bf393bab827a1b2ee
MD5 fc6f87f798965e036f3b1263bfb3bb7b
BLAKE2b-256 7762394eb8f56587f69419354efd30106e96e4a17326c11e81f000b01d5d9d3f

See more details on using hashes here.

Provenance

The following attestation bundles were made for scinumtools3-0.6.2-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: pypi-wheels.yml on vrtulka23/scinumtools3

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

File details

Details for the file scinumtools3-0.6.2-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for scinumtools3-0.6.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 3cd474b6541a8c04e70bbd852676554e5e6a2790d47e250d1fa3e71b0332d6d1
MD5 77e6da42bf0e69b74442b5752cee1d9d
BLAKE2b-256 adc2e78fd497fc526dc91cfe1cbe64d39c150efc86bf9690af72998e9bf28216

See more details on using hashes here.

Provenance

The following attestation bundles were made for scinumtools3-0.6.2-cp312-cp312-win_amd64.whl:

Publisher: pypi-wheels.yml on vrtulka23/scinumtools3

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

File details

Details for the file scinumtools3-0.6.2-cp312-cp312-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for scinumtools3-0.6.2-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 77b98f263d97b56499f7b0408b4d30bb794e718b09343427a5b534e0f956fbe5
MD5 bf2d999261858c8172e05d064009a259
BLAKE2b-256 54a639443f91bab290203b87a0713a7aacf229cf3c5e7da3a1830cb8b91c9fab

See more details on using hashes here.

Provenance

The following attestation bundles were made for scinumtools3-0.6.2-cp312-cp312-musllinux_1_2_x86_64.whl:

Publisher: pypi-wheels.yml on vrtulka23/scinumtools3

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

File details

Details for the file scinumtools3-0.6.2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for scinumtools3-0.6.2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 53cc7b6a96513887dd4ec038f7df732d028ca3766b13b188ea9f96eb62ae5865
MD5 a3466239009266d4d517a1fd104859c4
BLAKE2b-256 492a071a606acd6975b17dc266a769d03d2cebe9c3937055cfc2a35b9474f884

See more details on using hashes here.

Provenance

The following attestation bundles were made for scinumtools3-0.6.2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: pypi-wheels.yml on vrtulka23/scinumtools3

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

File details

Details for the file scinumtools3-0.6.2-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for scinumtools3-0.6.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5e0a51826403ad69392a111adb616e34483f05aaa555d777ded7bb2bca612e4b
MD5 da8aac7dfbe3bab6995a57ee26d488b1
BLAKE2b-256 4a6bbd41e28d320100d4ec59dd5d2636ad55b7be0c3be4f970f363205cdbe1f4

See more details on using hashes here.

Provenance

The following attestation bundles were made for scinumtools3-0.6.2-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: pypi-wheels.yml on vrtulka23/scinumtools3

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

File details

Details for the file scinumtools3-0.6.2-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for scinumtools3-0.6.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 29a1b11e42952331405e5640adb110df3fba464e271a51fb92dee0bc4f60ebd8
MD5 fc4ce932383403be560eb611a8d43bff
BLAKE2b-256 9e1b63a4843b1672b157b227b053f81ec472e7e12c00b912d8b932172edccc61

See more details on using hashes here.

Provenance

The following attestation bundles were made for scinumtools3-0.6.2-cp311-cp311-win_amd64.whl:

Publisher: pypi-wheels.yml on vrtulka23/scinumtools3

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

File details

Details for the file scinumtools3-0.6.2-cp311-cp311-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for scinumtools3-0.6.2-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 5a4977089c4ff0b4a61b04d40cc907395736084da06fd189b4c0065a517e6991
MD5 a93ba958757b677ddbdbaf9d64a88205
BLAKE2b-256 43622c231f668dcdb418f3a36972c18271a77cfab079e72b6eaee616e56bca31

See more details on using hashes here.

Provenance

The following attestation bundles were made for scinumtools3-0.6.2-cp311-cp311-musllinux_1_2_x86_64.whl:

Publisher: pypi-wheels.yml on vrtulka23/scinumtools3

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

File details

Details for the file scinumtools3-0.6.2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for scinumtools3-0.6.2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c6d39efdcf59b9bacf4ff259e393b6f524c16576e51160642df39042d03cc441
MD5 0ff26826b5f3e71662c80f54c2350e13
BLAKE2b-256 71b0f35acf687cad988aa95f03b9ab2039c21b1d250fa2759df638a43856ccc8

See more details on using hashes here.

Provenance

The following attestation bundles were made for scinumtools3-0.6.2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: pypi-wheels.yml on vrtulka23/scinumtools3

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

File details

Details for the file scinumtools3-0.6.2-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for scinumtools3-0.6.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 14420eb07405e3dffd23ce28739187e8c30b486d20ed5a433e40b5ba0cd0367d
MD5 f6e64b1e32c1f5632d726566f547ba37
BLAKE2b-256 10d31ab781b9f381781fbc5f2125522b2e30b7e1a6f6b4946d2c1fa7392510c8

See more details on using hashes here.

Provenance

The following attestation bundles were made for scinumtools3-0.6.2-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: pypi-wheels.yml on vrtulka23/scinumtools3

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