Skip to content

Commit

Permalink
Changes from black
Browse files Browse the repository at this point in the history
  • Loading branch information
danielandresarcones committed Aug 28, 2024
1 parent 23e0bec commit f623cc3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion probeye/inference/scipy/solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion probeye/subroutines.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand All @@ -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)


Expand Down

0 comments on commit f623cc3

Please sign in to comment.