Skip to content

Commit

Permalink
fix version issue in text_dpad.py
Browse files Browse the repository at this point in the history
  • Loading branch information
shi-yu-wang authored Jun 12, 2024
1 parent c8c363a commit de1ca5c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/anomaly/test_dpad.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,16 @@ def test_full(self):
self.model.save(dirname=join(rootdir, "tmp", "dpad"))
loaded_model = DeepPointAnomalyDetector.load(dirname=join(rootdir, "tmp", "dpad"))
loaded_alarms = loaded_model.get_anomaly_label(self.test_data)
try:
n_loaded_alarms = sum(loaded_alarms.to_pd().values != 0)
except:
print("An exception occurred. Might due to version issue")

try:
n_loaded_alarms = np.sum(loaded_alarms.to_pd().values != 0)
except:
n_loaded_alarms = sum(loaded_alarms.to_pd().values != 0)
print("An exception occurred. Might due to version issue")

self.assertAlmostEqual(n_loaded_alarms, n_alarms, delta=1)

# Evaluation
Expand Down

0 comments on commit de1ca5c

Please sign in to comment.