@@ -72,6 +72,7 @@ class ESASkyClass(BaseQuery):
72
72
_MAPS_DOWNLOAD_DIR = "Maps"
73
73
_SPECTRA_DOWNLOAD_DIR = "Spectra"
74
74
_isTest = ""
75
+ _cached_tables = None
75
76
76
77
_NUMBER_DATA_TYPES = ["REAL" , "float" , "INTEGER" , "int" , "BIGINT" , "long" , "DOUBLE" , "double" , "SMALLINT" , "short" ]
77
78
@@ -111,7 +112,7 @@ def query(self, query, *, output_file=None, output_format="votable", verbose=Fal
111
112
dump_to_file = output_file is not None )
112
113
return job .get_results ()
113
114
114
- def get_tables (self , * , only_names = True , verbose = False ):
115
+ def get_tables (self , * , only_names = True , verbose = False , cache = True ):
115
116
"""
116
117
Get the available table in ESASky TAP service
117
118
@@ -126,10 +127,13 @@ def get_tables(self, *, only_names=True, verbose=False):
126
127
-------
127
128
A list of tables
128
129
"""
129
-
130
- tables = self ._tap .load_tables (only_names = only_names ,
131
- include_shared_tables = False ,
132
- verbose = verbose )
130
+
131
+ if cache and self ._cached_tables is not None :
132
+ tables = self ._cached_tables
133
+ else :
134
+ tables = self ._tap .load_tables (only_names = only_names ,
135
+ include_shared_tables = False ,
136
+ verbose = verbose )
133
137
if only_names :
134
138
return [t .name for t in tables ]
135
139
else :
0 commit comments