Skip to content

Commit

Permalink
fix PEP formatting in test_general_optimization.py
Browse files Browse the repository at this point in the history
  • Loading branch information
carolinafernandezp committed Aug 31, 2023
1 parent 7df94ea commit 4a56279
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions hnn_core/tests/test_general_optimization.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,13 @@ def set_params(net_offset, params):

# the optimized parameter is in the range
for param_idx, param in enumerate(optim.opt_params_):
assert list(constraints.values())[param_idx][0] \
<= param \
<= list(constraints.values())[param_idx][1], \
"Optimized parameter is not in user-defined range"
assert (list(constraints.values())[param_idx][0] <= param <=
list(constraints.values())[param_idx][1]), (
"Optimized parameter is not in user-defined range")

obj = optim.obj_
# the number of returned rmse values should be the same as max_iter
assert len(obj) <= max_iter, \
"Number of rmse values should be the same as max_iter"
assert (len(obj) <= max_iter), (
"Number of rmse values should be the same as max_iter")
# the returned rmse values should be positive
assert all(vals >= 0 for vals in obj), "rmse values should be positive"

0 comments on commit 4a56279

Please sign in to comment.