Skip to content

Fix PlaySlider precision and add values property#180

Merged
koaning merged 1 commit intomainfrom
koaning/check-playslider-dep
Mar 24, 2026
Merged

Fix PlaySlider precision and add values property#180
koaning merged 1 commit intomainfrom
koaning/check-playslider-dep

Conversation

@koaning
Copy link
Copy Markdown
Owner

@koaning koaning commented Mar 24, 2026

Summary

  • Fix floating-point rounding artifacts in PlaySlider (e.g., 0.30000000000000004 with step=0.1) by rounding snapped values to the step's decimal precision in both JS frontend and Python backend.
  • Add a values property that returns all discrete values in the range, so users can pre-cache downstream computations before hitting play.
  • Bump version to 0.2.40 and update the demo pin from 0.2.37 to 0.2.40 (fixes MoLab loading).

Test plan

  • uv run python -c "from wigglystuff import PlaySlider; s = PlaySlider(min_value=0, max_value=1, step=0.1); print(s.values)" returns clean [0.0, 0.1, ..., 1.0]
  • Open demos/play_slider.py in marimo, set step=0.1, confirm no rounding artifacts in label or Python value
  • Verify auto-advance with loop=True produces clean values throughout

🤖 Generated with Claude Code

Fix floating-point rounding artifacts in PlaySlider by rounding snapped
values to the step's decimal precision in both JS and Python. Add a
`values` property that returns all discrete values in the range. Bump
version to 0.2.40 and update demo pin.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@koaning koaning merged commit a9bc06a into main Mar 24, 2026
2 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.

1 participant