8000 CheckpointStepper gives bad steps without `stop=` · Issue #6 · usnistgov/steppyngstounes · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

CheckpointStepper gives bad steps without stop= #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
guyer opened this issue Dec 10, 2021 · 2 comments
Open

CheckpointStepper gives bad steps without stop= #6

guyer opened this issue Dec 10, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@guyer
Copy link
Member
guyer commented Dec 10, 2021
from steppyngstounes import CheckpointStepper

for step in CheckpointStepper(start=0., stops=[1.414, 2.718, 3.142]):
    print(f"{step.begin} + {step.size} = {step.end}")
    _ = step.succeeded()

prints

0.0 + inf = inf

whereas

for step in CheckpointStepper(start=0., stops=[1.414, 2.718, 3.142], stop=4.):
    print(f"{step.begin} + {step.size} = {step.end}")
    _ = step.succeeded()

prints

0.0 + 1.414 = 1.414
1.414 + 1.304 = 2.718
2.718 + 0.42399999999999993 = 3.142
@guyer guyer added the bug Something isn't working label Dec 10, 2021
@guyer
Copy link
Member Author
guyer commented Dec 10, 2021

The problem is here, where end is np.inf by default (to not limit the stepper other than by the checkpoints).

@guyer
Copy link
Member Author
guyer commented Dec 10, 2021

While fixing this, rename stops= to checkpoints= (with deprecation)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant
0