SciPy-style Beta-PERT distribution for estimation and risk modeling.
Project description
PertDist
PertDist is a SciPy-style implementation of the Beta-PERT distribution.
Overview
The package exposes a PERT class with an API modeled after scipy.stats distributions. It supports scalar and array-based parameters and computes both distribution functions and descriptive statistics.
Installation
pip install pertdist
Python Version
Python >= 3.11
Support
- Supported Python:
3.11+ - Primary package index: PyPI (
pertdist)
Quick Start
from pert import PERT
dist = PERT(min_val=10, ml_val=190, max_val=200, lamb=4.0)
samples = dist.rvs(size=10_000, random_state=42)
mean = dist.mean
median = dist.median()
p90 = dist.ppf(0.90)
Implemented API
Constructor
PERT(min_val, ml_val, max_val, lamb=4.0)
Properties / Attributes
a,b,c,lambalpha,betamean,var,skew,kurtrange(property)
Methods
median()rvs(size=1, random_state=None)wheresizecan beintortuple[int, ...]pdf(x),logpdf(x)cdf(x),logcdf(x)sf(x),logsf(x)ppf(q),isf(q)interval(alpha)ci(z)stats()
Input Validation
The constructor enforces:
lamb > 0- strict ordering for each element:
min_val < ml_val < max_val - no adjacent equal values (
min_val == ml_valorml_val == max_val)
Testing
The project includes a pytest suite under tests/, including coverage for:
- initialization and validation
- distribution identities and boundary behavior
- sampling behavior and reproducibility
- vectorized inputs/outputs
median,ci, and__repr__
Run tests with:
uv run pytest -q
Development Setup
Install development dependencies:
uv sync --all-extras --dev
Run lint and tests:
uv run ruff check .
uv run pytest -q
Roadmap
- Add additional SciPy-like analogues:
momententropyfitexpectstd
Version History
See VersionHistory.md.
Contributing
- Community and core-developer contribution workflow is documented in
CONTRIBUTING.md. - Repository guardrails and policy details are defined in
AGENTS.md.
Release Process (High-Level)
- Pull requests from
release/*andhotfix/*intomainrun publish dry-run checks. - Merged
release/*/hotfix/*PRs tomaintrigger publish, tagging, release metadata, and post-release verification workflows. - Recovery actions (including yank/unyank verification with runbook guidance) are run manually when needed.
Reporting Issues
- Bug reports and feature requests: GitHub Issues
- Security-sensitive concerns can be reported privately using GitHub repository security reporting.
Repository Policy
High-level development policy summary (full details in AGENTS.md):
- GitFlow is used:
feature/* -> dev,release/*|hotfix/* -> main, with PR-based merges. - Community contributions are welcome through
feature/* -> devpull requests;release/*andhotfix/*flows are core-developer managed. - CI runs on PRs to
devandmain; release dry-runs run onrelease/*/hotfix/*PRs tomain; release publish runs after merge tomain. - Semantic Versioning is required (
MAJOR.MINOR.PATCH) and versioning must be intentional. - Some defaults are guidance (for example draft PR by default) and developer discretion is explicitly supported.
uv.lockis developer-local and is not tracked in this repository.- Functional library code is authored manually.
- AI tooling may assist with test authoring, documentation drafting/editing, GitHub Actions/workflow authoring and maintenance, and development guidance for planning/decision support.
For release notes and historical change context, see VersionHistory.md.
License
This project is licensed under the GNU GPL. See LICENSE.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pertdist-0.1.5.tar.gz.
File metadata
- Download URL: pertdist-0.1.5.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.6 {"installer":{"name":"uv","version":"0.10.6","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3dd62594a3bf61f95d74ee80f658ff3daced4a55746efbae76c670225f5550fb
|
|
| MD5 |
c206a9819a33a4d94b0e675ae346358f
|
|
| BLAKE2b-256 |
d377310740819cbf82fdcbf50448c7e74e4201f0054b12237f3f509a6ba8ff01
|
File details
Details for the file pertdist-0.1.5-py3-none-any.whl.
File metadata
- Download URL: pertdist-0.1.5-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.6 {"installer":{"name":"uv","version":"0.10.6","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ebcb9dee65eda03fa7f646b91cbdf2e123df9ee583190c6e97313bab84700bcf
|
|
| MD5 |
6ef63cc0ca5e9402c79609bf5db92584
|
|
| BLAKE2b-256 |
d9b4e863200404fa24c452ec3338289cb26a46ae64dacbd46c1ac0ce54db0c16
|