Relax tolerance of some tests for numpy 1.22#12682
Conversation
pllim
left a comment
There was a problem hiding this comment.
Seems uncontroversial enough. Thanks!
This comment has been minimized.
This comment has been minimized.
|
The python3.9 windows failure seems also related to the new numpy - and may be a bug... I'm also unsure about the matplotlib failure - that might well be numpy related too, and thus need a new baseline image, but don't know how to investigate that... Maybe to get things going again it is an idea to pin numpy for those for now? |
|
For the win32 failure, I think this really is a numpy problem so raised an issue at numpy/numpy#20699 |
|
Thanks for looking into this! Hmm. Should we wait for numpy/numpy#20699 to be resolved before proceeding? |
This comment has been minimized.
This comment has been minimized.
|
On looking more closely, I now also wonder about the test case that failed: there is actually a huge difference in parameters (EDIT: the last one!) |
|
Annoyingly, I cannot reproduce that result... |
41ae13c to
4f33333
Compare
|
Possibly, this is because Gaussian2D's theta was not actually initialized. 🤞 |
This comment has been minimized.
This comment has been minimized.
4f33333 to
8eaa61b
Compare
|
FYI: I rebased and see if some of the failures will go away. Update: I also updated the truths for mpl311 over at astropy-data instead of trying to pin here, which broke both CirlcleCI jobs, whereas only mpl311 is failing with those 2 images in main. I don't see anything in the diff, but whatever. p.s. I think the ResourceWarning about test3.fits is because the other test failed and didn't clean up open file pointers properly. It will go away when we skip the affected test. |
|
@mhvk , I took the liberty to also try to fix all the other failures that cropped up over the holiday weekend here. Hope you don't mind! |
|
@pllim - of course fine to push further attempts, thanks! It does look like in the modelling something really changed, allowing |
Most likely as a consequence of numpy now supporting the faster but slightly less precise Intel Short Vector Math Library (SVML), some of our tests are failing, in ways that are not really interesting. So, up the tolerance slightly. See numpy/numpy#19478 Temporarily pin numpy for matplotlib tests Ensure theta of Gaussian2D is initialized
3ce6f0f to
6eecd23
Compare
No, I am doing other work while the CI churns away. The most curious thing is not all jobs are failing, so something specific is triggering it. I wonder if @WilliamJamieson has any idea... |
|
Really don't know what is going on with modeling. I don't see this failure on main and I don't see how this patch can trigger this failure. I pushed a commit to just skip it on Windows to see if other jobs even have the same failure or not. |
bb9bc96 to
4210769
Compare
|
Maybe we don't need this patch if #12684 works... 👀 |
|
@WilliamJamieson is investigating if he can rewrite the offending modeling test to be more robust. |
|
I also see this warning in a local install when I do a |
|
p.s. I am unable to reproduce the modeling failure on Windows 10 locally (after unskipping it, of course). |
|
I tried to follow all the experiments, but fear it just left me super-confused! In particular of course not being able to actually reproduce the failures... |
|
Hmm. Looks like we don't have to touch most of the tests if we go with #12685 . What do you think? |
|
Ideally, we run our tests as users would, so without setting environment variables. I don't mind relaxing the constraints, but the changes in modelling are really worrying. So, perhaps the best is to use #12685 for now, so that the tests pass again and we can continue to merge new stuff, but raise an issue to remind us to try to find out what is causing the modelling problems - we don't want users to get wrong results if they don't have that variable set!! |
|
@mhvk I suspect that the "modeling problem" is just a case of equivalent parameter sets. This is because the only parameter that is "wrong" is the rotation angle of the Note that the test changes I suggested for #12684, are passing for the |
That is a good point as well. Now I am torn... We have two options:
|
|
Not using the env var seems better since it's hard to ensure that it's always set, e.g. when running pytest directly. So as it seems we now have a solution for the various tests that are failing, adjusting the constraints, I would go with that. |
|
@WilliamJamieson - thanks, that makes sense. As you say, the weird thing is that it depends on environment. But as long as one gets a fit that actually works, it does not matter too much. |
|
I also would tend to go with this PR, i.e., not using the environment variable. I have some hope that over at numpy improvements will be made so that the tolerance becomes better again, but really for our purposes the matches are still amply good enough. |
TST: Pin numpy in pyinstaller job because I have no idea what is going on there. Undoing getting rid of numpy.distutils give me error about _private. Skip failing FITS test due to numpy/numpy#20699 but we need to open follow-up issue to unskip it. DOC: Replace broken Simbad links.
Added back in original assert, ignoring only for Gaussian2D.
4210769 to
c33be6f
Compare
|
Okay, I cleaned up this PR. Hopefully tests will pass now. I still don't understand why pyinstaller fails with numpy 1.22 but I have pinned it to 1.21.* for now. |
|
"Allowed failure" failure is an unrelated socket timeout. |
|
Thank you, everyone! |
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Marten van Kerkwijk <[email protected]> Co-authored-by: William Jamieson <[email protected]>
Most likely as a consequence of numpy now supporting the faster but slightly less precise Intel Short Vector Math Library (SVML), some of our tests are failing, in ways that are not really interesting. So, up the tolerance slightly.
Note that I cannot reproduce the failures locally, so this may need some trial and error.
Checklist for package maintainer(s)
This checklist is meant to remind the package maintainer(s) who will review this pull request of some common things to look for. This list is not exhaustive.
Extra CIlabel.no-changelog-entry-neededlabel. If this is a manual backport, use theskip-changelog-checkslabel unless special changelog handling is necessary.astropy-botcheck might be missing; do not let the green checkmark fool you.backport-X.Y.xlabel(s) before merge.