timothydmorton / isochrones

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

missing files and nosetests errors. #120

Open jphilli opened 4 years ago

jphilli commented 4 years ago

I have just installed, and I'm following the example here [https://isochrones.readthedocs.io/en/latest/modelgrids.html#Model-Grid-Objects-and-Interpolation]

to see if it works.

from isochrones.mist import MISTEvolutionTrackGrid, MISTIsochroneGrid

track_grid = MISTEvolutionTrackGrid() track_grid.df.head() # just show first few rows

is as far as I got, because I got this FileNotFoundError.

.../.isochrones/mist/tracks/mist_v1.2_vvcrit0.4.h5 does not exist

It's kind of baffling to me that calling head() on a pandas data frame would require any file i/o at all, but sure enough the indicated file isn't where the python interpreter says it isn't.

My installation procedure was as follows:

I created the conda environment

conda create -n isochrones numpy numba cython nose pytables pandas pip python=3.6

conda activate isochrones

conda install -c conda-forge multinest pymultinest

I already installed multinest using the instructions here [https://johannesbuchner.github.io/PyMultiNest/install] , and then did a

pip install isochrones

then, when I run

nosetests isochrones

I get a pandas SettingWithCopyWarning, as well as a host of numba errors:

SettingWithCopyWarning: A value is trying to be set on a copy of a slice from a DataFrame. Try using .loc[row_indexer,col_indexer] = value instead

I'm not sure what I'm doing wrong; am I missing something?

timothydmorton commented 4 years ago

Have you used isochrones before? If so, you might need to erase ~/.isochrones to start over. If this is your first time using it, try running track_grid.initialize() to make sure that everything is downloaded & set up correctly.

As far as the warnings go; they aren't a problem, just an annoying thing to be fixed at some point. Nosetests will also fail on one of the tests (see #119) but if all others pass then you're good to go.

jphilli commented 4 years ago

I'm trying to learn how to use it. I followed your advice and here was the output.

from isochrones.mist import MISTEvolutionTrackGrid, MISTIsochroneGrid

track_grid = MISTEvolutionTrackGrid() track_grid.initialize() AttributeError: 'MISTEvolutionTrackGrid' object has no attribute 'initialize'

I have tried to install and test it many times before, though this is a fresh install on a new conda environment. do I need to delete ~/.isochrones before reinstalling?

timothydmorton commented 4 years ago

OK, sorry about the misdirection; try the following:

from isochrones import get_ichrone
mist = get_ichrone('mist')
mist.initialize()

And then see if you still get the same issue with the file not existing. If you have previously installed any versions < 2, you will need to delete ~/.isochrones.

adrn commented 3 years ago

I was running into the same issue that @jphilli reported (even with a clean install, and even after deleting ~/.isochrones). Running the code you suggested downloads a .txz file in my ~/.isocrhones/mist folder but I still can't use the mist object in a model: it dies with FileNotFoundError: File /Users/apricewhelan/.isochrones/mist/mist_v1.2_vvcrit0.4_full_isos.h5 does not exist

Is it possible that it only works if you call get_ichrone() with a specification of bands=...? @dfm says that running the scripts/mist-initialize.py worked for him, but that calls get_ichrone('mist', bands='JHK')

timothydmorton commented 3 years ago

Thanks @adrn for the update. Sorry I haven't had any time to look at this. I don't think I have any tests in there for using the raw grids outside the context of the interpolation models, but seems like I should do that. Does the code you were trying work if you do get_ichrone('mist', bands=...) first, and then try what you were trying?

adrn commented 3 years ago

Yes it looks like it works with bands=!