From f623cc36d703bfaa3b8032ceb34f5ef0724fd129 Mon Sep 17 00:00:00 2001 From: darcones Date: Wed, 28 Aug 2024 09:40:01 +0200 Subject: [PATCH] Changes from black --- probeye/inference/scipy/solver.py | 2 +- probeye/subroutines.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/probeye/inference/scipy/solver.py b/probeye/inference/scipy/solver.py index 03b191f8..d82f922f 100644 --- a/probeye/inference/scipy/solver.py +++ b/probeye/inference/scipy/solver.py @@ -156,7 +156,7 @@ def evaluate_model_response( prms_model = self.problem.get_parameters(theta, forward_model.prms_def) exp_inp = forward_model.input_from_experiments[experiment_name] inp = {**exp_inp, **prms_model} # adds the two dictionaries - inp["experiment_name"] = experiment_name # add the experiment name to the input + inp["experiment_name"] = experiment_name # add the experiment name to the input # evaluate the forward model and translate the result to a single vector model_response_dict = forward_model(inp) model_response_vector = vectorize_numpy_dict(model_response_dict) diff --git a/probeye/subroutines.py b/probeye/subroutines.py index d3cce7b0..e81e85f0 100644 --- a/probeye/subroutines.py +++ b/probeye/subroutines.py @@ -1095,6 +1095,7 @@ def vectorize_numpy_dict(numpy_dict: dict) -> np.ndarray: idx_start = idx_end return vector + def vectorize_nd_numpy_dict(numpy_dict: dict) -> np.ndarray: """ Concatenates all vectors from a dict to a single vector and returns it. For example @@ -1124,6 +1125,7 @@ def vectorize_nd_numpy_dict(numpy_dict: dict) -> np.ndarray: idx_start = idx_end return vector + def vectorize_tuple_pce_dict(pce_dict: dict) -> list[tuple]: """ Unpacks the tuple for the PCE expansion of each variable in a dict. @@ -1143,7 +1145,7 @@ def vectorize_tuple_pce_dict(pce_dict: dict) -> list[tuple]: dist = pce_dict.pop("dist") else: dist = None - + return ([pce_tuple for pce_tuple in pce_dict.values()], dist)