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

Exception due to misuse of numpy options #22

Open
aozalevsky opened this issue Mar 20, 2019 · 0 comments
Open

Exception due to misuse of numpy options #22

aozalevsky opened this issue Mar 20, 2019 · 0 comments

Comments

@aozalevsky
Copy link

aozalevsky commented Mar 20, 2019

The recent version of VCF-kit is unusable right after the installation:

[nknyazeva@head02 silwer]$ vk
Traceback (most recent call last):
  File "/home/nknyazeva/.local/bin/vk", line 9, in <module>
    load_entry_point('VCF-kit==0.1.6', 'console_scripts', 'vk')()
  File "/home/tools/python/Python-2.7/lib/python2.7/site-packages/pkg_resources/__init__.py", line 542, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/home/tools/python/Python-2.7/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2569, in load_entry_point
    return ep.load()
  File "/home/tools/python/Python-2.7/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2229, in load
    return self.resolve()
  File "/home/tools/python/Python-2.7/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2235, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/home/nknyazeva/.local/lib/python2.7/site-packages/vcfkit/vk.py", line 27, in <module>
    from utils.vcf import *
  File "/home/nknyazeva/.local/lib/python2.7/site-packages/vcfkit/utils/vcf.py", line 10, in <module>
    np.set_printoptions(threshold=np.nan)
  File "/home/tools/python/Python-2.7/lib/python2.7/site-packages/numpy/core/arrayprint.py", line 246, in set_printoptions
    floatmode, legacy)
  File "/home/tools/python/Python-2.7/lib/python2.7/site-packages/numpy/core/arrayprint.py", line 93, in _make_options_dict
    raise ValueError("threshold must be numeric and non-NAN, try "
ValueError: threshold must be numeric and non-NAN, try sys.maxsize for untruncated representation

caused by line:

np.set_printoptions(threshold=np.nan)

in vcfkit/utils/vcf.py

The issue can be fixed with:

import sys
np.set_printoptions(threshold=sys.maxsize)

Please refer to numpy/numpy#12987 for the explanation and the origin of the fix.

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

1 participant