Skip to content

(minor bug) learner.choose_points gives wrong number of points in one very particular case #84

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

Closed
basnijholt opened this issue Dec 19, 2018 · 1 comment

Comments

@basnijholt
Copy link
Member

(original issue on GitLab)

opened by Jorn Hoofwijk (@Jorn) at 2018-04-18T13:17:25.768Z

I think this would almost never cause issues and would be easy to solve, it's just a bit odd.

The case is if you first request 1 point, and then 2 points, it will give you one point back in the second case.
The case where this happens is so specific I do not believe it would cause any trouble in the real world. But it would also be easy to solve, so might be worth the time.

import adaptive


def f(x):
    return x


learner = adaptive.Learner1D(f, bounds=(-5, 5))

print(learner.choose_points(1))
print(learner.choose_points(2))

# results in: 
# ([-5], [inf])
# ([5], [inf, inf])
# while we expect:
# ([-5], [inf])
# ([5, 0], [inf, inf])
@basnijholt
Copy link
Member Author

originally posted by Bas Nijholt (@basnijholt) at 2018-04-18T13:35:12.954Z on GitLab

Nice catch, probably has an easy solution.

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

No branches or pull requests

1 participant