Skip to main content

Test field for pre-release package evaluation

Project description

BigDog

Introduction

BigDog is a robust Python package designed for high-precision scientific computing involving numerical values with asymmetric uncertainties and physical units.

Unlike traditional error propagation, BigDog employs a sampling-based approach (Monte Carlo distribution modeling). By representing uncertainties as large sequences of sample values, it inherently captures correlations during mathematical operations and supports non-normal distributions. It is fundamentally built upon astropy.uncertainty and astropy.units, extending them with intuitive interfaces and advanced convenience features.

Key Features

  • ValueU: A core class for handling values with symmetric or asymmetric uncertainties using sample distributions.
  • QuantityU: An upper-compatible extension of ValueU that integrates Astropy unit control.
  • Advanced Sampling Engine: Transitioned from theoretical models to approximate sampling (Aug 2025) for more realistic error modeling.
  • Intuitive Comparisons: Supports multiple comparison modes: central, conservative (3σ), and permissive (1σ).
  • Domain Enforcement: Methods like .enforced_positive() and .enforced_negative() for physical consistency.
  • Built-in Help System: Access detailed, formatted documentation directly via .help() on any instance.

Installation

BigDog is currently in the alpha stage. You can install it via pip:

pip install bigdog

Dependencies

  • Python: 3.8+ (Recommended)
  • Libraries: numpy>=1.23.2, scipy>=1.9.2, astropy

Quick Start

1. Basic Declaration

from bigdog import ValueU, QuantityU
import astropy.units as u

# Value with symmetric uncertainty
v1 = ValueU(center=15, std=3)

# Value with asymmetric uncertainty and units
q1 = QuantityU(center=72 * u.m, std=(-3, +12))

2. Mathematical Operations

Operations are performed element-wise across the sampled distribution:

q2 = QuantityU(800 * u.cm, (-400, +500))
result = q1 + q2
print(result) # Automatically handles unit conversion and uncertainty propagation

3. Comparison Modes

Since distributions aren't simple scalars, you can define how to compare them:

# Set to conservative mode (True if 99.73% of samples satisfy the condition)
if q1.set_comparison_mode(conservative=True) > q2.set_comparison_mode(conservative=True):
    print("q1 is strictly greater than q2")

Documentation

For comprehensive details on object creation, mathematical operations, unit decomposition, and formatting, use the built-in help function:

ValueU().help()     # Detailed guide for ValueU
QuantityU().help()  # Detailed guide for QuantityU

Technical Notes & Disclaimer

  • Memory Management: High n_samples (default: 10,000) can lead to significant memory consumption.
  • Independence Assumption: While the sampling captures existing correlations, initial instances are generated assuming independent variables (zero covariance).
  • Type Casting: Use caution when casting to integers (.astype(int)) if the distribution contains NaN values, as this may lead to silent data distortion.

Credits

Changelog

v1.2609.01-alpha (2026-02-24)

  • General Validation: Completed general validation and synchronized help() explanations.
  • Engine Upgrade: Full transition to property-based lightweight value objects and approximate sampling.
  • Domain Constraints: Implemented auxiliary methods for sampled distribution computation and sign enforcement.

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

bigdog-1.2609.1a0.tar.gz (45.4 kB view details)

Uploaded Source

Built Distribution

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

bigdog-1.2609.1a0-py3-none-any.whl (46.0 kB view details)

Uploaded Python 3

File details

Details for the file bigdog-1.2609.1a0.tar.gz.

File metadata

  • Download URL: bigdog-1.2609.1a0.tar.gz
  • Upload date:
  • Size: 45.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.21

File hashes

Hashes for bigdog-1.2609.1a0.tar.gz
Algorithm Hash digest
SHA256 a8bfba319772d3b84aa1f6e00a5badc70095f0bbe0904788b5f8862d9f2e5a9f
MD5 44fd9d699391d9740b46ed20162e398b
BLAKE2b-256 6e74f5a5833fb812e3a0390f27c9bcf67cd608c160fc4782746fc8dfd726c739

See more details on using hashes here.

File details

Details for the file bigdog-1.2609.1a0-py3-none-any.whl.

File metadata

  • Download URL: bigdog-1.2609.1a0-py3-none-any.whl
  • Upload date:
  • Size: 46.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.21

File hashes

Hashes for bigdog-1.2609.1a0-py3-none-any.whl
Algorithm Hash digest
SHA256 5c68d5db92f331bf90e43d85cfb2fd42948aa174ee0f96a7bb2de789310cc004
MD5 489fc86b0a3c2337acd634eb50c97da2
BLAKE2b-256 05bc39eb9e39b4b57e70bcf0ead7af9590b91a2a29521f09938dcec56272ca6e

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