Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
BUG: tslib.tz_convert and tslib.tz_convert_single may output different result in DST #7798
Conversation
|
Perf result. I think it increases a performance of
|
|
can you run the perf test here: pydata#7652 (and the 'test' in #7633, just to make sure the perf is still ok (your fix looks good though) |
jreback
added Timezones Performance
labels
Jul 18, 2014
jreback
added this to the
0.15.0
milestone
Jul 18, 2014
|
OK, done.
|
|
And test in #7633 takes few seconds.
|
sinhrks
referenced
this pull request
Jul 19, 2014
Closed
BUG: tslib.tz_convert_single converts DST incorrectly #7782
|
Should we add a test for the fall DST transition similar to what you did for spring? I understand there is not really any specific "spring" code per se, but sometimes strange things popup. Otherwise the changes look fine. |
|
@rockg Yep, added tests. Could you check whether it is valid, otherwise lmk better one? |
jreback
commented on an outdated diff
Jul 22, 2014
| @@ -784,6 +784,43 @@ def test_utc_with_system_utc(self): | ||
| # check that the time hasn't changed. | ||
| self.assertEqual(ts, ts.tz_convert(dateutil.tz.tzutc())) | ||
| + def test_tslib_tz_convert_trans_pos_plus_1__bug(self): | ||
| + # Regression test for tslib.tz_convert(vals, tz1, tz2). | ||
| + # See https://github.com/pydata/pandas/issues/4496 for details. | ||
| + idx = date_range(datetime(2011, 3, 26, 23), datetime(2011, 3, 27, 1), freq='1min') | ||
| + idx = idx.tz_localize('UTC') | ||
| + idx = idx.tz_convert('Europe/Moscow') | ||
| + | ||
| + expected = np.repeat(np.array([3, 4, 5]), np.array([60, 60, 1])) | ||
| + self.assert_numpy_array_equal(idx.hour, expected) | ||
| + | ||
| + def test_tslib_tz_convert_dst(self): | ||
| + # Start DST | ||
| + idx = date_range('2014-03-08 23:00', '2014-03-09 09:00', freq='1min', tz='UTC') |
jreback
Contributor
|
|
That's exactly what I was thinking. |
|
OK, modified test to cover other freqs. |
sinhrks
referenced
this pull request
Jul 30, 2014
Closed
Intersection of non-overlapping DatetimeIndexes with tz set fails #7880
|
Added the fix for #7880. |
|
@jreback I think it is ready, lmk if anything. |
|
looks fine, what was the problem with #7880 ? (e.g. what fixed it) |
jreback
added a commit
that referenced
this pull request
Aug 3, 2014
|
|
jreback |
ce5a4ef
|
jreback
merged commit ce5a4ef
into pandas-dev:master
Aug 3, 2014
1 check passed
|
thanks! |
sinhrks commentedJul 18, 2014
These functions may return different result in case of DST. There seems to be 2 problems:
tslib.tz_convertchecks DST and changedeltasby adjustingposby 1. If input has time-gaps more than 2 DST spans, result will be incorrect.tslib.tz_convert_singleresults incorrect if input is just on DST edge.Note
Additionally, it was modifed to close #7880 also.