-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
REF: de-duplicate DST tzconversion code #35077
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
4b8c4fb
REF: implement TZConvertInfo
jbrockmendel d8bffdd
Merge branch 'master' of https://github.com/pandas-dev/pandas into re…
jbrockmendel fc1ad75
Merge branch 'master' of https://github.com/pandas-dev/pandas into re…
jbrockmendel 998341e
Merge branch 'master' of https://github.com/pandas-dev/pandas into re…
jbrockmendel 8114413
setup_cache->setup
jbrockmendel 907f9c4
revert
jbrockmendel addf931
Merge branch 'master' of https://github.com/pandas-dev/pandas into re…
jbrockmendel b2154d4
Merge branch 'master' of https://github.com/pandas-dev/pandas into re…
jbrockmendel 9bcccc0
Merge branch 'master' of https://github.com/pandas-dev/pandas into re…
jbrockmendel bb7e60d
ensure initialized
jbrockmendel 407f266
ensure initialized
jbrockmendel 5adca21
debuggina ssertions
jbrockmendel 69bfb80
debuggina ssertions
jbrockmendel 13244c8
debuggina ssertions
jbrockmendel c0f8b34
debuggina ssertions
jbrockmendel 8620905
debuggina ssertions
jbrockmendel 3605695
debuggina ssertions
jbrockmendel a0eb787
debuggina ssertions
jbrockmendel c8fcc19
debuggina ssertions
jbrockmendel db71af5
debuggina ssertions
jbrockmendel e47e490
debuggina ssertions
jbrockmendel 7f8c717
debuggina ssertions
jbrockmendel e21cd6a
debuggina ssertions
jbrockmendel 9a47096
debuggina ssertions
jbrockmendel d6dce1a
debuggina ssertions
jbrockmendel 0dbd8ac
debuggina ssertions
jbrockmendel f9514b4
debuggina ssertions
jbrockmendel e198dbd
debuggina ssertions
jbrockmendel 681f5b8
debuggina ssertions
jbrockmendel e93b961
debuggina ssertions
jbrockmendel 52af5e1
debuggina ssertions
jbrockmendel 26d0d3a
debuggina ssertions
jbrockmendel 3b220fb
debuggina ssertions
jbrockmendel 3c1bf60
debuggina ssertions
jbrockmendel a70ce3f
debuggina ssertions
jbrockmendel 2478ec3
debuggina ssertions
jbrockmendel 21cbfc2
debuggina ssertions
jbrockmendel 2aa256a
debuggina ssertions
jbrockmendel 7669dc2
debuggina ssertions
jbrockmendel 2bfb9df
debuggina ssertions
jbrockmendel 3dd2957
CLN
jbrockmendel b31c40e
debugging assertions
jbrockmendel 8b2e9a3
Merge branch 'master' of https://github.com/pandas-dev/pandas into re…
jbrockmendel e5b73c7
Implement TZ
jbrockmendel 184e188
implement as cdef class
jbrockmendel b974ec7
Merge branch 'master' of https://github.com/pandas-dev/pandas into re…
jbrockmendel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,22 @@ | ||
from cpython.datetime cimport tzinfo | ||
from numpy cimport int64_t | ||
from numpy cimport int64_t, intp_t, ndarray | ||
|
||
|
||
cdef int64_t tz_convert_utc_to_tzlocal(int64_t utc_val, tzinfo tz, bint* fold=*) | ||
cpdef int64_t tz_convert_single(int64_t val, tzinfo tz1, tzinfo tz2) | ||
cdef int64_t tz_localize_to_utc_single( | ||
int64_t val, tzinfo tz, object ambiguous=*, object nonexistent=* | ||
) except? -1 | ||
|
||
|
||
cdef class Localizer: | ||
cdef: | ||
bint use_utc, use_tzlocal, use_fixed, use_pytz | ||
int noffsets | ||
int64_t* utcoffsets | ||
intp_t* positions | ||
ndarray positions_arr # needed to avoid segfault | ||
int64_t delta | ||
tzinfo tz | ||
|
||
cdef inline int64_t get_local_timestamp(self, int64_t utc_value, Py_ssize_t i) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we even need both positions_arr and positions or can we just use the former?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could just use the former, but i think we get a perf boost from indexing on the latter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you can see a difference then sure, but if not would definitely be cleaner to just stick with the ndarray