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
Tests fail with Python 3.11 and Numpy 1.24.1: AssertionError #49
Comments
I mean tests/test_mrcobject.py |
Thanks for pointing this out. My automated tests cover Python 3.11 with numpy 1.23 but I hadn't got as far as including 1.24 yet. Your suggested change would make the tests pass but those tests would no longer check what they're intended to. In that context (making sure the data hasn't been copied) asserting identity is the correct thing to do, so if those tests are now failing it indicates a problem elsewhere which I'll have to look at. Thanks for the info about the numpy bug too. Hopefully there'll be a fixed version of numpy soon and we won't have to worry about that one. |
The tests that checks for identity is:
Yet the set_data() method does:
So correct me if I'm wrong, but the test is bound to fail, isn't it? |
No, the key here is in the "if necessary" part of the comment. |
So… do we have a way out? With numpy 1.24.2, the only remaining test failures are those of test_data_is_not_copied_unnecessarily (tested with a locally patched testsuite). |
As maintainer of the mrcfile package in Debian, I'm tempted to just apply s3v-'s patch, if only to be in time for the release… unless you tell me there's a real problem with that :-) |
Well, there's a problem with that in that those tests would no longer be testing what they say they're testing. If you want to patch and release, it would be cleaner to just remove those tests completely. But it's up to you, of course. As long as it's only those "data_is_not_copied_unnecessarily" tests that are failing then there shouldn't be any problems that seriously affect mrcfile's functionality. |
Thank you. I'll patch these tests out with a very conspicuous comment for now. If you find out the root cause and adapt the tests accordingly, I'll be happy to revert the patch :-) |
Upstream still didn't port the tests to work with latest numpy versions: ccpem/mrcfile#49 Debian maintainers modified the test meantime to pass until they are properly fixed upstream. Bug: https://bugs.gentoo.org/834884 Signed-off-by: Pacho Ramos <pacho@gentoo.org>
I'm getting this on Fedora rawhide with numpy-1.24.3. I'll skip those tests for now as suggested above. |
I guess the related change in numpy 1.24 might be: numpy/numpy#21925 . |
This is now fixed in mrcfile 1.5.0 |
Some tests start failing with Python 3.11 and Numpy 1.24.1.
See: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1028707
After changing:
with:
in tests/test_mrcfile.py, all tests pass except "AssertionError: ValueError not raised" caused by a numpy bug (link)
I'm not sure about this change, though.
Kind Regards
The text was updated successfully, but these errors were encountered: