Skip to main content

stochas is a Python framework built to handle the complexity of Monte Carlo simulations, parametric studies, and probabilistic modeling.

Project description

Stochas

stochas: Smart Data Orchestration

PyPI version Python versions Tests & Release Status Coverage Ruff Pydantic v2 License Documentation GitHub Discussions PyPI Downloads

stochas is a Python framework built to handle the complexity of Monte Carlo simulations, parametric studies, and probabilistic modeling.

It provides a robust bridge between abstract statistical rules and concrete simulation data, ensuring your experiments are repeatable, traceable, and easy to manage.


Installation

Install the package via your preferred manager:

uv add stochas

or with pip:

pip install stochas

Core Features

  • Salted Seeding: Combines Global Seeds, Parameter Names, and Trial Numbers for unique but deterministic draws.
  • Numeric Mixins: Use your data containers directly in math operations (container * 5.0) without manually extracting values.
  • Nominal Support: Easily toggle between "Perfect World" (Trial 0) and "Probabilistic World" (Monte Carlo) results.
  • Pydantic Foundation: Every component is a Pydantic model, providing out-of-the-box validation and effortless JSON serialization.
  • Unit System: Declare SI, IPS, FPS, or a custom unit system once and tag distributions with unit=u.inch, sampling paths convert values automatically so your input data stays in familiar units while the simulation receives physically consistent numbers.

Why use stochas?

Managing hundreds of simulation trials can quickly become a mess of manual seeds and inconsistent data. stochas solves this by providing:

  • Repeatable Randomness: Our "Salted Seed" logic ensures that any specific trial can be perfectly recreated, even years later, by tying randomness to simple to set and store values.
  • Smart Containers: NamedValue objects behave like numbers or arrays but protect your data from accidental overwrites using a state-machine logic.
  • Physics-Ready Distributions: A wide range of built-in distributions (Normal, Truncated Normal, Log-Normal, etc.) that handle their own random number generators internally.
  • Automatic Unit Conversion: Attach a UnitDescriptor to any distribution or design variable and let StochasBase multiply the conversion factor at sampling time (without manual scaling in generator code).
  • Serialized Registries: Automatically track exactly which "rules" (Distributions) and "results" (NamedValues) were used in every trial for easy export to JSON or databases.

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

stochas-2.2.0.tar.gz (2.5 MB view details)

Uploaded Source

Built Distribution

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

stochas-2.2.0-py3-none-any.whl (42.2 kB view details)

Uploaded Python 3

File details

Details for the file stochas-2.2.0.tar.gz.

File metadata

  • Download URL: stochas-2.2.0.tar.gz
  • Upload date:
  • Size: 2.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for stochas-2.2.0.tar.gz
Algorithm Hash digest
SHA256 99de4073872bd203222e4664036136bc7f9891f3b1065c10a44112726c3d71bd
MD5 012e31a084694e16955606a585640556
BLAKE2b-256 26cdb6d05791dc8be09c6c7406e04b0be1a75d263f14520b0b3b5efdca758aaf

See more details on using hashes here.

File details

Details for the file stochas-2.2.0-py3-none-any.whl.

File metadata

  • Download URL: stochas-2.2.0-py3-none-any.whl
  • Upload date:
  • Size: 42.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for stochas-2.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3d9f06361b73f6b9914ede02c98e80e6b85ae62aadcb845f1c702316dc9afaed
MD5 1b3f2b46579da74536fbfc9ad11c5aed
BLAKE2b-256 67cf2e1a9cd5625d54895616e6d205462ef4d0fe9bb93dde384d32f999c6de61

See more details on using hashes here.

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