From 6791b1e95c1c310c1b9910c43534474b48796416 Mon Sep 17 00:00:00 2001 From: Younes Strittmatter Date: Thu, 7 Sep 2023 03:14:58 +0200 Subject: [PATCH] chore: adhere to style --- src/autora/state.py | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/src/autora/state.py b/src/autora/state.py index b4e9c88c..f6432341 100644 --- a/src/autora/state.py +++ b/src/autora/state.py @@ -1190,7 +1190,9 @@ def _f(state_: S, /, **kwargs) -> S: from_state = parameters_.intersection({i.name for i in fields(state_)}) arguments_from_state = {k: getattr(state_, k) for k in from_state} from_state_input_mapping = { - reversed_mapping.get(field.name, field.name): getattr(state_, field.name) + reversed_mapping.get(field.name, field.name): getattr( + state_, field.name + ) for field in fields(state_) if reversed_mapping.get(field.name, field.name) in parameters_ } @@ -1758,10 +1760,22 @@ def __init__(self, data: Optional[Dict] = None, **kwargs): if data is None: data = { "_metadata": { - "variables": {"default": None, "delta": "replace", "converter":VariableCollection}, - "conditions": {"default": None, "delta": "replace", "converter":pd.DataFrame}, - "experiment_data": {"default": None, "delta": "extend", "converter":pd.DataFrame}, - "models": {"default": None, "delta": "extend", "converter":list}, + "variables": { + "default": None, + "delta": "replace", + "converter": VariableCollection, + }, + "conditions": { + "default": None, + "delta": "replace", + "converter": pd.DataFrame, + }, + "experiment_data": { + "default": None, + "delta": "extend", + "converter": pd.DataFrame, + }, + "models": {"default": None, "delta": "extend", "converter": list}, }, "variables": None, "conditions": None,