Skip to content

Conversation

@JoshPaterson
Copy link
Contributor

Fixes #559.

This PR tightens tolerances as discussed in #559. It's enough to fix the particular bugs in that issue, and makes that kind of bug less likely but doesn't completely prevent it. Do you think these tolerances should be decreased more so errors are even less likely?

Ideally there would be a more thorough fix that would make those kind of bugs impossible rather than just unlikely. I'll keep thinking about it, but for now this is enough to get @bmatthiesen's scripts working.

@JoshPaterson
Copy link
Contributor Author

This test is failing at line 68:

def test_find_discrete_with_a_sub_epsilon_jag_right_at_zero():
t0, t1 = make_t()
f = make_stairstep_f([0.5, 0.5 + 0.99 * epsilon])
# We hard-code num=12, just in case the default ever changes to
# another value that might not trigger the symptom.
t, y = find_discrete(t0, t1, f, epsilon, 12)
# Note that we always return the last of several close solutions, so
# that `y` correctly reflects the new state that persists after the
# flurry of changes is complete.
assert is_close(t.tt, (0.5 + 0.99 * epsilon,))
assert list(y) == [2]

Fixing it will have to wait until tomorrow. If it's obvious to you feel free to make whatever changes are necessary.

@brandon-rhodes
Copy link
Member

Fixing it will have to wait until tomorrow. If it's obvious to you feel free to make whatever changes are necessary.

There's no problem with waiting til tomorrow! See what you can do about the test first; I'll probably first respond about broader issues before diving in to specific tests.

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.

EarthSatellite.find_events() can return culmination before rise if they are close in time

2 participants