Skip to content

(refactor) learner.tell(x, None) might be renamed to learner.tell_pending(x) #73

@basnijholt

Description

@basnijholt

(original issue on GitLab)

opened by Jorn Hoofwijk (@Jorn) at 2018-07-01T13:35:58.127Z

This issue is a result of a discussion we had here: https://gitlab.kwant-project.org/qt/adaptive/merge_requests/68#note_15204

I suggested splitting learner.tell(x, value) into two functions,

  1. one with value=None: make this learner.tell_pending(x) as this method to me seems more intuitive
  2. one with value!=None: keep this the same as it was before

This change will be a breaking change to the api, however we could accept the old implementation for a certain amount of time (e.g. a few months) and raise a DeprecationWarning in the meantime.

While we're at it, we may also change some other functions,
@jbweston also suggested having learner.peek(n) instead of learner.ask(n, add_data=False). This falls in a similar category.

Other naming suggestions than learner.tell_pending and learner.peek are also welcome.

Lastly I would also really enjoy not passing real=True/False to any method, in the beginning I had a hard time understanding the code for this reason, and most functions had an if statement to check if real was True or False, so in essence it is just two functions merged into one.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions