Skip to content

Commit a20a0c4

Browse files
committed
main docs update
1 parent 8efac7b commit a20a0c4

File tree

1 file changed

+34
-18
lines changed

1 file changed

+34
-18
lines changed

docs/index.rst

Lines changed: 34 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -191,37 +191,53 @@ and change the cache location. Caching persists between Astroquery sessions.
191191
If you know the service you are using has released new data recently, or if you believe you are
192192
not recieving the newest data, try clearing the cache.
193193

194+
Service specific settings
195+
^^^^^^^^^^^^^^^^^^^^^^^^^
194196

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
198228
temporarily or permanently changing configuration values can be found
199229
`here <https://docs.astropy.org/en/latest/config/index.html>`_.
200230

201-
Shown here are the cache properties, using Simbad as an example:
202-
203231
.. code-block:: python
204232
205-
>>> from astroquery import cache_conf
206-
>>> from astroquery.simbad import Simbad
233+
>>> from astroquery import cache_conf
207234
...
208235
>>> # Is the cache active?
209236
>>> print(cache_conf.cache_active)
210237
True
211238
>>> # Cache timout in seconds
212239
>>> print(cache_conf.cache_timeout)
213240
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-
225241
226242
227243

0 commit comments

Comments
 (0)