Skip to content

fix(metad): correct bin_ratings docstring, name every rule in count_trials error (#107) - #109

Merged
lenarddome merged 1 commit into
mainfrom
107-docstring-bug-data-consistency-check-count_trials
Nov 12, 2026
Merged

lenarddome merged 1 commit into
mainfrom
107-docstring-bug-data-consistency-check-count_trials

Conversation

@lenarddome

@lenarddome lenarddome commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

Follow-up to #107. The count_trials docstring itself was already fixed in #108; this PR brings the related error message in line with it, and fixes the bin_ratings docstring, whose example no longer ran.

Changes

count_trials

  • The "no valid trials" error now names every rule from the Notes section: accuracy must be 0 or 1 when given, and confidence must be a whole number in [1, nRatings].
  • New test: test_no_valid_trials_message_names_every_rule.

bin_ratings (docstring only, no behaviour change)

  • rebin and binCount are documented as one-element lists ([0]/[1], [n]), matching the code since 9a3a44d.
  • binCount is the number of trials in the highest bin, not the number of bins.
  • The key is confBins, not confbins; the rebinned shapes are described.
  • verbose prints a message rather than returning warnings.
  • Example rewritten to unpack the result so its output matches numpy 2; typos fixed.

CHANGELOG.md has both under Unreleased.

Testing

  • python -m doctest cpm/utils/metad.py: passes (the bin_ratings example failed before).
  • python -m pytest -q: 791 passed.

🤖 Generated with Claude Code

…rials error (#107)

bin_ratings: document that `rebin` and `binCount` are one-element lists
and that `binCount` is the number of trials in the highest bin, fix the
`confBins` key name and the `verbose` description, and rewrite the
example so it runs.

count_trials: the "no valid trials" error now names the accuracy and
whole-number confidence rules, matching the Notes section.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lenarddome lenarddome linked an issue Nov 11, 2026 that may be closed by this pull request
@lenarddome
lenarddome merged commit 999be5a into main Nov 12, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docstring bug: data consistency check (count_trials)

1 participant