Skip to content

Commit

Permalink
Pin Pandas version to 1.1.x
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
LauraSManns authored and JensGM committed Mar 1, 2021
1 parent 2547e1d commit 734392e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
numpy
pandas<=1.0.3
pandas>=1.1.0,<1.2.0
scipy
rainflow==2.2.0
requests
Expand Down
2 changes: 1 addition & 1 deletion tests/output/test_bazefetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
10 changes: 5 additions & 5 deletions tests/source/test_bazefetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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():
Expand Down
16 changes: 8 additions & 8 deletions tests/util/test_baze_iterator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand All @@ -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():
Expand Down

0 comments on commit 734392e

Please sign in to comment.