Skip to content

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

@basnijholt

Description

@basnijholt

(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])

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions