timothydmorton / isochrones

Pythonic stellar model grid access; easy MCMC fitting of stellar properties
http://isochrones.readthedocs.org
MIT License
119 stars 63 forks source link

MIST hangs forever when NaNs included #67

Closed hposborn closed 6 years ago

hposborn commented 6 years ago

For example, running this on Jupyter notebook (py3.6):

mist = MIST_Isochrone() #masses, logages, FeHs: m,a,f=np.random.normal(1.0,0.1,1000),np.random.normal(8.5,0.1,1000),np.random.normal(0.0,0.1,1000) rads0=mist.radius(m,a,f) #this works fine #Adding some NaNs in the logage chx=np.random.random(1000) a[chx>0.45]=np.tile(np.nan,(chx>0.45).sum()) #Running rads=mist.radius(m,a,f)

The code just hangs infinitely, and I have to manually kill the kernel (interrupting doesn't work) and run everything else in my ipynb again.

I could definitely just put some code to catch them and return NaNs instead of running mist.radius, but equally I feel like this could be put in the function itself, and certainly any infinite loops should be caught and excepted!

timothydmorton commented 6 years ago

Thanks for raising this. I have some time now for some housekeeping with this code, so I can look into this, but also feel free to submit a PR to correct this in the custom interpolation code.