Skip to content

Commit

Permalink
[MegaLinter] Apply linters fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianPfaff authored and megalinter-bot committed Sep 6, 2023
1 parent 03bdbc8 commit f783623
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
7 changes: 5 additions & 2 deletions pyrecest/evaluation/determine_all_deviations.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import numpy as np
import warnings

import numpy as np


def determine_all_deviations(
results,
Expand All @@ -23,7 +24,9 @@ def determine_all_deviations(
if "last_filter_states" not in result_curr_config:
final_estimate = result_curr_config["last_estimates"][run]
elif callable(extract_mean):
final_estimate = extract_mean(result_curr_config["last_filter_states"][run])
final_estimate = extract_mean(
result_curr_config["last_filter_states"][run]
)
else:
raise ValueError("No compatible mean extraction function given.")

Expand Down
8 changes: 5 additions & 3 deletions pyrecest/tests/test_evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def test_generate_meas_R2(self):
def test_determine_all_deviations(self):
def dummy_extract_mean(x):
return x

def dummy_distance_function(x, y):
return np.linalg.norm(x - y)

Expand Down Expand Up @@ -91,11 +91,13 @@ def dummy_distance_function(x, y):
# Validate some of the results
np.testing.assert_allclose(
# Should be zeros as the lastEstimates match groundtruths
all_deviations[0], [0, 0]
all_deviations[0],
[0, 0],
)
np.testing.assert_allclose(
# Should be np.sqrt(2) away from groundtruths
all_deviations[1], [np.sqrt(3), np.sqrt(3)]
all_deviations[1],
[np.sqrt(3), np.sqrt(3)],
)

def test_configure_kf(self):
Expand Down

0 comments on commit f783623

Please sign in to comment.