diff --git a/smash/core/simulation/_standardize.py b/smash/core/simulation/_standardize.py index 2562c049..83c57bf1 100644 --- a/smash/core/simulation/_standardize.py +++ b/smash/core/simulation/_standardize.py @@ -206,7 +206,7 @@ def _standardize_simulation_optimize_options_bounds( f"Choices: {parameters}" ) else: - TypeError("bounds optimize_options must be a dictionary") + raise TypeError("bounds optimize_options must be a dictionary") parameters_bounds = dict( **model.get_rr_parameters_bounds(), @@ -269,7 +269,7 @@ def _standardize_simulation_optimize_options_control_tfm( f"Choices: {F90_OPTIMIZER_CONTROL_TFM[optimizer]}" ) else: - TypeError("control_tfm optimize_options must be a str") + raise TypeError("control_tfm optimize_options must be a str") return control_tfm diff --git a/smash/io/handler/_hdf5_handler.py b/smash/io/handler/_hdf5_handler.py index ac15a723..c7614166 100644 --- a/smash/io/handler/_hdf5_handler.py +++ b/smash/io/handler/_hdf5_handler.py @@ -148,8 +148,7 @@ def _load_hdf5_to_dict(h5: h5py.File | h5py.Group) -> dict[str, Any]: elif isinstance(value, h5py.Dataset): dct[key] = _load_hdf5_dataset_to_npndarray(value) - for key, value in h5.attrs.items(): - dct[key] = value + dct.update(dict(h5.attrs.items())) return dct diff --git a/smash/tests/core/simulation/test_bayesian_optimize.py b/smash/tests/core/simulation/test_bayesian_optimize.py index 9580b0df..92089ad9 100644 --- a/smash/tests/core/simulation/test_bayesian_optimize.py +++ b/smash/tests/core/simulation/test_bayesian_optimize.py @@ -72,8 +72,8 @@ def generic_custom_bayesian_optimize(model: smash.Model, **kwargs) -> dict: }, ] - for i, kwargs in enumerate(custom_sets): - instance = smash.bayesian_optimize(model, **kwargs) + for i, inner_kwargs in enumerate(custom_sets): + instance = smash.bayesian_optimize(model, **inner_kwargs) qsim = instance.response.q[:].flatten() qsim = qsim[::10] # extract values at every 10th position diff --git a/smash/tests/core/simulation/test_optimize.py b/smash/tests/core/simulation/test_optimize.py index df876711..343ba910 100644 --- a/smash/tests/core/simulation/test_optimize.py +++ b/smash/tests/core/simulation/test_optimize.py @@ -220,8 +220,8 @@ def generic_custom_optimize(model: smash.Model, **kwargs) -> dict: }, ] - for i, kwargs in enumerate(custom_sets): - instance = smash.optimize(model, **kwargs) + for i, inner_kwargs in enumerate(custom_sets): + instance = smash.optimize(model, **inner_kwargs) qsim = instance.response.q[:].flatten() qsim = qsim[::10] # extract values at every 10th position