astropy / astroplan

Observation planning package for astronomers – maintainer @bmorris3
https://astroplan.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
198 stars 109 forks source link

Astropy astropy.utils.data's changed _get_download_cache_locs to _get_download_cache_loc #496

Closed dinsmoro closed 3 years ago

dinsmoro commented 3 years ago

Old Astropy astropy.utils.data: https://astro-docs.readthedocs.io/en/latest/_modules/astropy/utils/data.html w/ _get_download_cache_locs

New (4.2v at this time) astropy.utils.data: https://docs.astropy.org/en/stable/_modules/astropy/utils/data.html#download_file w/ _get_download_cache_loc

To get around the error that _get_download_cache_locs doesn't exist after updating to the latest Astropy, the Astroplan file utils (which was this dir on Windows _conda\Lib\site-packages\astroplan\utils.py) needs to be updated to support the new function.

The new function only returns the datadir not the shelveloc, but luckily the shelveloc is easy to replicate as it is just the datadir path appended with 'urlmap'.

import os needs to be added at the top of ...\astroplan\utils.py

and the old

dldir , urlmapfn = _get_download_cache_locs()

in the function IERS_A_in_cache needs to be come:

dldir = _get_download_cache_loc()
urlmapfn = os.path.join(dldir, 'urlmap')

Edit: looks like I'm stuck on an old verison of Astroplan, as the current astroplan/utils.py uses Astropy's functions for IERS data.