Skip to content

Commit

Permalink
Revert "Adding unit test for timezone issue (#151)"
Browse files Browse the repository at this point in the history
This reverts commit 1c6297f.
  • Loading branch information
sebhahn committed Apr 17, 2019
1 parent 1c6297f commit d5ab76e
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions tests/test_temporal_matching.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,31 +37,6 @@
from datetime import datetime
import numpy as np
import numpy.testing as nptest
import pytz

def test_timezone_handling():
"""
Reference dataframes with indices that have timezone information can be
problematic.
See issue #150
"""
data = np.arange(5.0)
data[3] = np.nan

match_df = pd.DataFrame({"data": data}, index=pd.date_range(datetime(2007, 1, 1, 0),
"2007-01-05", freq="D", tz="UTC"))
timezone = pytz.timezone("UTC")
ref_df = pd.DataFrame({"matched_data": np.arange(5)},
index=[timezone.localize(datetime(2007, 1, 1, 9)),
timezone.localize(datetime(2007, 1, 2, 9)),
timezone.localize(datetime(2007, 1, 3, 9)),
timezone.localize(datetime(2007, 1, 4, 9)),
timezone.localize(datetime(2007, 1, 5, 9))])
matched = tmatching.matching(ref_df, match_df)

nptest.assert_allclose(np.array([0, 1, 2, 4]), matched.matched_data)
assert len(matched) == 4


def test_df_match_borders():
Expand Down

0 comments on commit d5ab76e

Please sign in to comment.