Skip to content
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

Remove xpass cases and turn xpass into failures #7267

Merged
merged 4 commits into from
Mar 9, 2018

Conversation

pllim
Copy link
Member

@pllim pllim commented Mar 8, 2018

Fix #7056
Fix #7065
Close #7194

@astropy-bot
Copy link

astropy-bot bot commented Mar 8, 2018

Hi there @pllim 👋 - thanks for the pull request! I'm just a friendly 🤖 that checks for issues related to the changelog and making sure that this pull request is milestoned and labeled correctly. This is mainly intended for the maintainers, so if you are not a maintainer you can ignore this, and a maintainer will let you know if any action is required on your part 😃.

Everything looks good from my point of view! 👍

If there are any issues with this message, please report them here.

@pllim
Copy link
Member Author

pllim commented Mar 8, 2018

Looks like I opened a can o' worms. Compiling them here so I can see a pattern.

PYTHON_VERSION=3.5 NUMPY_VERSION=1.10 (https://travis-ci.org/astropy/astropy/jobs/350900557)

_ TestUfuncReduceReduceatAccumulate.test_one_argument_ufunc_reduce_accumulate __
[XPASS(strict)] condition: NUMPY_LT_1_13
_________________ TestUfuncOuter.test_one_argument_ufunc_outer _________________
[XPASS(strict)] condition: NUMPY_LT_1_13

PYTHON_VERSION=3.5 NUMPY_VERSION=1.11 (https://travis-ci.org/astropy/astropy/jobs/350900558)

__________________________ test_mad_std_scalar_return __________________________
[XPASS(strict)] 
_ TestUfuncReduceReduceatAccumulate.test_one_argument_ufunc_reduce_accumulate __
[XPASS(strict)] condition: NUMPY_LT_1_13
_________________ TestUfuncOuter.test_one_argument_ufunc_outer _________________
[XPASS(strict)] condition: NUMPY_LT_1_13

Note: test_mad_std_scalar_return was added in #5232 already with xfail in place.

PYTHON_VERSION=3.6 NUMPY_VERSION=1.12 (https://travis-ci.org/astropy/astropy/jobs/350900561)

_ TestUfuncReduceReduceatAccumulate.test_one_argument_ufunc_reduce_accumulate __
[XPASS(strict)] condition: NUMPY_LT_1_13
_________________ TestUfuncOuter.test_one_argument_ufunc_outer _________________
[XPASS(strict)] condition: NUMPY_LT_1_13

try:
assert not np.isnan(rslt)
except AssertionError:
pytest.xfail('See #5232')
Copy link
Contributor

Choose a reason for hiding this comment

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

That PR discussion is really long; maybe add a link to a specific comment that summarizes the expected fail? I don't remember if this particular test is expected to fail only on certain numpy versions or what...

Copy link
Member Author

Choose a reason for hiding this comment

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

I wasn't involved in that discussion and can't follow it completely (it is very long). Is #5232 (comment) close enough? It does seem weird that this test would only xpass in Numpy 1.11 and nothing else.

Copy link
Contributor

Choose a reason for hiding this comment

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

...it would probably take me half an hour to figure it out reading back through that. Oh well, let's just leave the comment here - at least it is theoretically possible to reconstruct my mental state at the time...

Copy link
Member Author

Choose a reason for hiding this comment

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

Okay then. 😉

Copy link
Contributor

Choose a reason for hiding this comment

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

If that comment is right, this problem will auto-disappear in 3.1, since we'll only support numpy >=1.13

That also suggests, though, this should really be a test on numpy version. I don't really want to hold up this supposedly simple PR, but could you add a comment that might well be resolved in later numpy? Please include something like NUMPY_LT_1_13?? in the comment, so that we'll find it!

@bsipocz
Copy link
Member

bsipocz commented Mar 8, 2018

@pllim - Shouldn't we cherry-pick back to 2.0.x, doesn't this affect that branch, too?

@pllim
Copy link
Member Author

pllim commented Mar 8, 2018

@bsipocz , do we care about xpass in v2.x? This is more of a "nice to have" than a bug fix. Also, I don't know how painful it is to backport this, given we stripped PY2 support in master now. Feel free to re-milestone as you like.

@bsipocz
Copy link
Member

bsipocz commented Mar 8, 2018

@pllim - Oh, well, you have a valid point there, I agree not to backport.

@pllim
Copy link
Member Author

pllim commented Mar 8, 2018

Okay. Tests passed. The allowed to fail job that failed is being addressed separately at #7266.

Copy link
Contributor

@mhvk mhvk left a comment

Choose a reason for hiding this comment

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

Very nice! Only two nitpicks, mostly to avoid future hassle.

def test_transforms_diff(sc):
# note that arguably this *should* fail for the no-distance cases: 3D
# information is necessary to truly solve this, hence the xfail
trans = sc.transform_to(PrecessedGeocentric(equinox='B1975'))
assert isinstance(trans.frame, PrecessedGeocentric)
if sc.distance == 1:
Copy link
Contributor

Choose a reason for hiding this comment

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

If we ever want to test multi-D arrays, this would fail. How about

if not sc.distance.unit.is_equivalent(u.m):

try:
assert not np.isnan(rslt)
except AssertionError:
pytest.xfail('See #5232')
Copy link
Contributor

Choose a reason for hiding this comment

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

If that comment is right, this problem will auto-disappear in 3.1, since we'll only support numpy >=1.13

That also suggests, though, this should really be a test on numpy version. I don't really want to hold up this supposedly simple PR, but could you add a comment that might well be resolved in later numpy? Please include something like NUMPY_LT_1_13?? in the comment, so that we'll find it!

@@ -955,6 +954,7 @@ def test_one_argument_ufunc_reduce_accumulate(self):
with pytest.raises(ValueError):
np.sin.reduceat(s, i)

@pytest.mark.xfail("NUMPY_LT_1_13")
Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, that's a nice one - the other test method already gives the right failures!

@pllim
Copy link
Member Author

pllim commented Mar 9, 2018

@mhvk , if this looks good to you, please approve. Thanks!

Copy link
Contributor

@mhvk mhvk left a comment

Choose a reason for hiding this comment

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

All OK now. Nice to have this additional robustness. Will merge.

@mhvk mhvk merged commit e9fad16 into astropy:master Mar 9, 2018
@pllim
Copy link
Member Author

pllim commented Mar 9, 2018

Ah, I just noticed this xpass in Numpy dev job. Since it only affects Numpy dev, what is your advice here? This can be a separate PR.

______________________ TestTableFunctions.test_mask_array ______________________
[XPASS(strict)] See https://github.com/astropy/astropy/issues/7214

@pllim pllim deleted the coord-xfail branch March 9, 2018 18:28
bsipocz pushed a commit that referenced this pull request Mar 12, 2018
Remove xpass cases and turn xpass into failures
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants