Skip to content

v0.3.11

Latest

Choose a tag to compare

@jyangch jyangch released this 06 May 06:48
· 34 commits to main since this release

bayspec 0.3.11 Changelog

Release Date: 2026-05-06
Previous Release: 0.3.10 (2026-04-27)


✨ Features

  • Memoization Fingerprinting — Implement fingerprinting for memoization cache keys to enable robust caching of model evaluations across different parameter and data configurations. Improves inference performance for repeated evaluations.

🔧 Refactoring

Caching System

  • Cache Attribute Convention — Update cached_property implementation to use single underscore (_cache_*) prefix for cache attributes per Python private-member conventions.
  • Documentation Enhancement — Expand docstrings for cached_property descriptor explaining fingerprinting strategy, cache invalidation, and usage patterns.

Code Quality

  • Format & Linting — Apply ruff formatting across the entire bayspec/ codebase (29 files):
    • Standardize quote styles, import ordering, and line wrapping
    • Fix ambiguous Unicode punctuation (en/em dashes → ASCII)
    • Resolve mutable default arguments (tuples for constants, MappingProxyType for dicts)
    • Add explicit exception chaining (raise ... from None/err)
    • Convert legacy format strings to f-strings
    • Enforce canonical Google-style docstring section titles (Example: not Typical usage:)
    • Inject __doc__ into dynamically-synthesized XSPEC/astromodels bridge classes

Python 3.8+ Compatibility

  • Add from __future__ import annotations to bayspec/util/corner.py to support PEP 604 type hints (X | None) on Python 3.8–3.9.

📝 Documentation

  • Updated Example Files — Re-run all Jupyter notebook examples (quickstart, advancement, intermediate, etc.) with new fingerprinting logic; binary outputs and statistical results regenerated.
  • Configuration — Add pyproject.toml with ruff linter configuration (py312 target, code quality rules UP/B/SIM/RUF enabled).

🐛 Bug Fixes

  • Mutable Default Fixes — Eliminate shared mutable default values in Response / Spectrum / BalrogResponse constructors; each instance now gets a fresh Par() object (fixes latent identity-based comparison bugs).
  • Exception Handling — Improve exception chaining clarity in model/data property getters; replace bare except: with except Exception: in emcee integration to allow proper KeyboardInterrupt propagation.
  • Resource Cleanup — Consolidate nested file-open context managers for proper resource cleanup on exceptions.

📦 Dependencies & Build

  • Target Python: py312 (ruff minimum); python_requires='>=3.8' maintained (3.8/3.9 compat via __future__ imports).
  • Ruff Linting: Enabled rules E W F I UP B SIM RUF; ignore RUF001/002/003 (allowed-confusables whitelist for physics units).

Summary

0.3.11 is a maintenance + quality release focused on caching robustness, code standardization, and docstring/configuration completeness per the project's v1.2 docstring standard. No breaking API changes. All user-facing behavior is preserved; improvements are internal code quality and example reproducibility.