17
17
from . import conf
18
18
from ..utils import async_to_sync , class_or_instance
19
19
from ..exceptions import InvalidQueryError , EmptyResponseError
20
+ from astropy .utils .decorators import deprecated_renamed_argument
20
21
21
22
__all__ = ['MPCClass' ]
22
23
@@ -186,7 +187,7 @@ def query_object_async(self, target_type, *, get_query_payload=False, **kwargs):
186
187
187
188
"""
188
189
189
- self .get_mpc_object_endpoint (target_type )
190
+ self ._get_mpc_object_endpoint (target_type )
190
191
191
192
kwargs ['limit' ] = 1
192
193
return self .query_objects_async (target_type , get_query_payload = get_query_payload , ** kwargs )
@@ -315,7 +316,7 @@ def query_objects_async(self, target_type, *, get_query_payload=False, **kwargs)
315
316
Limit the number of results to the given value
316
317
317
318
"""
318
- mpc_endpoint = self .get_mpc_object_endpoint (target_type )
319
+ mpc_endpoint = self ._get_mpc_object_endpoint (target_type )
319
320
320
321
if (target_type == 'comet' ):
321
322
kwargs ['order_by_desc' ] = "epoch"
@@ -329,7 +330,7 @@ def query_objects_async(self, target_type, *, get_query_payload=False, **kwargs)
329
330
auth = (self .MPC_USERNAME , self .MPC_PASSWORD )
330
331
return self ._request ('GET' , mpc_endpoint , params = request_args , auth = auth )
331
332
332
- def get_mpc_object_endpoint (self , target_type ):
333
+ def _get_mpc_object_endpoint (self , target_type ):
333
334
mpc_endpoint = self .MPC_URL
334
335
if target_type == 'asteroid' :
335
336
mpc_endpoint = mpc_endpoint + '/search_orbits'
@@ -344,8 +345,7 @@ def get_ephemeris_async(self, target, *, location='500', start=None, step='1d',
344
345
proper_motion = 'total' , proper_motion_unit = 'arcsec/h' ,
345
346
suppress_daytime = False , suppress_set = False ,
346
347
perturbed = True , unc_links = False ,
347
- get_query_payload = False ,
348
- get_raw_response = False , cache = False ):
348
+ get_query_payload = False , cache = False ):
349
349
r"""
350
350
Object ephemerides from the Minor Planet Ephemeris Service.
351
351
@@ -436,10 +436,6 @@ def get_ephemeris_async(self, target, *, location='500', start=None, step='1d',
436
436
Return the HTTP request parameters as a dictionary
437
437
(default: ``False``).
438
438
439
- get_raw_response : bool, optional
440
- Return raw data without parsing into a table (default:
441
- ``False``).
442
-
443
439
cache : bool
444
440
Defaults to False. If set overrides global caching behavior.
445
441
See :ref:`caching documentation <astroquery_cache>`.
@@ -486,7 +482,7 @@ def get_ephemeris_async(self, target, *, location='500', start=None, step='1d',
486
482
| P/2003 CP7 | Comet P/2003 CP7 (LINEAR-NEAT) |
487
483
+------------+-----------------------------------+
488
484
489
- For comets, P/ and C/ are interchangable . The designation
485
+ For comets, P/ and C/ are interchangeable . The designation
490
486
may also be in a packed format:
491
487
492
488
+------------+-----------------------------------+
@@ -601,21 +597,18 @@ def get_ephemeris_async(self, target, *, location='500', start=None, step='1d',
601
597
return request_args
602
598
603
599
self .query_type = 'ephemeris'
604
- response = self ._request ('POST' , self .MPES_URL , data = request_args )
600
+ response = self ._request ('POST' , self .MPES_URL , data = request_args , cache = cache )
605
601
606
602
return response
607
603
608
604
@class_or_instance
609
- def get_observatory_codes_async (self , * , get_raw_response = False , cache = True ):
605
+ def get_observatory_codes_async (self , * , cache = True ):
610
606
"""
611
607
Table of observatory codes from the IAU Minor Planet Center.
612
608
613
609
614
610
Parameters
615
611
----------
616
- get_raw_response : bool, optional
617
- Return raw data without parsing into a table (default:
618
- `False`).
619
612
620
613
cache : bool
621
614
Defaults to True. If set overrides global caching behavior.
@@ -771,9 +764,10 @@ def _args_to_ephemeris_payload(self, **kwargs):
771
764
return request_args
772
765
773
766
@class_or_instance
767
+ @deprecated_renamed_argument ("get_raw_response" , None , since = "0.4.8" ,
768
+ alternative = "async methods" )
774
769
def get_observations_async (self , targetid , * ,
775
770
id_type = None ,
776
- comettype = None ,
777
771
get_mpcformat = False ,
778
772
get_raw_response = False ,
779
773
get_query_payload = False ,
@@ -783,6 +777,11 @@ def get_observations_async(self, targetid, *,
783
777
from the `Minor Planet Center observations database
784
778
<https://minorplanetcenter.net/db_search>`_.
785
779
780
+ .. deprecated:: 0.4.8
781
+ The ``get_raw_response`` keyword argument is deprecated. The
782
+ `~MPCClass.get_observations_async` method will return a raw response.
783
+
784
+
786
785
Parameters
787
786
----------
788
787
targetid : int or str
0 commit comments