Skip to content

COMPAT, TST: allow numpy array comparisons with complex dtypes #13392

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

Merged
merged 1 commit into from
Jun 7, 2016

Conversation

gfyoung
Copy link
Member

@gfyoung gfyoung commented Jun 7, 2016

Traces back to bug in NumPy v1.7.1 in which the array_equivalent method could not compare NumPy arrays with complicated dtypes. As pandas relies on this function to check NumPy array equality during testing, this commit adds a fallback method for doing so.

Closes #13388.

@gfyoung
Copy link
Member Author

gfyoung commented Jun 7, 2016

Didn't really think I needed a whatsnew in this case since this does seem rather internal to pandas. If I do need one, not sure what I would write exactly.

@jreback
Copy link
Contributor

jreback commented Jun 7, 2016

this needs perf testing, not sure how much that path is hit (so I don't think its an issue). but pls run them.

@jreback
Copy link
Contributor

jreback commented Jun 7, 2016

@sinhrks

@jreback jreback added Testing pandas testing functions or related to the test suite Compat pandas objects compatability with Numpy or Python functions labels Jun 7, 2016
@jreback jreback added this to the 0.18.2 milestone Jun 7, 2016
return np.array_equal(left, right)
except AttributeError:
# see gh-13388
if not is_dtype_equal(left.dtype, right.dtype):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a comment here of what this is doing / catching

@gfyoung
Copy link
Member Author

gfyoung commented Jun 7, 2016

@jreback : Will quickly run benchmarks, but as this is just a compatibility issue (bug exists until v.1.8.0 of numpy), this path will most certainly never be hit for the more recent versions.

@codecov-io
Copy link

codecov-io commented Jun 7, 2016

Current coverage is 84.22%

Merging #13392 into master will decrease coverage by <.01%

@@             master     #13392   diff @@
==========================================
  Files           138        138          
  Lines         50756      50763     +7   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits          42756      42757     +1   
- Misses         8000       8006     +6   
  Partials          0          0          

Powered by Codecov. Last updated by 67b72e3...230616e

Traces back to bug in NumPy v1.7.1 in which the 'array_equivalent'
method could not compare NumPy arrays with complicated dtypes. As
pandas relies on this function to check NumPy array equality during
testing, this commit adds a fallback method for doing so.

Closes pandas-devgh-13388.

[ci skip]
@gfyoung gfyoung force-pushed the np-array-compare-compat branch from 230616e to fe87955 Compare June 7, 2016 20:41
@gfyoung
Copy link
Member Author

gfyoung commented Jun 7, 2016

@jreback : Travis is passing on all machines again. Ready to merge if there are no other concerns.

@jreback
Copy link
Contributor

jreback commented Jun 7, 2016

benchmarks ok?

@gfyoung
Copy link
Member Author

gfyoung commented Jun 7, 2016

No obvious changes in the benchmarks AFAICT and as expected.

@jreback jreback merged commit 158ae5b into pandas-dev:master Jun 7, 2016
@jreback
Copy link
Contributor

jreback commented Jun 7, 2016

ty

@gfyoung gfyoung deleted the np-array-compare-compat branch June 7, 2016 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Compat pandas objects compatability with Numpy or Python functions Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants