19
19
from astropy .utils .console import ProgressBar
20
20
from astropy import units as u
21
21
from astropy .time import Time
22
- from pyvo .dal .sia2 import SIA_PARAMETERS_DESC
22
+
23
+ try :
24
+ from pyvo .dal .sia2 import SIA2_PARAMETERS_DESC , SIA2Service
25
+ except ImportError :
26
+ # Can be removed once min version of pyvo is 1.5
27
+ from pyvo .dal .sia2 import SIA_PARAMETERS_DESC as SIA2_PARAMETERS_DESC
28
+ from pyvo .dal .sia2 import SIAService as SIA2Service
23
29
24
30
from ..exceptions import LoginError
25
31
from ..utils import commons
@@ -243,7 +249,7 @@ def datalink_url(self):
243
249
@property
244
250
def sia (self ):
245
251
if not self ._sia :
246
- self ._sia = pyvo . dal . sia2 . SIAService (baseurl = self .sia_url )
252
+ self ._sia = SIA2Service (baseurl = self .sia_url )
247
253
return self ._sia
248
254
249
255
@property
@@ -434,7 +440,7 @@ def query_sia(self, *, pos=None, band=None, time=None, pol=None,
434
440
435
441
Returns
436
442
-------
437
- Results in `pyvo.dal.SIAResults ` format.
443
+ Results in `` pyvo.dal.sia2.SIA2Results` ` format.
438
444
result.table in Astropy table format
439
445
"""
440
446
return self .sia .search (
@@ -458,11 +464,11 @@ def query_sia(self, *, pos=None, band=None, time=None, pol=None,
458
464
maxrec = maxrec ,
459
465
** kwargs )
460
466
461
- # SIA_PARAMETERS_DESC contains links that Sphinx can't resolve.
467
+ # SIA2_PARAMETERS_DESC contains links that Sphinx can't resolve.
462
468
for var in ('POLARIZATION_STATES' , 'CALIBRATION_LEVELS' ):
463
- SIA_PARAMETERS_DESC = SIA_PARAMETERS_DESC .replace (f'`pyvo.dam.obscore.{ var } `' ,
464
- f'pyvo.dam.obscore.{ var } ' )
465
- query_sia .__doc__ = query_sia .__doc__ .replace ('_SIA2_PARAMETERS' , SIA_PARAMETERS_DESC )
469
+ SIA2_PARAMETERS_DESC = SIA2_PARAMETERS_DESC .replace (f'`pyvo.dam.obscore.{ var } `' ,
470
+ f'pyvo.dam.obscore.{ var } ' )
471
+ query_sia .__doc__ = query_sia .__doc__ .replace ('_SIA2_PARAMETERS' , SIA2_PARAMETERS_DESC )
466
472
467
473
def query_tap (self , query , maxrec = None ):
468
474
"""
@@ -498,11 +504,11 @@ def help_tap(self):
498
504
499
505
# update method pydocs
500
506
query_region_async .__doc__ = query_region_async .__doc__ .replace (
501
- '_SIA2_PARAMETERS' , pyvo . dal . sia2 . SIA_PARAMETERS_DESC )
507
+ '_SIA2_PARAMETERS' , SIA2_PARAMETERS_DESC )
502
508
query_object_async .__doc__ = query_object_async .__doc__ .replace (
503
- '_SIA2_PARAMETERS' , pyvo . dal . sia2 . SIA_PARAMETERS_DESC )
509
+ '_SIA2_PARAMETERS' , SIA2_PARAMETERS_DESC )
504
510
query_async .__doc__ = query_async .__doc__ .replace (
505
- '_SIA2_PARAMETERS' , pyvo . dal . sia2 . SIA_PARAMETERS_DESC )
511
+ '_SIA2_PARAMETERS' , SIA2_PARAMETERS_DESC )
506
512
507
513
def _get_dataarchive_url (self ):
508
514
"""
0 commit comments