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

test failure with numpy 1.23.5 #229

Closed
emollier opened this issue Dec 18, 2022 · 1 comment
Closed

test failure with numpy 1.23.5 #229

emollier opened this issue Dec 18, 2022 · 1 comment

Comments

@emollier
Copy link
Contributor

Good day,

For information, Paul Gevers noticed in Debian bug #1026344 that the InSilicoSeq test item test_bad_err_mod fails when running against numpy 1.23.5 while testing against numpy 1.21.5 works fine. Relevant sections of the test log are:

The above exception was the direct cause of the following exception:

    def test_bad_err_mod():
        with pytest.raises(SystemExit):
>           err_mod = kde.KDErrorModel('data/empty_file')

test/test_error_model.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3/dist-packages/iss/error_models/kde.py:34: in __init__
    self.error_profile = self.load_npz(npz_path, 'kde')
/usr/lib/python3/dist-packages/iss/error_models/__init__.py:37: in load_npz
    error_profile = np.load(npz_path, allow_pickle=True)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
[...]
E                   _pickle.UnpicklingError: Failed to interpret file 'data/empty_file' as a pickle

The patch below fixes/works around the test failure, but I'm not 100% sure this is in the spirit of the test:

--- insilicoseq.orig/iss/test/test_error_model.py
+++ insilicoseq/iss/test/test_error_model.py
@@ -9,6 +9,7 @@
 
 import random
 import numpy as np
+import _pickle
 
 
 def test_perfect_phred():
@@ -89,5 +90,5 @@
 
 
 def test_bad_err_mod():
-    with pytest.raises(SystemExit):
+    with pytest.raises((SystemExit, _pickle.UnpicklingError,)):
         err_mod = kde.KDErrorModel('data/empty_file')

Anyway, in hope this helps,
Étienne.

@HadrienG
Copy link
Owner

HadrienG commented Aug 7, 2023

Thanks! will be fixed in 1.6.0

@HadrienG HadrienG closed this as completed Aug 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants