Skip to content

Returning np.nan breaks the 1D learner #145

@tlaeven

Description

@tlaeven

From commit: 4381a9e onward,
returning (a np.array of) np.nan cancels the runner.
Example code, to compare the working commit, f38d20f,
with the not working one, 4381a9e.

import adaptive
adaptive.notebook_extension()
import numpy as np
def f(x):
    if 0 < x < 1:
        return x
    else:
        return np.nan

learner = adaptive.Learner1D(f, 0.1*np.array([-1, 1]))
runner = adaptive.Runner(learner)
runner.live_info()

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