pybmc: A General Bayesian Model Combination Package
pybmc is a Python package for performing Bayesian Model Combination (BMC) on various predictive models. It provides tools for data handling, orthogonalization, Gibbs sampling, and prediction with uncertainty quantification. The model combination methodology follows this paper by Giuliani et al.
Features
- Data Management: Load and preprocess nuclear mass data from HDF5 and CSV files
- Orthogonalization: Transform model predictions using Singular Value Decomposition (SVD)
- Bayesian Inference: Perform Gibbs sampling for model combination
- Uncertainty Quantification: Generate predictions with credible intervals
- Heteroscedastic Error Models: Let the predictive variance grow with the distance from the training region and/or the disagreement among models
- Model Evaluation: Calculate coverage statistics and calibration diagnostics for model validation
Installation
pip install pybmc
Quick Start
For a detailed walkthrough of how to use the package, please see the Usage Guide.
Development and Testing
This project uses Poetry for dependency management and packaging. Poetry is not required for regular users who install via pip install pybmc, but is needed for development and testing.
Running Tests
If you want to run the test suite:
Option 1: Using Poetry (recommended for development)
# Install Poetry if you don't have it
pip install poetry
# Install the package with dev dependencies
poetry install
# Run tests
poetry run pytest
# Run tests with coverage
poetry run pytest --cov=pybmc
Option 2: Using pytest directly
# Install pytest and other test dependencies
pip install pytest pytest-cov
# Run tests
pytest
# Run tests with coverage
pytest --cov=pybmc
For more information on contributing and development workflows, see our Contribution Guidelines.
Documentation
Comprehensive documentation is available at https://ascsn.github.io/pybmc/, including:
Contributing
We welcome contributions! Please see our Contribution Guidelines for details on how to contribute to the project.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Citation
If you use pybmc in your research, please cite:
@software{pybmc,
title = {pybmc: Bayesian Model Combination},
author = {Kyle Godbey and Troy Dasher and Pablo Giuliani and An Le},
year = {2025},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/ascsn/pybmc}}
}
Support
For questions or support, please open an issue on our GitHub repository.
Metadata
Release files for pybmc 0.4.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pybmc-0.4.1.tar.gz | 10.5 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pybmc-0.4.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 20.9 MB
Release files / pybmc-0.4.1.tar.gz
| Download URL | pybmc-0.4.1.tar.gz |
|---|---|
| Size | 10.5 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1f61cfbd8a6a1fc7b1a5ee5d728eef40a6446ef0b934137bb423c018053c517d
|
|
BLAKE2b-256 checksum How to use checksums |
4cd0aa7abc64a152157ddfcfb5b4d88163ce81ec0ba53e61a8bd17cb02ed78f0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.4.1 CPython/3.12.3 Linux/6.17.0-1022-azure
|
Release files / pybmc-0.4.1-py3-none-any.whl
| Download URL | pybmc-0.4.1-py3-none-any.whl |
|---|---|
| Size | 10.5 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
563854bedfc12c90176664788abb784455c95f1150a78fbc5211a66a98d160d9
|
|
BLAKE2b-256 checksum How to use checksums |
7752913245cc9b8c07f874d4b508ee5519419c5e9064c36c4434d0afeaa820b4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.4.1 CPython/3.12.3 Linux/6.17.0-1022-azure
|