@@ -15,6 +15,7 @@ def test_ephemerides_query(self):
1515 # check values of Ceres for a given epoch
1616 # orbital uncertainty of Ceres is basically zero
1717 res = jplhorizons .Horizons (id = 'Ceres' , location = '500' ,
18+ id_type = 'smallbody' ,
1819 epochs = 2451544.5 ).ephemerides ()[0 ]
1920
2021 assert res ['targetname' ] == "1 Ceres (A801 AA)"
@@ -152,7 +153,7 @@ def test_ephemerides_query_five(self):
152153
153154 def test_ephemerides_query_six (self ):
154155 # tests optional constrains for ephemerides queries
155- obj = jplhorizons .Horizons (id = '3552' ,
156+ obj = jplhorizons .Horizons (id = '3552' , id_type = 'smallbody' ,
156157 location = 'I33' ,
157158 epochs = {'start' : '2018-05-01' ,
158159 'stop' : '2018-08-01' ,
@@ -169,13 +170,14 @@ def test_ephemerides_query_six(self):
169170
170171 def test_ephemerides_query_raw (self ):
171172 res = (jplhorizons .Horizons (id = 'Ceres' , location = '500' ,
172- epochs = 2451544.5 ).
173+ id_type = 'smallbody' , epochs = 2451544.5 ).
173174 ephemerides (get_raw_response = True ))
174175
175176 assert len (res ) >= 15400
176177
177178 def test_elements_query (self ):
178179 res = jplhorizons .Horizons (id = 'Ceres' , location = '500@10' ,
180+ id_type = 'smallbody' ,
179181 epochs = [2451544.5 ,
180182 2451545.5 ]).elements ()[0 ]
181183
@@ -204,6 +206,7 @@ def test_elements_query(self):
204206
205207 def test_elements_query_two (self ):
206208 obj = jplhorizons .Horizons (id = 'Ceres' , location = '500@10' ,
209+ id_type = 'smallbody' ,
207210 epochs = [2451544.5 ,
208211 2451545.5 ])
209212
@@ -219,6 +222,7 @@ def test_elements_query_two(self):
219222
220223 def test_elements_query_raw (self ):
221224 res = jplhorizons .Horizons (id = 'Ceres' , location = '500@10' ,
225+ id_type = 'smallbody' ,
222226 epochs = 2451544.5 ).elements (
223227 get_raw_response = True )
224228
@@ -228,6 +232,7 @@ def test_vectors_query(self):
228232 # check values of Ceres for a given epoch
229233 # orbital uncertainty of Ceres is basically zero
230234 res = jplhorizons .Horizons (id = 'Ceres' , location = '500@10' ,
235+ id_type = 'smallbody' ,
231236 epochs = 2451544.5 ).vectors ()[0 ]
232237
233238 assert res ['targetname' ] == "1 Ceres (A801 AA)"
@@ -251,28 +256,25 @@ def test_vectors_query(self):
251256
252257 def test_vectors_query_raw (self ):
253258 res = jplhorizons .Horizons (id = 'Ceres' , location = '500@10' ,
259+ id_type = 'smallbody' ,
254260 epochs = 2451544.5 ).vectors (
255261 get_raw_response = True )
256262
257263 assert len (res ) >= 6412
258264
259265 def test_unknownobject (self ):
260- try :
266+ with pytest . raises ( ValueError ) :
261267 jplhorizons .Horizons (id = 'spamspamspameggsspam' , location = '500' ,
262268 epochs = 2451544.5 ).ephemerides ()
263- except ValueError :
264- pass
265269
266270 def test_multipleobjects (self ):
267- try :
268- jplhorizons .Horizons (id = '73P' , location = '500' ,
271+ with pytest . raises ( ValueError ) :
272+ jplhorizons .Horizons (id = '73P' , location = '500' , id_type = 'smallbody' ,
269273 epochs = 2451544.5 ).ephemerides ()
270- except ValueError :
271- pass
272274
273275 def test_uri (self ):
274276 target = jplhorizons .Horizons (id = '3552' , location = '500' ,
275- epochs = 2451544.5 )
277+ id_type = 'smallbody' , epochs = 2451544.5 )
276278 assert target .uri is None
277279
278280 target .ephemerides ()
@@ -299,10 +301,12 @@ def test__userdefinedlocation_ephemerides_query(self):
299301
300302 am_res = jplhorizons .Horizons (id = 'Ceres' ,
301303 location = '688' ,
304+ id_type = 'smallbody' ,
302305 epochs = 2451544.5 ).ephemerides ()[0 ]
303306
304307 user_res = jplhorizons .Horizons (id = 'Ceres' ,
305308 location = anderson_mesa ,
309+ id_type = 'smallbody' ,
306310 epochs = 2451544.5 ).ephemerides ()[0 ]
307311
308312 assert_quantity_allclose ([am_res ['RA' ], am_res ['DEC' ]],
@@ -342,6 +346,7 @@ def test_airmass(self):
342346
343347 # verify data['a-mass'].filled(99) works:
344348 target = jplhorizons .Horizons ('Ceres' , location = 'I41' ,
349+ id_type = 'smallbody' ,
345350 epochs = [2458300.5 ])
346351 eph = target .ephemerides (quantities = '1,8' )
347352 assert len (eph ) == 1
@@ -352,7 +357,8 @@ def test_airmass(self):
352357
353358 def test_vectors_aberrations (self ):
354359 """Check functionality of `aberrations` options"""
355- obj = jplhorizons .Horizons (id = '1' , epochs = 2458500 , location = '500@0' )
360+ obj = jplhorizons .Horizons (id = '1' , epochs = 2458500 , location = '500@0' ,
361+ id_type = 'smallbody' )
356362
357363 vec = obj .vectors (aberrations = 'geometric' )
358364 assert_quantity_allclose (vec ['x' ][0 ], - 2.086487005013347 )
@@ -364,7 +370,8 @@ def test_vectors_aberrations(self):
364370 assert_quantity_allclose (vec ['x' ][0 ], - 2.086576286974797 )
365371
366372 def test_vectors_delta_T (self ):
367- obj = jplhorizons .Horizons (id = '1' , epochs = 2458500 , location = '500@0' )
373+ obj = jplhorizons .Horizons (id = '1' , epochs = 2458500 , location = '500@0' ,
374+ id_type = 'smallbody' )
368375
369376 vec = obj .vectors (delta_T = False )
370377 assert 'delta_T' not in vec .columns
@@ -373,7 +380,8 @@ def test_vectors_delta_T(self):
373380 assert_quantity_allclose (vec ['delta_T' ][0 ], 69.184373 )
374381
375382 def test_ephemerides_extraprecision (self ):
376- obj = jplhorizons .Horizons (id = '1' , epochs = 2458500 , location = 'G37' )
383+ obj = jplhorizons .Horizons (id = '1' , epochs = 2458500 , location = 'G37' ,
384+ id_type = 'smallbody' )
377385
378386 vec_simple = obj .ephemerides (extra_precision = False )
379387 vec_highprec = obj .ephemerides (extra_precision = True )
0 commit comments