Skip to content

Commit 574f865

Browse files
committed
fixing more codestyle issues in core.py
fixing more codestyle issues in core.py
1 parent 90d3373 commit 574f865

File tree

1 file changed

+62
-60
lines changed

1 file changed

+62
-60
lines changed

astroquery/astorbdb/core.py

Lines changed: 62 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,14 @@ def designations_async(self, object_name, *,
5555
>>> from astroquery.astorbdb import AstInfo
5656
>>> designations = AstInfo.designations('Beagle')
5757
>>> print(designations)
58-
OrderedDict({'alternate_designations': ['1954 HJ', 'A908 BJ', 'A917 ST'], 'name': 'Beagle', 'number': 656, 'primary_designation': 'Beagle'})
58+
OrderedDict({'alternate_designations': ['1954 HJ', ...], 'name': 'Beagle', 'number': 656, ...})
5959
"""
6060

6161
self.query_type = 'designations'
6262

6363
response = self._request('GET',
64-
url=self.URL + object_name + '/designations',
65-
timeout=self.TIMEOUT, cache=cache)
64+
url=self.URL + object_name + '/designations',
65+
timeout=self.TIMEOUT, cache=cache)
6666

6767
if get_raw_response:
6868
self._return_raw = True
@@ -73,9 +73,9 @@ def designations_async(self, object_name, *,
7373
return response
7474

7575
def elements_async(self, object_name, *,
76-
get_raw_response=False,
77-
get_uri=False,
78-
cache=True):
76+
get_raw_response=False,
77+
get_uri=False,
78+
cache=True):
7979
"""
8080
This method uses a REST interface to query the `Lowell Observatory
8181
astorbDB database <https://asteroid.lowell.edu/>`_ for orbital element
@@ -101,8 +101,8 @@ def elements_async(self, object_name, *,
101101
self.query_type = 'elements'
102102

103103
response = self._request('GET',
104-
url=self.URL + object_name + '/elements',
105-
timeout=self.TIMEOUT, cache=cache)
104+
url=self.URL + object_name + '/elements',
105+
timeout=self.TIMEOUT, cache=cache)
106106

107107
if get_raw_response:
108108
self._return_raw = True
@@ -135,14 +135,14 @@ def orbit_async(self, object_name, *,
135135
>>> from astroquery.astorbdb import AstInfo
136136
>>> orbit = AstInfo.orbit('Beagle')
137137
>>> print(orbit)
138-
OrderedDict({'a1con': <Quantity 0. AU / d2>, 'a2con': <Quantity 0. AU / d2>, 'a3con': <Quantity 0. AU / d2>, ...})
138+
OrderedDict({'a1con': <Quantity 0. AU / d2>, 'a2con': <Quantity 0. AU / d2>, ...})
139139
"""
140140

141141
self.query_type = 'orbit'
142142

143143
response = self._request('GET',
144-
url=self.URL + object_name + '/orbit',
145-
timeout=self.TIMEOUT, cache=cache)
144+
url=self.URL + object_name + '/orbit',
145+
timeout=self.TIMEOUT, cache=cache)
146146

147147
if get_raw_response:
148148
self._return_raw = True
@@ -153,9 +153,9 @@ def orbit_async(self, object_name, *,
153153
return response
154154

155155
def albedos_async(self, object_name, *,
156-
get_raw_response=False,
157-
get_uri=False,
158-
cache=True):
156+
get_raw_response=False,
157+
get_uri=False,
158+
cache=True):
159159
"""
160160
This method uses a REST interface to query the `Lowell Observatory
161161
astorbDB database <https://asteroid.lowell.edu/>`_ for albedo
@@ -183,8 +183,8 @@ def albedos_async(self, object_name, *,
183183
self.query_type = 'albedos'
184184

185185
response = self._request('GET',
186-
url=self.URL + object_name + '/data/albedos',
187-
timeout=self.TIMEOUT, cache=cache)
186+
url=self.URL + object_name + '/data/albedos',
187+
timeout=self.TIMEOUT, cache=cache)
188188

189189
if get_raw_response:
190190
self._return_raw = True
@@ -195,9 +195,9 @@ def albedos_async(self, object_name, *,
195195
return response
196196

197197
def colors_async(self, object_name, *,
198-
get_raw_response=False,
199-
get_uri=False,
200-
cache=True):
198+
get_raw_response=False,
199+
get_uri=False,
200+
cache=True):
201201
"""
202202
This method uses a REST interface to query the `Lowell Observatory
203203
astorbDB database <https://asteroid.lowell.edu/>`_ for color
@@ -217,8 +217,8 @@ def colors_async(self, object_name, *,
217217
>>> from astroquery.astorbdb import AstInfo
218218
>>> colors = AstInfo.colors('Beagle')
219219
>>> print(colors)
220-
[{'citation_bibcode': '2010PDSS..125.....S', ..., 'color': 0.431, 'color_error': 0.035, ..., 'sys_color': 'J-H'},
221-
{'citation_bibcode': '2010PDSS..125.....S', ..., 'color': 0.076, 'color_error': 0.041, ..., 'sys_color': 'H-K'},
220+
[{..., 'color': 0.431, 'color_error': 0.035, ..., 'sys_color': 'J-H'},
221+
{..., 'color': 0.076, 'color_error': 0.041, ..., 'sys_color': 'H-K'},
222222
...]
223223
"""
224224

@@ -266,8 +266,8 @@ def taxonomies_async(self, object_name, *,
266266
self.query_type = 'taxonomies'
267267

268268
response = self._request('GET',
269-
url=self.URL + object_name + '/data/taxonomies',
270-
timeout=self.TIMEOUT, cache=cache)
269+
url=self.URL + object_name + '/data/taxonomies',
270+
timeout=self.TIMEOUT, cache=cache)
271271

272272
if get_raw_response:
273273
self._return_raw = True
@@ -300,14 +300,14 @@ def lightcurves_async(self, object_name, *,
300300
>>> from astroquery.astorbdb import AstInfo
301301
>>> lightcurves = AstInfo.lightcurves('Beagle')
302302
>>> print(lightcurves)
303-
[{'ambiguous_period': False, ..., 'amp_max': <Quantity 1.2 mag>, 'amp_min': <Quantity 0.57 mag>, ..., 'period': <Quantity 7.035 h>, ...}]
303+
[{..., 'amp_max': <Quantity 1.2 mag>, 'amp_min': <Quantity 0.57 mag>, ..., 'period': <Quantity 7.035 h>, ...}]
304304
"""
305305

306306
self.query_type = 'lightcurves'
307307

308308
response = self._request('GET',
309-
url=self.URL + object_name + '/data/lightcurves',
310-
timeout=self.TIMEOUT, cache=cache)
309+
url=self.URL + object_name + '/data/lightcurves',
310+
timeout=self.TIMEOUT, cache=cache)
311311

312312
if get_raw_response:
313313
self._return_raw = True
@@ -347,8 +347,8 @@ def dynamicalfamily_async(self, object_name, *,
347347
self.query_type = 'dynamicalfamily'
348348

349349
response = self._request('GET',
350-
url=self.URL + object_name + '/data/dynamical-family',
351-
timeout=self.TIMEOUT, cache=cache)
350+
url=self.URL + object_name + '/data/dynamical-family',
351+
timeout=self.TIMEOUT, cache=cache)
352352

353353
if get_raw_response:
354354
self._return_raw = True
@@ -387,8 +387,8 @@ def escaperoutes_async(self, object_name, *,
387387
self.query_type = 'escaperoutes'
388388

389389
response = self._request('GET',
390-
url=self.URL + object_name + '/data/escape-routes',
391-
timeout=self.TIMEOUT, cache=cache)
390+
url=self.URL + object_name + '/data/escape-routes',
391+
timeout=self.TIMEOUT, cache=cache)
392392

393393
if get_raw_response:
394394
self._return_raw = True
@@ -399,9 +399,9 @@ def escaperoutes_async(self, object_name, *,
399399
return response
400400

401401
def all_astinfo_async(self, object_name, *,
402-
get_raw_response=False,
403-
get_uri=False,
404-
cache=True):
402+
get_raw_response=False,
403+
get_uri=False,
404+
cache=True):
405405
"""
406406
This method uses REST interfaces to query the `Lowell Observatory
407407
astorbDB database <https://asteroid.lowell.edu/>`_ for all AstInfo
@@ -421,19 +421,20 @@ def all_astinfo_async(self, object_name, *,
421421
>>> from astroquery.astorbdb import AstInfo
422422
>>> all_astinfo = AstInfo.all_astinfo('Beagle')
423423
>>> print(all_astinfo)
424+
424425
OrderedDict({
425-
'designations': OrderedDict({'alternate_designations': ['1954 HJ', 'A908 BJ', 'A917 ST'], 'name': 'Beagle', ...}),
426+
'designations': OrderedDict({'alternate_designations': ['1954 HJ', ...], 'name': 'Beagle', ...}),
426427
'elements': OrderedDict({'a': <Quantity 3.15597543 AU>, 'aphelion_dist': <Quantity 3.57009832 AU>, ...}),
427-
'orbit': OrderedDict({'a1con': <Quantity 0. AU / d2>, 'a2con': <Quantity 0. AU / d2>, 'a3con': <Quantity 0. AU / d2>, ...}),
428-
'albedos': [{'albedo': 0.065, 'albedo_error_lower': -0.002, 'albedo_error_upper': 0.002, ..., 'survey_name': 'Usui et al. (2011)'},
429-
{'albedo': 0.0625, 'albedo_error_lower': -0.015, 'albedo_error_upper': 0.015, ..., 'survey_name': 'Infrared Astronomical Satellite (IRAS)'},
428+
'orbit': OrderedDict({'a1con': <Quantity 0. AU / d2>, 'a2con': <Quantity 0. AU / d2>, ...}),
429+
'albedos': [{'albedo': 0.065, ..., 'survey_name': 'Usui et al. (2011)'},
430+
{'albedo': 0.0625, ..., 'survey_name': 'Infrared Astronomical Satellite (IRAS)'},
430431
...],
431-
'colors': [{'citation_bibcode': '2010PDSS..125.....S', ..., 'color': 0.431, 'color_error': 0.035, ..., 'sys_color': 'J-H'},
432-
{'citation_bibcode': '2010PDSS..125.....S', ..., 'color': 0.076, 'color_error': 0.041, ..., 'sys_color': 'H-K'},
432+
'colors': [{..., 'color': 0.431, 'color_error': 0.035, ..., 'sys_color': 'J-H'},
433+
{..., 'color': 0.076, 'color_error': 0.041, ..., 'sys_color': 'H-K'},
433434
...],
434-
'taxonomies': [{'citation_bibcode': '2011PDSS..145.....H', ..., 'survey_name': 'Carvano et al. (2010)', 'taxonomy': 'C', ...},
435-
{'citation_bibcode': '2013Icar..226..723D', ..., 'survey_name': 'DeMeo et al. (2013)', 'taxonomy': 'C', ...}],
436-
'lightcurves': [{'ambiguous_period': False, ..., 'amp_max': <Quantity 1.2 mag>, 'amp_min': <Quantity 0.57 mag>, ..., 'period': <Quantity 7.035 h>, ...}],
435+
'taxonomies': [{..., 'survey_name': 'Carvano et al. (2010)', 'taxonomy': 'C', ...},
436+
{..., 'survey_name': 'DeMeo et al. (2013)', 'taxonomy': 'C', ...}],
437+
'lightcurves': [{..., 'amp_max': <Quantity 1.2 mag>, ..., 'period': <Quantity 7.035 h>, ...}],
437438
'dynamicalfamily': [{'citation_bibcode': '2015PDSS..234.....N', ..., 'family': 'Themis', ...},
438439
{'citation_bibcode': '2015PDSS..234.....N', ..., 'family': 'Beagle', ...}],
439440
'escaperoutes': []
@@ -445,40 +446,40 @@ def all_astinfo_async(self, object_name, *,
445446
response = {}
446447

447448
response['designations'] = self._request('GET',
448-
url=self.URL + object_name + '/designations',
449-
timeout=self.TIMEOUT, cache=cache)
449+
url=self.URL + object_name + '/designations',
450+
timeout=self.TIMEOUT, cache=cache)
450451

451452
response['elements'] = self._request('GET',
452-
url=self.URL + object_name + '/elements',
453-
timeout=self.TIMEOUT, cache=cache)
453+
url=self.URL + object_name + '/elements',
454+
timeout=self.TIMEOUT, cache=cache)
454455

455456
response['orbit'] = self._request('GET',
456-
url=self.URL + object_name + '/orbit',
457-
timeout=self.TIMEOUT, cache=cache)
457+
url=self.URL + object_name + '/orbit',
458+
timeout=self.TIMEOUT, cache=cache)
458459

459460
response['albedos'] = self._request('GET',
460-
url=self.URL + object_name + '/data/albedos',
461-
timeout=self.TIMEOUT, cache=cache)
461+
url=self.URL + object_name + '/data/albedos',
462+
timeout=self.TIMEOUT, cache=cache)
462463

463464
response['colors'] = self._request('GET',
464-
url=self.URL + object_name + '/data/colors',
465-
timeout=self.TIMEOUT, cache=cache)
465+
url=self.URL + object_name + '/data/colors',
466+
timeout=self.TIMEOUT, cache=cache)
466467

467468
response['taxonomies'] = self._request('GET',
468-
url=self.URL + object_name + '/data/taxonomies',
469-
timeout=self.TIMEOUT, cache=cache)
469+
url=self.URL + object_name + '/data/taxonomies',
470+
timeout=self.TIMEOUT, cache=cache)
470471

471472
response['lightcurves'] = self._request('GET',
472-
url=self.URL + object_name + '/data/lightcurves',
473-
timeout=self.TIMEOUT, cache=cache)
473+
url=self.URL + object_name + '/data/lightcurves',
474+
timeout=self.TIMEOUT, cache=cache)
474475

475476
response['dynamicalfamily'] = self._request('GET',
476-
url=self.URL + object_name + '/data/dynamical-family',
477-
timeout=self.TIMEOUT, cache=cache)
477+
url=self.URL + object_name + '/data/dynamical-family',
478+
timeout=self.TIMEOUT, cache=cache)
478479

479480
response['escaperoutes'] = self._request('GET',
480-
url=self.URL + object_name + '/data/escape-routes',
481-
timeout=self.TIMEOUT, cache=cache)
481+
url=self.URL + object_name + '/data/escape-routes',
482+
timeout=self.TIMEOUT, cache=cache)
482483

483484
if get_raw_response:
484485
self._return_raw = True
@@ -709,6 +710,7 @@ def _process_data_escaperoutes(self, src):
709710

710711
return src
711712

713+
712714
AstInfo = AstInfoClass()
713715

714716
# once your class is done, tests should be written

0 commit comments

Comments
 (0)