Skip to content

BF: clamp StairHandler intensity when step size is negative#7475

Merged
peircej merged 1 commit intopsychopy:devfrom
stephenmjerge:fix/stairhandler-negative-step
Nov 22, 2025
Merged

BF: clamp StairHandler intensity when step size is negative#7475
peircej merged 1 commit intopsychopy:devfrom
stephenmjerge:fix/stairhandler-negative-step

Conversation

@stephenmjerge
Copy link
Copy Markdown
Contributor

Fixes #7188

Summary

  • enforce StairHandler min/max clamping regardless of step direction, covering negative step sizes
  • add regression test to ensure negative stepSizes with minVal do not drop below bounds

Testing

  • python -m pytest psychopy/tests/test_data/test_StairHandlers.py::TestStairHandler::test_negative_step_clamped_to_min

@codecov
Copy link
Copy Markdown

codecov bot commented Nov 20, 2025

Codecov Report

❌ Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 48.94%. Comparing base (ca2563f) to head (159d87a).
⚠️ Report is 5 commits behind head on dev.

Additional details and impacted files
@@           Coverage Diff           @@
##              dev    #7475   +/-   ##
=======================================
  Coverage   48.94%   48.94%           
=======================================
  Files         352      352           
  Lines       64933    64936    +3     
=======================================
+ Hits        31781    31785    +4     
+ Misses      33152    33151    -1     
Components Coverage Δ
app ∅ <ø> (∅)
boilerplate ∅ <ø> (∅)
library ∅ <ø> (∅)
vm-safe library ∅ <ø> (∅)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@stephenmjerge
Copy link
Copy Markdown
Contributor Author

Thanks for reviewing! I checked the failing Ubuntu CI job and it appears
unrelated to this PR.

The failure occurs during test collection in:

psychopy/tests/test_app/conftest.py

With the following error:

pytest.PytestRemovedIn9Warning: Marks applied to fixtures have no effect

It looks related to pytest 9’s change around fixture marking rather than the
StairHandler code. My patch only touches StairHandler and its tests.

Happy to adjust anything or help with the test config if that would be useful—
just wanted to flag that the CI failure seems to be from existing test marks on
Linux rather than this bugfix.

@peircej
Copy link
Copy Markdown
Member

peircej commented Nov 20, 2025

Yes, we're seeing this across the board right now and working on the pytest update to fix it.
Thanks, we'll pull in once we've fixed the test suite 👍

@TEParsons
Copy link
Copy Markdown
Contributor

The test suite is fixed now (as of #7481) so if you pull down dev, merge in and push again tests should pass for you :)

@stephenmjerge stephenmjerge force-pushed the fix/stairhandler-negative-step branch from 533b30d to 159d87a Compare November 21, 2025 16:20
@stephenmjerge
Copy link
Copy Markdown
Contributor Author

Rebased onto latest dev (pytest fix) and re-ran targeted StairHandler test locally, pushing to rerun CI.

@peircej peircej merged commit 1ca0bbf into psychopy:dev Nov 22, 2025
6 checks passed
@stephenmjerge stephenmjerge deleted the fix/stairhandler-negative-step branch November 22, 2025 15:48
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.

[Bug]: StairHandler minVal and maxVal will be ineffective when set stepSizes to negative

3 participants