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.2610.02 (2026-03-03)

  • 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.2610.2.tar.gz (46.0 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.2610.2-py3-none-any.whl (46.6 kB view details)

Uploaded Python 3

File details

Details for the file bigdog-1.2610.2.tar.gz.

File metadata

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

File hashes

Hashes for bigdog-1.2610.2.tar.gz
Algorithm Hash digest
SHA256 f6cd68bd9bb3c051bc64191877b4088a53aebdbfe8e5e41ca238a2f18291f69d
MD5 22563eb264f72383b45dd1e178d6906d
BLAKE2b-256 4e56353c351640abc7b480bf6ad2016731c7bcd19e2629bb327ffaa132365f85

See more details on using hashes here.

File details

Details for the file bigdog-1.2610.2-py3-none-any.whl.

File metadata

  • Download URL: bigdog-1.2610.2-py3-none-any.whl
  • Upload date:
  • Size: 46.6 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.2610.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f197b2d2cd76b033b82935ae708ebd9f7ef1c9fbd67bfb50535f11d92b54794d
MD5 6fbef1c31bd4139e5abf8a5800676532
BLAKE2b-256 1523e2fdb3548272f6a7d87d3df6b1051331935628beeb820f7c6f78c3c83219

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