Skip to content
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

refactor: ensure experimentalists have a consistent interface #231

Closed
hollandjg opened this issue Jan 13, 2023 · 0 comments · Fixed by AutoResearch/autora-core#33
Closed
Assignees
Labels
enhancement New feature or request. priority 1 - needed These are highly desirable to be fixed, ideally within 2 weeks.

Comments

@hollandjg
Copy link
Member

hollandjg commented Jan 13, 2023

... which can accept sequences of tuples, or arrays, or recarrays.

We encounter the problem that different theorists/experimentalists expect and produce different data formats (e.g., numpy versus pandas) and with potentially different dimensions (e.g., 1D vs. 2D numpy array). We should consider standardizing the inputs & outputs, potentially using a pandas data frame.

Perhaps put the functions from #229 into a function decorator which would look like:

@pipewrapper(needs="array")
def sampler(input: np.array):
    output = ... do something with the numpy array ...
    return output

@pipewrapper(needs="recarray")
def sampler_with_recarray(input: np.recarray):
    output = ... do something with the numpy recarray ...
    return output

@pipewrapper(needs="sequence")
def sampler_with_sequence(input: Sequence[ExperimentalConditions]):
    for i in input:
        if i ... fulfils some condition:
            yield i
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment