Repository navigation
fix(metad): infer responses from accuracy in count_trials - #108
Merged
lenarddome merged 4 commits intoNov 11, 2026
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e, name participant (#106) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lenarddome
deleted the
106-count_trials-doesnt-infer-responses-from-accuracy
branch
November 11, 2026 11:15
This was referenced Nov 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #106.
Changes
count_trialsignored accuracy. When the responses column was missing,count_trialsreturned all-zero counts without an error, even though the docstring says it infers responses from accuracy.responsesstayed the column-name string"Responses", the loop went through its characters, and every trial was filtered out.ValueErrorgiving the number of trials and their positions.EstimatorMetaDadds the participant to the error.datadefaulted to thepd.DataFrameclass instead ofNone, so passing arrays always raised.count_trialsnow:data, the padding default and typos, and added a Raises section.[Unreleased].Compatibility
load_metacognition_data(), and that dataset has no trials where responses and accuracy disagree.synthetic_dataintest/applications/test_signal_detection.pyhad a row withsignal=1, response=1, accuracy=0, which the new check rejects, so that accuracy is now 1. The regression pickle is unchanged and still matches.Tests
test/utils/test_metad.pyhas 18 tests, andtest_signal_detection.pyadds one for the participant name in the error.Release
cpm/__version__.py) and dates its CHANGELOG section. After merging, tag0.26.1.python -m buildandtwine checkpass for the sdist and wheel.🤖 Generated with Claude Code