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.1.tar.gz (285.7 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.1-cp313-cp313-win_amd64.whl (25.3 MB view details)

Uploaded CPython 3.13Windows x86-64

scinumtools3-0.6.1-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.1-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.1-cp313-cp313-macosx_11_0_arm64.whl (8.9 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

scinumtools3-0.6.1-cp312-cp312-win_amd64.whl (25.3 MB view details)

Uploaded CPython 3.12Windows x86-64

scinumtools3-0.6.1-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.1-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.1-cp312-cp312-macosx_11_0_arm64.whl (8.9 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

scinumtools3-0.6.1-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.1-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.1-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.1.tar.gz.

File metadata

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

File hashes

Hashes for scinumtools3-0.6.1.tar.gz
Algorithm Hash digest
SHA256 0a80eb849e477d4669450cc06f607d7ae83ec1fc2645034f9b8255840d9a4d1e
MD5 6da9244a9fc6536e20cd4a6f1c8b45c1
BLAKE2b-256 30de5a7910cdab1a9fe9cd5749d83d86763eca938361042e780f661f7f73ea08

See more details on using hashes here.

Provenance

The following attestation bundles were made for scinumtools3-0.6.1.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.1-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for scinumtools3-0.6.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 b8153f9b75ba9592b390d9a417a32c35c6fdf586bbb62d2a3f13b9b41a4144e6
MD5 a70452a76a90335a7a1fffced279aedb
BLAKE2b-256 7ce71d032c82d6626827679a4d0b0ba72db3f622fce89979882ee77378cde383

See more details on using hashes here.

Provenance

The following attestation bundles were made for scinumtools3-0.6.1-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.1-cp313-cp313-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for scinumtools3-0.6.1-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 86671b2d0077997aa91395bcc098d95f009a0371cb5fe548378f873d2ef9ea27
MD5 ec7350ea8da2827401200d8e206f8e9f
BLAKE2b-256 d35c4050bd25de693eae805f1e0c17273693a77d30f1353a1be630c72a94159f

See more details on using hashes here.

Provenance

The following attestation bundles were made for scinumtools3-0.6.1-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.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for scinumtools3-0.6.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c3368bd7e9b2cf42bdc3632a1d9429a152451efd5491293ffb4a16ec8ea6913e
MD5 c093a9733235f3da177886cfaaa52d91
BLAKE2b-256 30e21a871a3a64a70e7862ede961a18dfd5ce988f2c6999ae3f5733ce8fa0de1

See more details on using hashes here.

Provenance

The following attestation bundles were made for scinumtools3-0.6.1-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.1-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for scinumtools3-0.6.1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d959f0a101cabe2336a72dc615c374563485808885e71c21c88ab4cbd81e8e38
MD5 9931b6befa5d13f8dba3f6743095655b
BLAKE2b-256 a7c03b676084a4e71a2214f2989cf59b91d0a7042ed135324ab801b2d9af9c5f

See more details on using hashes here.

Provenance

The following attestation bundles were made for scinumtools3-0.6.1-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.1-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for scinumtools3-0.6.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 aeff6e61ef536f995fdb61ae332a1b45799f3d93d81275d8dc37718a9554d31d
MD5 02ebf2f850b659b5f4d3ff9700c8fc47
BLAKE2b-256 533e0adb390a6221eb824f987bedc56dc210c72ceb1d204d8acaac02ff7f5ed3

See more details on using hashes here.

Provenance

The following attestation bundles were made for scinumtools3-0.6.1-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.1-cp312-cp312-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for scinumtools3-0.6.1-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 50aae1e8aa1579330d24eddefc7205fed72b63a573409fda138cb8d929d6e8e3
MD5 859c7087e1421ccc620b0fc10e2c5c9f
BLAKE2b-256 d851cbf44397c07de916e538ea9b8bcfd8ba4c91b5209e8b463344534838d1c7

See more details on using hashes here.

Provenance

The following attestation bundles were made for scinumtools3-0.6.1-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.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for scinumtools3-0.6.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9fa532047bb62d9a9971d3d00129f960c6dd229dfc63f74be92d0c70644b25bb
MD5 2541b340afa9db24dbdd7b28c539d251
BLAKE2b-256 a15f4b991f5667d51aa412326170f8dc0d540053390cb57a52487a5a6c7997a3

See more details on using hashes here.

Provenance

The following attestation bundles were made for scinumtools3-0.6.1-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.1-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for scinumtools3-0.6.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0c21b25dcfb26cb2670f4b4b8604abd8f888684accc38f9847bc2013723584db
MD5 1ec7cbabf19e23b07edda47e380ba8d6
BLAKE2b-256 b7295e45f5b33496a6ec2135ed650c04c79794e77cba8c005d845ec6d8148dee

See more details on using hashes here.

Provenance

The following attestation bundles were made for scinumtools3-0.6.1-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.1-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for scinumtools3-0.6.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 27ea762ff8df2f78e9a351dd951d6273251cddfa8116fa01b9a18cea17aec4a0
MD5 9330578854aa83e2cef6e91a40e27d48
BLAKE2b-256 2b0c837c788d9779b709cde33d0c1843d9a12fb946141532fdc68677a30c6a3f

See more details on using hashes here.

Provenance

The following attestation bundles were made for scinumtools3-0.6.1-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.1-cp311-cp311-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for scinumtools3-0.6.1-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 dffb5171c1fe8e320cfe624eddc60e35a75c38a1e2704b806a70a6c2a0fdd254
MD5 a1d9337e0c04d01c8215eabbbdef41f3
BLAKE2b-256 8ed7110f7d5e539d72519950887a97bbfc7720c2c165e348d3c1d3828a78041c

See more details on using hashes here.

Provenance

The following attestation bundles were made for scinumtools3-0.6.1-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.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for scinumtools3-0.6.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 bc9db3ced0dd85976943e8887dc94a28c71e74ce8fc70599d80dde1b09f2b149
MD5 32e351211f10651b5989cb9e838a5589
BLAKE2b-256 a1c20a4fe450a3531dc4197c5db01097140ece63b4a2ad25d4de8fbe03704b02

See more details on using hashes here.

Provenance

The following attestation bundles were made for scinumtools3-0.6.1-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.1-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for scinumtools3-0.6.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 21049e504b6f6974247cd1baa97c9b96eae33b404efe6de2c93f784eeb05a92d
MD5 1967263875a4b77915b0c5c6270f644e
BLAKE2b-256 93b74409d2645496c6b9f42f3944af00fe51cf698467de03b247bafdaa4934c9

See more details on using hashes here.

Provenance

The following attestation bundles were made for scinumtools3-0.6.1-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