-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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
BUG: Add uint64 support to IntervalTree #20651
Conversation
@@ -24,6 +24,7 @@ ctypedef fused scalar_t: | |||
float32_t | |||
int64_t | |||
int32_t | |||
uint64_t |
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.
Not entirely sure if this is necessary
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.
I think it's fine. Even if your tests pass without it, I would still keep it for consistency.
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.
small comment, otherwise lgtm.
np.array([0, 4, -1], dtype='int64')) | ||
with pytest.raises(KeyError): | ||
tree.get_indexer(np.array([3.0])) | ||
self.tree = tree('int64') |
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.
prob don't need setup_method this if you pass tree into other methods
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.
The fixture makes more sense if you plan on using more than one dtype
IMO. As it stands, I think we can move the tree initialization inside setup_method
(and remove the tree
input to the tests).
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.
The tree
fixture is using the dtype
fixture when passed as a parameter to tests, so it's generating trees for all dtypes in the dtype
fixture. Initializing self.tree
like that is just a hack I used to create a single instance of a int64
tree, since there was one existing test that only used int64
. The test passes for all dtypes though, so removed setup_method
and just passed in the tree
fixture.
Codecov Report
@@ Coverage Diff @@
## master #20651 +/- ##
==========================================
- Coverage 91.83% 91.81% -0.03%
==========================================
Files 153 153
Lines 49269 49270 +1
==========================================
- Hits 45247 45238 -9
- Misses 4022 4032 +10
Continue to review full report at Codecov.
|
remove setup_method, parametrize additional test
thanks @jschendel |
side issue: do we have tests constructing (and raising) non-supported dtypes, e.g. |
this is generating lots of build warnings
|
Looking into the warnings. The warnings I get are similar but slightly different,; guessing it's a compiler thing. I have a fix that addresses the warnings, but it causes an
Also added a test for this on my warnings fix branch, and made some minor changes to yield a more informative error. |
git diff upstream/master -u -- "*.py" | flake8 --diff
Note that this doesn't fully close the linked issue; this just resolves the
uint64
case, which was relatively straightforward. The datetimelike case still needs to be resolved, but seems distinct enough for a different PR.