@@ -191,37 +191,53 @@ and change the cache location. Caching persists between Astroquery sessions.
191
191
If you know the service you are using has released new data recently, or if you believe you are
192
192
not recieving the newest data, try clearing the cache.
193
193
194
+ Service specific settings
195
+ ^^^^^^^^^^^^^^^^^^^^^^^^^
194
196
195
- The Astroquery cache location is divided by service, so each service's cache should be managed invidually,
196
- however whether the cache is active and the expiration time are controlled centrally through the
197
- astroquery ``cache_conf `` module. Astroquery uses the Astropy configuration infrastructure, information about
197
+ The Astroquery cache location is specific to individual services,
198
+ so each service's cache should be managed invidually.
199
+ The cache location can be viewed with the following command
200
+ (using `Simbad <simbad/simbad.rst >`_ as an example):
201
+
202
+ .. code-block :: python
203
+
204
+ >> > from astroquery.simbad import Simbad
205
+ >> > print (Simbad.cache_location) # doctest: +IGNORE_OUTPUT
206
+ / Users/ username/ .astropy/ cache/ astroquery/ Simbad
207
+
208
+ Each service's cache is cleared with the `clear_cache ` function within that service.
209
+
210
+ .. code-block :: python
211
+
212
+ >> > import os
213
+ >> > from astroquery.simbad import Simbad
214
+ ...
215
+ >> > os.listdir(Simbad.cache_location) # doctest: +IGNORE_OUTPUT
216
+ [' 8abafe54f49661237bdbc2707179df53b6ee0d74ca6b7679c0e4fac0.pickle' ,
217
+ ' 0e4766a7673ddfa4adaee2cfa27a924ed906badbfae8cc4a4a04256c.pickle' ]
218
+ >> > Simbad.clear_cache()
219
+ >> > os.listdir(Simbad.cache_location) # doctest: +IGNORE_OUTPUT
220
+ []
221
+
222
+ Astroquery-wide settings
223
+ ^^^^^^^^^^^^^^^^^^^^^^^^
224
+
225
+ Whether caching is active and when cached files expire are controlled centrally through the
226
+ astroquery ``cache_conf `` module, and shared among all services.
227
+ Astroquery uses the Astropy configuration infrastructure, information about
198
228
temporarily or permanently changing configuration values can be found
199
229
`here <https://docs.astropy.org/en/latest/config/index.html >`_.
200
230
201
- Shown here are the cache properties, using Simbad as an example:
202
-
203
231
.. code-block :: python
204
232
205
- >> > from astroquery import cache_conf
206
- >> > from astroquery.simbad import Simbad
233
+ >> > from astroquery import cache_conf
207
234
...
208
235
>> > # Is the cache active?
209
236
>> > print (cache_conf.cache_active)
210
237
True
211
238
>> > # Cache timout in seconds
212
239
>> > print (cache_conf.cache_timeout)
213
240
604800
214
- >> > # Cache location
215
- >> > print (Simbad.cache_location) # doctest: +IGNORE_OUTPUT
216
- / Users/ username/ .astropy/ cache/ astroquery/ Simbad
217
-
218
-
219
- To clear the cache:
220
-
221
- .. code-block :: python
222
-
223
- >> > Simbad.clear_cache()
224
-
225
241
226
242
227
243
0 commit comments