From 982a2c2270361bbd69267be28331634d34bfb9a1 Mon Sep 17 00:00:00 2001 From: John Gerrard Holland Date: Fri, 25 Aug 2023 17:01:09 +0200 Subject: [PATCH] refactor: rename experiment_runner_on_state from state_fn_from_x_to_xy_fn_df --- src/autora/state.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/autora/state.py b/src/autora/state.py index c50cc566..ab25baac 100644 --- a/src/autora/state.py +++ b/src/autora/state.py @@ -1319,7 +1319,7 @@ def theorist( return theorist -def state_fn_from_x_to_xy_fn_df(f: Callable[[X], XY]) -> StateFunction: +def experiment_runner_on_state(f: Callable[[X], XY]) -> StateFunction: """Wrapper for experiment_runner of the form $f(x) \rarrow (x,y)$, where `f` returns both $x$ and $y$ values in a complete dataframe. @@ -1335,7 +1335,7 @@ def state_fn_from_x_to_xy_fn_df(f: Callable[[X], XY]) -> StateFunction: ... return result We apply the wrapped function to `s` and look at the returned experiment_data: - >>> state_fn_from_x_to_xy_fn_df(x_to_xy_fn)(s).experiment_data + >>> experiment_runner_on_state(x_to_xy_fn)(s).experiment_data x y 0 1 3 1 2 5 @@ -1348,7 +1348,7 @@ def state_fn_from_x_to_xy_fn_df(f: Callable[[X], XY]) -> StateFunction: With the relevant variables as conditions: >>> t = StandardState(conditions=pd.DataFrame({"x0": [1, 2, 3], "x1": [10, 20, 30]})) - >>> state_fn_from_x_to_xy_fn_df(xs_to_xy_fn)(t).experiment_data + >>> experiment_runner_on_state(xs_to_xy_fn)(t).experiment_data x0 x1 y 0 1 10 11 1 2 20 22