Skip to content

Releases: mjuez/baycomp_plotting

v1.2.1

04 May 15:45
v1.2.1
35fa9bf

Choose a tag to compare

Bug fixes

Two bugs in dens() surfaced while diagnosing a confusing LOOCV plot reported by a user.

dens() now honours p.rope for the ROPE axvlines

Before, the orange ROPE lines were drawn at hardcoded ±0.01 regardless of the rope parameter passed to CorrelatedTTest. If you used a non-conventional rope (e.g. 0.001 or 0.05), the lines on screen did not match the rope used by the test — silently misleading. They now sit at exactly ±p.rope.

dens() now fails loudly on degenerate posteriors

Before, calling dens() on a posterior with var = 0 (typical when the two input score arrays are identical) produced an unhelpful ValueError: Axis limits cannot be NaN or Inf from inside matplotlib. It now raises an explicit ValueError describing the cause.

```python
ValueError: Cannot draw density: posterior variance is np.float64(0.0).
The two classifiers likely produced identical scores;
the posterior is degenerate and has no density to plot.
```

The check covers var = 0, var < 0, and var = NaN.

Compatibility

  • No public API changes. Color, dens, tern keep the same signatures.
  • The fix is a no-op for callers using the default rope=0.01.
  • New behaviour is strictly an improvement: correct visual output for non-default ropes, clear error message for degenerate posteriors.

Tests

Four new tests added to the suite (now 23/23):

  • Parametrised over rope ∈ {0.001, 0.01, 0.05}, asserts the two ROPE axvlines fall at exactly ±rope.
  • Asserts ValueError with "degenerate" in the message when the posterior has var=0.

Install

```
pip install -U baycomp_plotting
```

Full diff: v1.2.0...v1.2.1

v1.2.0

02 May 17:16
v1.2.0
2576297

Choose a tag to compare

Highlights

  • Fixes the dependency-resolver failure on Python 3.10+. The strict == pins on numpy, scipy, matplotlib and iteround are gone; runtime deps are now declared with lower bounds only (matplotlib>=3.5, numpy>=1.21, scipy>=1.7). pip install baycomp_plotting now resolves cleanly on Python 3.9 through 3.13 with modern numpy 2.x.
  • No public API changes. Color, dens, tern keep the same signatures and behaviour; existing code continues to work on pip install -U baycomp_plotting.
  • New baycomp_plotting.__version__ attribute.

Internal modernisation

  • Migrated from setup.py to PEP 621 pyproject.toml (hatchling backend).
  • Moved package to src/ layout.
  • Dropped iteround as a runtime dependency (largest-remainder rounding inlined).
  • Refactored _add_posterior out of nested closure scope; minor code cleanup.

Quality and CI

  • New pytest suite (19 tests) covering pure helpers + image-regression of dens / tern via pytest-mpl.
  • Strict deprecation/future-warning filters in pyproject.toml to catch future upstream breakage early.
  • GitHub Actions matrix: Python 3.9 / 3.10 / 3.11 / 3.12 / 3.13 on Ubuntu, plus macOS and Windows on 3.12. Weekly cron run flags upstream regressions.
  • Release workflow with PyPI / TestPyPI trusted publishing.

Compatibility

Tested with numpy 2.4, scipy 1.17, matplotlib 3.10 on Python 3.13 — and across the full matrix in CI.

Install

pip install -U baycomp_plotting

Full diff: v1_1_1...v1.2.0

1.1.1

16 Mar 13:07

Choose a tag to compare

Bugfixes release.
Solved #1.

1.1

08 Feb 11:54

Choose a tag to compare

1.1

Added names param to tern function.

1.0

04 Nov 15:06

Choose a tag to compare

1.0

first stable version

0.1 alpha

03 Nov 09:53

Choose a tag to compare

First release for testing purposes