From 734392eea557b86a64e0ef9ad2bdd3f192fa2b5b Mon Sep 17 00:00:00 2001 From: LauraSManns Date: Wed, 24 Feb 2021 13:06:09 +0100 Subject: [PATCH] Pin Pandas version to 1.1.x The final version of Pandas to support 3.6 is 1.1.x. This version includes a new flac in pd.testing.assert_series_equals(), check_freq, that will be present in any future versions. --- requirements.txt | 2 +- tests/output/test_bazefetcher.py | 2 +- tests/source/test_bazefetcher.py | 10 +++++----- tests/util/test_baze_iterator.py | 16 ++++++++-------- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/requirements.txt b/requirements.txt index fc5d80b1..7554ab27 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ numpy -pandas<=1.0.3 +pandas>=1.1.0,<1.2.0 scipy rainflow==2.2.0 requests diff --git a/tests/output/test_bazefetcher.py b/tests/output/test_bazefetcher.py index de48af62..fca76a21 100644 --- a/tests/output/test_bazefetcher.py +++ b/tests/output/test_bazefetcher.py @@ -16,7 +16,7 @@ def assert_correctly_loaded(expected, basedir, t0, t1, tag="test", new_index = result.index.tz_convert(tzinfo) result = result.reindex(new_index) - pd.testing.assert_series_equal(expected, result) + pd.testing.assert_series_equal(expected, result, check_freq=False) def assert_correct_index(expected_index, basedir, start_date, end_date, diff --git a/tests/source/test_bazefetcher.py b/tests/source/test_bazefetcher.py index 9ff24469..b961314e 100644 --- a/tests/source/test_bazefetcher.py +++ b/tests/source/test_bazefetcher.py @@ -44,7 +44,7 @@ def tan(t0=t1_1, tn=t1_5): return _tan[t0:tn - eps] def assert_correct(v, func, t0, t1): - pd.testing.assert_series_equal(v, func(t0, t1)) + pd.testing.assert_series_equal(v, func(t0, t1), check_freq=False) assert v.index[0] == t0 assert v.index[-1] < t1 assert (t1 - v.index[-1]).to_pytimedelta() < timedelta(seconds=20) @@ -53,8 +53,8 @@ def test_read_two_days(): sin_b = baze('Sin-T60s-SR01hz', t1_2, t1_4) tan_b = baze('Tan-T60s-SR01hz', t1_2, t1_4) assert len(sin_b) == len(tan_b) == 17280 # 2 days - pd.testing.assert_series_equal(sin_b, sin(t1_2, t1_4)) - pd.testing.assert_series_equal(tan_b, tan(t1_2, t1_4)) + pd.testing.assert_series_equal(sin_b, sin(t1_2, t1_4), check_freq=False) + pd.testing.assert_series_equal(tan_b, tan(t1_2, t1_4), check_freq=False) assert sin_b.index[0] == t1_2 assert sin_b.index[-1] < t1_4 assert (t1_4 - sin_b.index[-1]).to_pytimedelta() < timedelta(seconds=20) @@ -220,7 +220,7 @@ def test_many_roots_same_filename(): def test_no_time_boundaries(): sin_b = baze('Sin-T60s-SR01hz') assert len(sin_b) == 34560 # 4 days - pd.testing.assert_series_equal(sin_b, sin(t1_1, t1_5)) + pd.testing.assert_series_equal(sin_b, sin(t1_1, t1_5), check_freq=False) assert sin_b.index[0] == t1_1 assert sin_b.index[-1] < t1_5 assert (t1_1 - sin_b.index[-1]).to_pytimedelta() < timedelta(seconds=20) @@ -250,7 +250,7 @@ def test_load_err_file(): def test_load_special_regex_file(): sin_data = non_standard('tag-with+plus-sign') assert len(sin_data) == 34560 # 4 days - pd.testing.assert_series_equal(sin_data, sin(t1_1, t1_5)) + pd.testing.assert_series_equal(sin_data, sin(t1_1, t1_5), check_freq=False) def test_load_bad_format_file(): diff --git a/tests/util/test_baze_iterator.py b/tests/util/test_baze_iterator.py index feefd0e7..579c5279 100644 --- a/tests/util/test_baze_iterator.py +++ b/tests/util/test_baze_iterator.py @@ -36,42 +36,42 @@ def cos(t0=t1, tn=t4): return _cos[t0:tn - eps] def test_BazeIter(): for data, s, e in baze.create_iterator(sin_tag, t1, t2): assert len(data) == 8640 - pd.testing.assert_series_equal(data, sin(s, e)) + pd.testing.assert_series_equal(data, sin(s, e), check_freq=False) def test_BazeIter_tag_list(): for data, s, e in baze.create_iterator([sin_tag, cos_tag], t1, t2): assert len(data[sin_tag]) == 8640 - pd.testing.assert_series_equal(data[sin_tag], sin(s, e)) - pd.testing.assert_series_equal(data[cos_tag], cos(s, e)) + pd.testing.assert_series_equal(data[sin_tag], sin(s, e), check_freq=False) + pd.testing.assert_series_equal(data[cos_tag], cos(s, e), check_freq=False) def test_left_padding(): padding = timedelta(hours=1) for data, s, e in baze.create_iterator(sin_tag, t2, t3, padding=padding): assert len(data) == 9000 - pd.testing.assert_series_equal(data, sin(s - padding, e)) + pd.testing.assert_series_equal(data, sin(s - padding, e), check_freq=False) def test_left_integer_padding(): padding = 360 * 25 for data, s, e in baze.create_iterator(sin_tag, t3, t4, padding=padding): assert len(data) == 8640 + padding - pd.testing.assert_series_equal(data, sin(s - timedelta(hours=25), e)) + pd.testing.assert_series_equal(data, sin(s - timedelta(hours=25), e), check_freq=False) def test_right_padding(): padding = timedelta(hours=1) for data, s, e in baze.create_iterator(sin_tag, t2, t3, padding=padding, leftpad=False, rightpad=True): assert len(data) == 9000 - pd.testing.assert_series_equal(data, sin(s, e + padding)) + pd.testing.assert_series_equal(data, sin(s, e + padding), check_freq=False) def test_right_integer_padding(): padding = 360 * 25 for data, s, e in baze.create_iterator(sin_tag, t1, t2, padding=padding, leftpad=False, rightpad=True): assert len(data) == 8640 + padding - pd.testing.assert_series_equal(data, sin(s, e + timedelta(hours=25))) + pd.testing.assert_series_equal(data, sin(s, e + timedelta(hours=25)), check_freq=False) def test_non_one_day_interval(): @@ -95,7 +95,7 @@ def test_non_midnight_date(): t2 = datetime(2030, 1, 2, 11, tzinfo=utc) for data, s, e in baze.create_iterator(sin_tag, t1, t2, timedelta(hours=1)): assert len(data) == 360 - pd.testing.assert_series_equal(data, sin(s, e)) + pd.testing.assert_series_equal(data, sin(s, e), check_freq=False) def test_interval_not_fitting_range():