Skip to content

Commit

Permalink
version conflicts in test_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 ab61f3c commit 8922394
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions tests/anomaly/test_dpad.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,12 @@ 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:
if sys.version_info[1] < 8:
n_loaded_alarms = sum(loaded_alarms.to_pd().values != 0)
except:
print("An exception occurred. Might due to version issue")

try:

if sys.version_info[1] >= 8:
n_loaded_alarms = np.sum(loaded_alarms.to_pd().values != 0)
except:
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 8922394

Please sign in to comment.