Clarify ConstantStepSize finite-interval step semantics - #764
Conversation
There was a problem hiding this comment.
Pull request overview
This PR addresses #757 by aligning Diffrax’s documentation with the current ConstantStepSize behavior on finite intervals, and adds tests to lock in both the observed step locations and the clarified wording.
Changes:
- Updates
ConstantStepSizeanddiffeqsolve(dt0=...)documentation to describe finite-interval step placement that lands exactly ont1. - Updates the getting-started guide to describe
ConstantStepSizeas fixed-step behavior on finite intervals. - Adds a regression test asserting the step timestamps for a representative finite-interval
ConstantStepSizesolve, plus a docstring-content test.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
test/test_saveat_solution.py |
Adds a regression test for finite-interval step locations and a docstring wording test. |
docs/usage/getting-started.md |
Adjusts tutorial wording to describe finite-interval fixed-step semantics. |
diffrax/_step_size_controller/constant.py |
Updates ConstantStepSize docstring to describe finite-interval behavior. |
diffrax/_integrate.py |
Updates diffeqsolve’s dt0 docstring text to match finite-interval fixed-step behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Addressed the four review comments in aad4faa. The API docstrings now give the exact target formula, the getting-started guide calls out the special first step, and the regression test computes |
Fixes #757.
This updates the finite-interval documentation for
ConstantStepSizeanddiffeqsolve(dt0=...)to match the current implementation:dt0determines the number of fixed steps viaceil((t1 - t0) / dt0)t1It also adds a regression test that locks in the current step locations for a representative finite-interval solve, plus a docstring test for the clarified wording.
Tested with:
uv run python -m pytest -q test/test_saveat_solution.py