MachineLearningLifeScience / poli

A library of discrete objectives
MIT License
13 stars 1 forks source link

Implements a new interface for `create` #161

Closed miguelgondu closed 7 months ago

miguelgondu commented 7 months ago

Main change

Previously, create returned 5 elements (of which usually a single one was relevant: f). For example:

from poli import create

problem_info, f, x0, y0, run_info = create(name="white_noise)

Of these, problem_info was already inside the black box as f.info, and run_info was only relevant when an observer was passed.

This PR modifies the interface such that create returns only f, x0, y0. The run_info is now stored as f.observer_info. Backwards compatibility can be achieved by running:

from poli import create

# Creation of f with observer
f, x0, y0 = create(name="white_noise, observer=...)

problem_info, run_info = f.info, f.observer_info

Other changes

I changed the names of some kwargs to make them more transparent: now caller_info is called observer_init_info