From c6c006eb22fcf192bc785290ec3df83c7a3a1514 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Mar=C3=ADn?= Date: Thu, 19 Dec 2019 18:00:40 +0100 Subject: [PATCH] Python3 warnings --- src/py/crankshaft/crankshaft/space_time_dynamics/markov.py | 2 +- src/py/crankshaft/test/test_segmentation.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/py/crankshaft/crankshaft/space_time_dynamics/markov.py b/src/py/crankshaft/crankshaft/space_time_dynamics/markov.py index 0d1a910..1b1ea36 100644 --- a/src/py/crankshaft/crankshaft/space_time_dynamics/markov.py +++ b/src/py/crankshaft/crankshaft/space_time_dynamics/markov.py @@ -140,7 +140,7 @@ def rebin_data(time_data, num_time_per_bin): return np.array( [time_data[:, num_time_per_bin * i:num_time_per_bin * (i+1)].mean(axis=1) - for i in range(n_max)]).T + for i in range(int(n_max))]).T def get_prob_dist(transition_matrix, lag_indices, unit_indices): diff --git a/src/py/crankshaft/test/test_segmentation.py b/src/py/crankshaft/test/test_segmentation.py index c7a940d..b4fbb49 100644 --- a/src/py/crankshaft/test/test_segmentation.py +++ b/src/py/crankshaft/test/test_segmentation.py @@ -66,7 +66,7 @@ class SegmentationTest(unittest.TestCase): test_array = np.array([1.2, np.nan, 3.2, np.nan, np.nan]) result = replace_nan_with_mean(test_array, means=None)[0] expectation = np.array([1.2, 2.2, 3.2, 2.2, 2.2], dtype=float) - self.assertItemsEqual(result, expectation) + self.assertEqual(sorted(result), sorted(expectation)) def test_create_and_predict_segment(self): """test segmentation.test_create_and_predict"""