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

Newest Version of Numpy does not work [have to degrade to 1.16.0] #2646

Closed
claytonstrawn opened this issue Jun 19, 2020 · 2 comments · Fixed by #2654
Closed

Newest Version of Numpy does not work [have to degrade to 1.16.0] #2646

claytonstrawn opened this issue Jun 19, 2020 · 2 comments · Fixed by #2654
Labels

Comments

@claytonstrawn
Copy link
Contributor

claytonstrawn commented Jun 19, 2020

Bug report

Bug summary

If you upgrade to the most recent numpy version, yt.load does not function correctly

Code for reproduction

pip install --upgrade numpy
python

import yt
yt.load('/Users/claytonstrawn/VELA_v2_27/10MpcBox_csf512_a0.500.d')

Actual outcome

yt : [INFO     ] 2020-06-18 16:56:12,637 discovered particle_data:/Users/claytonstrawn/VELA_v2_27/PMcrs0a0.500.DAT
yt : [INFO     ] 2020-06-18 16:56:12,638 discovered particle_stars:/Users/claytonstrawn/VELA_v2_27/stars_a0.500.dat
yt : [INFO     ] 2020-06-18 16:56:12,665 Using root level of 13
yt : [INFO     ] 2020-06-18 16:56:12,667 Discovered 6 species of particles
yt : [INFO     ] 2020-06-18 16:56:12,667 Particle populations:   5287936    634880    106752     17168   2090807   1939360 
Traceback (most recent call last):
  File "/Users/claytonstrawn/anaconda2/envs/myenv_testforinterns/lib/python3.6/site-packages/numpy/core/function_base.py", line 117, in linspace
    num = operator.index(num)
TypeError: 'float' object cannot be interpreted as an integer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/claytonstrawn/yt_trident_temp/yt/yt/convenience.py", line 70, in load
    return candidates[0](*args, **kwargs)
  File "/Users/claytonstrawn/yt_trident_temp/yt/yt/frontends/art/data_structures.py", line 175, in __init__
    unit_system=unit_system)
  File "/Users/claytonstrawn/yt_trident_temp/yt/yt/data_objects/static_output.py", line 307, in __init__
    self._parse_parameter_file()
  File "/Users/claytonstrawn/yt_trident_temp/yt/yt/frontends/art/data_structures.py", line 356, in _parse_parameter_file
    self.current_time = self.quan(b2t(self.parameters['t']), 'Gyr')
  File "/Users/claytonstrawn/yt_trident_temp/yt/yt/frontends/art/io.py", line 612, in b2t
    return a2t(b2a(tb))
  File "/Users/claytonstrawn/yt_trident_temp/yt/yt/frontends/art/io.py", line 591, in b2a
    return find_root(f_b2a, 1e-4, 1.1)
  File "/Users/claytonstrawn/yt_trident_temp/yt/yt/frontends/art/io.py", line 558, in find_root
    assert(sign(f(a)) != sign(f(b)))
  File "/Users/claytonstrawn/yt_trident_temp/yt/yt/frontends/art/io.py", line 590, in <lambda>
    f_b2a = lambda at: a2b(at, **kwargs)-bt
  File "/Users/claytonstrawn/yt_trident_temp/yt/yt/frontends/art/io.py", line 582, in a2b
    val = quad(f_a2b, 1, at)
  File "/Users/claytonstrawn/yt_trident_temp/yt/yt/frontends/art/io.py", line 570, in quad
    spacings = np.logspace(np.log10(xmin), np.log10(xmax), n)
  File "<__array_function__ internals>", line 6, in logspace
  File "/Users/claytonstrawn/anaconda2/envs/myenv_testforinterns/lib/python3.6/site-packages/numpy/core/function_base.py", line 272, in logspace
    y = linspace(start, stop, num=num, endpoint=endpoint, axis=axis)
  File "<__array_function__ internals>", line 6, in linspace
  File "/Users/claytonstrawn/anaconda2/envs/myenv_testforinterns/lib/python3.6/site-packages/numpy/core/function_base.py", line 121, in linspace
    .format(type(num)))
TypeError: object of type <class 'float'> cannot be safely interpreted as an integer.

This seems to be the same on all branches of yt. I was able to fix it by downgrading to numpy 1.16.0 so I know it's a numpy dependency.

@triage-new-issues triage-new-issues bot added the triage Triage needed label Jun 19, 2020
@munkm
Copy link
Member

munkm commented Jun 19, 2020

Hi Clayton,

I've verified this issue on my machine in the art frontend.

I'm working on a fix. It looks like we have a similar issue as one of the fixes applied in #2448. I'll tag you when I submit the PR.

@munkm munkm added the bug label Jun 19, 2020
@triage-new-issues triage-new-issues bot removed the triage Triage needed label Jun 19, 2020
@neutrinoceros
Copy link
Member

note, this also looks related to #2419

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants