-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: revert assert_numpy_array_equal to before c2ea8fb2 (accept non-ndarrays) #13355
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
Conversation
Current coverage is 84.23%@@ master #13355 diff @@
==========================================
Files 138 138
Lines 50721 50725 +4
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 42723 42727 +4
Misses 7998 7998
Partials 0 0
|
-1 to allow non-ndarray only for a single issue. How about add check_dtype arg? |
you can't simply change the test procedure. The entire point is to make tests more strick. So pls change as to @sinhrks suggestion. Ideally we would be extremely strict on everything. The better checking that we have on tests the less ambiguity and the less that slips thru. The original PR did a lot to correct this. |
We want strict tests, this is a function. Which I'm not "changing", except for noticing that recent changes made its behaviour incoherent with docstring and arguments. So leaving aside general lectures on fundamentals of computation, @sinhrks what's your suggestion? There already is a (fine for me, but we loose the possibility of comparing numpy arrays of different dtypes by still ensuring they are numpy arrays) |
Sorry, forget about |
So, 4 options:
If we stick with 1), it probably makes more sense to write a new function I personally don't have strong preferences, we should just be coherent. |
Closed by #13025, thx:) |
@sinhrks : this is maybe closed by you implicitly stating "we like the current behaviour" (option 1), but certainly not by #13205 (see this comment ) ;-) Which is fine by the way, if this is what you intended. |
Ah I misunderstood #13025 covers curent needs. Personally I'm +1 for option 1, but reopen for feedback from others. |
git diff upstream/master | flake8 --diff
assert_numpy_array_equal
's docstring is at odds with (and the existence of theobj
argument clashes with) the fact that it's now strict on its arguments being ndrarrays.There are practical reasons to allow other kinds of arguments.
On the other hand, I don't see any reason for being strict, but I assume @sinhrks 's PR had some rationale behind: so a possible solution is an argument
ensure_ndarray=True
which restores the previous behaviour when set toFalse
.