Closed stargaser closed 1 year ago
See also issue astropy/astroquery#1239 on improving the caching documentation in astroquery.
cc @ceb8 - do you see you'll have time any time soon to improve the caching docs?
@bsipocz Yep! I will start work on this next week!
@stargaser The current caching infrastructure is relatively new and it seems like maybe you are running your notebook with an older version of astroquery, which is why cache_conf
and Ned.cache_location()
are not available. Prior to the caching system overhaul the only way to clear the cache was deleting it manually.
Also with the new update, cached files expire after one week, so hopefully problems like this will occur less frequently.
Thanks @ceb8, I'm running astroquery 0.4.6 which was released over 14 months ago. I see the caching docs don't appear with that version on RTD. So really the issue is that we're installing from conda-forge and not getting the new updates.
astroquery should always be pip installed, and with --pre
, and since it's pure python it should cause any issues anyway.
The NED queries at the end of the QuickReference and UseCase_I notebooks are failing for me with
ModuleNotFoundError: No module named 'astroquery.ned.core'
. I traced this to cached queries dating from May and November 2021 in the~/.astropy/cache/astroquery
cache such as/Users/shupe/.astropy/cache/astroquery/Ned/a2ead32ef8047db0ff18723913d9eec28e82092e07e7917bfe947461.pickle
.To clear the NED cache, based on the astroquery caching documentation I would expect
Ned.clear_cache()
to work, but that method is missing. I would also expect the caching to only last a week, but these old cache files are being used.from astroquery import cache_conf
also fails withImportError: cannot import name 'cache_conf' from 'astroquery'
.The only remedy I found is to do
print(Ned.cache_location)
and then remove the contents of that directory from a terminal. That fixed it.A new user won't run into this problem so it may not be worth documenting the solution in the notebooks.