cmateu / galstreams

Milky Way Streams Footprint Library and Toolkit for Python
BSD 3-Clause "New" or "Revised" License
46 stars 17 forks source link

Import issue with scipy #19

Closed ahriley closed 4 years ago

ahriley commented 4 years ago

When loading the list of streams, I get an AttributeError: module 'scipy' has no attribute 'interpolate'. I believe this is because scipy's CubicSpline is called through scipy.interpolate.CubicSpline after just import scipy, which doesn't work (see this StackOverflow). Importing scipy.interpolate beforehand fixes this.

Breaks:

import galstreams
mwsts = galstreams.MWStreams()
AttributeError: module 'scipy' has no attribute 'interpolate'

Works:

import galstreams
import scipy.interpolate
mwsts = galstreams.MWStreams()

Possibly useful version info: galstreams: https://github.com/cmateu/galstreams/commit/120534e0726930d1fe7c22d052662b8241d3d9db scipy: 1.3.0 numpy: 1.16.4 matplotlib: 3.1.1 galpy: 1.4.1

cmateu commented 4 years ago

Hi Alex, thanks for pointing this out and sorry for the delayed reply. What you're saying makes perfect sense (the error and the solution), but somehow I'm not able to replicate it myself. I'm just not getting this error.

I think it may have to do with the version you have, which I think is not the latest one. Would you try updating galstreams and trying again? Please let me know how that goes. Thanks!