ENH: Modified metadata for build_err_msg method#20161
ENH: Modified metadata for build_err_msg method#20161sayantikabanik wants to merge 2 commits intonumpy:mainfrom
Conversation
|
The following line (and similar other examples in the whole project where traceback is shown for test failures) needs change (x -> 'ACTUAL', y -> 'DESIRED') numpy/numpy/testing/_private/utils.py Lines 1000 to 1001 in d865300 |
|
Seems like |
|
Searching for |
|
Seems like you have already made the replacement where the CI is showing mismatch error. It's happening only on macOS I think. I don't think there is anything else to be done. |
|
In the following line. I think names aren't updated to numpy/numpy/testing/_private/utils.py Line 744 in 18d1a53 |
|
You can apply the following diff (use diff --git a/numpy/testing/_private/utils.py b/numpy/testing/_private/utils.py
index af9e31e77..162debfe5 100644
--- a/numpy/testing/_private/utils.py
+++ b/numpy/testing/_private/utils.py
@@ -741,7 +741,7 @@ def func_assert_same_pos(x, y, func=isnan, hasval='nan'):
msg = build_err_msg([x, y],
err_msg + '\nx and y %s location mismatch:'
% (hasval), verbose=verbose, header=header,
- names=('x', 'y'), precision=precision)
+ names=('ACTUAL', 'DESIRED'), precision=precision)
raise AssertionError(msg)
# If there is a scalar, then here we know the array has the same
# flag as it everywhere, so we should return the scalar flag.
@@ -759,7 +759,7 @@ def func_assert_same_pos(x, y, func=isnan, hasval='nan'):
err_msg
+ f'\n(shapes {x.shape}, {y.shape} mismatch)',
verbose=verbose, header=header,
- names=('x', 'y'), precision=precision)
+ names=('ACTUAL', 'DESIRED'), precision=precision)
raise AssertionError(msg)
flagged = bool_(False) |
|
Other than that, I get the following error on your branch. Not sure if it's related. Just commenting anyways. numpy.core.ndarray
------------------
File "build/testenv/lib/python3.9/site-packages/numpy/__init__.py", line ?, in ndarray.__class_getitem__
Failed example:
np.ndarray[Any, np.dtype[Any]]
Expected:
numpy.ndarray[typing.Any, numpy.dtype[Any]]
Got:
numpy.ndarray[typing.Any, numpy.dtype[typing.Any]]
ERROR: failed checking numpy.core |
czgdp1807
left a comment
There was a problem hiding this comment.
This looks good to me. @BvB93 @almostsquare Any thoughts on this?
|
@czgdp1807 on which python version are you receiving this error? |
I get it with 3.9.6. |
|
Oh, wait a minute, I see now what's going on here. In any case, don't the |
|
@czgdp1807 @BvB93 are there any more changes required for this PR to be complete? |
Thanks for the changes, @sayantikabanik! Looks good! |
|
LGTM. |
|
Since this is user-facing, do we want to add a one-line release note about the changed behaviour? |
I second that. |
|
@sayantikabanik You can make the release note in |
9a58de1 to
59df97c
Compare
|
This needs a clean up of git history. We will meet later today and help you clean up the stuff here. |
145b6a1 to
7746776
Compare
Thanks :D |
|
Could the CI be restarted from the backend? It's stuck I think. |
|
It's Travis again. @rgommers It's get stuck very often. Can be ignored I think. |
|
It looks like this was close and valuable for consistency. |
|
@ngoldbaum looks like this can be closed now |
|
Finished in #24931 |

Info regarding the PR
x&yparams withACTUAL&DESIREDfor clear understanding during debuggingtests_utils.pyto incorporate the message string change