@@ -107,8 +107,6 @@ class EsoClass(QueryWithLogin):
107
107
108
108
def __init__ (self ):
109
109
super ().__init__ ()
110
- self ._instruments : Optional [List [str ]] = None
111
- self ._surveys : Optional [List [str ]] = None
112
110
self ._auth_info : Optional [AuthInfo ] = None
113
111
self ._hash = None
114
112
self ._maxrec = None
@@ -287,45 +285,46 @@ def query_tap_service(self,
287
285
return table_to_return
288
286
289
287
@unlimited_max_rec
290
- def list_instruments (self ) -> List [str ]:
291
- """ List all the available instrument-specific queries offered by the ESO archive.
288
+ @deprecated_renamed_argument ('cache' , None , since = '0.4.11' )
289
+ def list_instruments (self , cache = True ) -> List [str ]:
290
+ """
291
+ List all the available instrument-specific queries offered by the ESO archive.
292
292
293
293
Returns
294
294
-------
295
295
instrument_list : list of strings
296
+ cache : bool
297
+ Deprecated - unused.
296
298
"""
297
- if self ._instruments is None :
298
- self ._instruments = []
299
- query_str = ("select table_name from TAP_SCHEMA.tables "
300
- "where schema_name='ist' order by table_name" )
301
- res = self .query_tap_service (query_str )["table_name" ].data
302
- self ._instruments = list (map (lambda x : x .split ("." )[1 ], res ))
303
- if len (self ._instruments ) < 1 :
304
- self ._instruments = None
305
- return self ._instruments
299
+ _ = cache # We're aware about disregarding the argument
300
+ query_str = ("select table_name from TAP_SCHEMA.tables "
301
+ "where schema_name='ist' order by table_name" )
302
+ res = self .query_tap_service (query_str )["table_name" ].data
303
+ l_res = list (map (lambda x : x .split ("." )[1 ], res ))
304
+
305
+ return l_res
306
306
307
307
@unlimited_max_rec
308
- def list_surveys (self ) -> List [str ]:
309
- """ List all the available surveys (phase 3) in the ESO archive.
308
+ @deprecated_renamed_argument ('cache' , None , since = '0.4.11' )
309
+ def list_surveys (self , * , cache = True ) -> List [str ]:
310
+ """
311
+ List all the available surveys (phase 3) in the ESO archive.
310
312
311
313
Returns
312
314
-------
313
315
collection_list : list of strings
314
316
cache : bool
315
- Defaults to True. If set overrides global caching behavior.
316
- See :ref:`caching documentation <astroquery_cache>`.
317
+ Deprecated - unused.
317
318
"""
318
- if self ._surveys is None :
319
- self ._surveys = []
320
- t = EsoNames .phase3_table
321
- c = EsoNames .phase3_surveys_column
322
- query_str = f"select distinct { c } from { t } "
323
- res = self .query_tap_service (query_str )[c ].data
324
- self ._surveys = list (res )
325
- return self ._surveys
319
+ _ = cache # We're aware about disregarding the argument
320
+ t = EsoNames .phase3_table
321
+ c = EsoNames .phase3_surveys_column
322
+ query_str = f"select distinct { c } from { t } "
323
+ res = list (self .query_tap_service (query_str )[c ].data )
324
+ return res
326
325
327
326
@unlimited_max_rec
328
- def print_table_help (self , table_name : str ) -> None :
327
+ def _print_table_help (self , table_name : str ) -> None :
329
328
"""
330
329
Prints the columns contained in a given table
331
330
"""
@@ -372,7 +371,7 @@ def _query_on_allowed_values(
372
371
filters = {** dict (kwargs )}
373
372
374
373
if print_help :
375
- self .print_table_help (table_name )
374
+ self ._print_table_help (table_name )
376
375
return
377
376
378
377
if (('box' in filters )
@@ -427,6 +426,65 @@ def query_surveys(
427
426
column_filters : Optional [dict ] = None ,
428
427
open_form : bool = False , cache : bool = False ,
429
428
** kwargs ) -> Union [astropy .table .Table , int , str ]:
429
+ """
430
+ Query survey Phase 3 data contained in the ESO archive.
431
+
432
+ Parameters
433
+ ----------
434
+ survey : string or list
435
+ Name of the survey(s) to query. Should be one or more of the
436
+ names returned by `~astroquery.eso.EsoClass.list_surveys`. If
437
+ specified as a string, should be a comma-separated list of
438
+ survey names.
439
+ ra : float
440
+ Cone Search Center - Right Ascention in deg.
441
+ dec : float
442
+ Cone Search Center - Declination in deg.
443
+ radius : float
444
+ Cone Search Radius in deg.
445
+ columns: string or list of strings
446
+ Name of the columns the query should return.
447
+ If specified as a string, should be a comma-separated list
448
+ of column names.
449
+ top : int
450
+ When set top = N, returns only the top N records.
451
+ count_only : bool
452
+ Defaults to `False`.
453
+ When set to `True`, returns only an `int`: the count
454
+ of the records the query would return when set to `False`.
455
+ query_str_only : bool
456
+ Defaults to `False`.
457
+ When set to `True`, returns only a `str`: the query
458
+ string that would be issued to the TAP service.
459
+ help : bool
460
+ If `True`, prints all the parameters accepted in
461
+ ``column_filters`` and ``columns``.
462
+ authenticated : bool
463
+ If `True`, run the query as an authenticated user.
464
+ Authentication must be done beforehand via
465
+ `~astroquery.eso.EsoClass.login`
466
+ Note that authenticated queries take longer.
467
+ column_filters : dict
468
+ Constraints applied to the query.
469
+ open_form : bool
470
+ Deprecated - unused.
471
+ cache : bool
472
+ Deprecated - unused.
473
+
474
+ Returns
475
+ -------
476
+ table : `~astropy.table.Table`, `str`, `int` or `None`
477
+ A table representing the data available in the archive for the
478
+ specified columns and constraints.
479
+ `None` is returned when the query has no results.
480
+
481
+ When ``count_only`` is `True`, returns as an `int` record
482
+ count for the specified filters.
483
+
484
+ When ``query_str_only`` is `True`, returns the query string
485
+ that would be issued to the TAP service given the specified
486
+ arguments.
487
+ """
430
488
_ = open_form , cache # make explicit that we are aware these arguments are unused
431
489
c = column_filters if column_filters else {}
432
490
kwargs = {** kwargs , ** c }
0 commit comments