Skip to content

Commit 39b536a

Browse files
committed
MAINT: Minor code cleanup, and fixing tests and adding changelog
1 parent 96f0c2d commit 39b536a

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

CHANGES.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ jplhorizons
9090
- Deprecate ``get_raw_response`` options in query methods. The raw response may
9191
be retrieved from the _async() methods. [#2418]
9292

93+
- Adding ``optional_setting`` kwarg to the ephemerides methods to allow
94+
passing additional settings. [#1802]
9395
jplsbdb
9496
^^^^^^^
9597

astroquery/jplhorizons/core.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -628,9 +628,6 @@ def ephemerides_async(self, airmass_lessthan=99,
628628

629629
# inject optional settings if provided
630630
if optional_settings:
631-
assert isinstance(
632-
optional_settings, dict
633-
), "optional_settings should be a dict"
634631
for key, value in optional_settings.items():
635632
request_payload[key] = value
636633

astroquery/jplhorizons/tests/test_jplhorizons.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -197,10 +197,8 @@ def test_ephemerides_query_payload_with_optional_settings():
197197
'stop': '2080-02-01',
198198
'step': '3h'})
199199

200-
optional_settings = {
201-
"R_T_S_ONLY": "TVH",
202-
"TIME_DIGITS": "SECONDS",
203-
}
200+
optional_settings = {"R_T_S_ONLY": "TVH", "TIME_DIGITS": "SECONDS"}
201+
204202
res = obj.ephemerides(airmass_lessthan=1.2, skip_daylight=True,
205203
closest_apparition=True,
206204
max_hour_angle=10,
@@ -209,8 +207,8 @@ def test_ephemerides_query_payload_with_optional_settings():
209207
optional_settings=optional_settings)
210208

211209
assert res == OrderedDict([
212-
('batch', 1),
213-
('TABLE_TYPE', 'OBSERVER'),
210+
('format', 'text'),
211+
('EPHEM_TYPE', 'OBSERVER'),
214212
('QUANTITIES', "'1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,"
215213
"18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,"
216214
"33,34,35,36,37,38,39,40,41,42,43'"),
@@ -221,7 +219,7 @@ def test_ephemerides_query_payload_with_optional_settings():
221219
('CAL_FORMAT', 'BOTH'),
222220
('ANG_FORMAT', 'DEG'),
223221
('APPARENT', 'AIRLESS'),
224-
('REF_SYSTEM', 'J2000'),
222+
('REF_SYSTEM', 'ICRF'),
225223
('EXTRA_PREC', 'NO'),
226224
('CENTER', "'290'"),
227225
('START_TIME', '"2080-01-01"'),

0 commit comments

Comments
 (0)