@@ -144,8 +144,8 @@ def url_tester_crossid(data_release):
144144
145145def compare_xid_data (xid , data ):
146146 for col in xid .colnames :
147- if xid [col ].dtype .type is np .string_ :
148- assert xid [col ] == data [col ]
147+ if xid [col ].dtype .type is np .str_ :
148+ assert all ( xid [col ] == data [col ])
149149 else :
150150 assert_allclose (xid [col ], data [col ])
151151
@@ -196,10 +196,7 @@ class = 'galaxy'
196196 xid = sdss .SDSS .query_sql (query , data_release = dr )
197197 data = Table .read (data_path (DATA_FILES ['images_id' ]),
198198 format = 'ascii.csv' , comment = '#' )
199- # The following line is needed for systems where the default integer type
200- # is int32, the column will then be interpreted as string which makes the
201- # test fail.
202- data ['objid' ] = data ['objid' ].astype (np .int64 )
199+
203200 compare_xid_data (xid , data )
204201 url_tester (dr )
205202
@@ -237,11 +234,7 @@ def test_sdss_specobj(patch_request, dr):
237234 xid = sdss .SDSS .query_specobj (plate = 2340 , data_release = dr )
238235 data = Table .read (data_path (DATA_FILES ['spectra_id' ]),
239236 format = 'ascii.csv' , comment = '#' )
240- # The following line is needed for systems where the default integer type
241- # is int32, the column will then be interpreted as string which makes the
242- # test fail.
243- data ['specobjid' ] = data ['specobjid' ].astype (np .int64 )
244- data ['objid' ] = data ['objid' ].astype (np .int64 )
237+
245238 compare_xid_data (xid , data )
246239 url_tester (dr )
247240
@@ -252,10 +245,6 @@ def test_sdss_photoobj(patch_request, dr):
252245 run = 1904 , camcol = 3 , field = 164 , data_release = dr )
253246 data = Table .read (data_path (DATA_FILES ['images_id' ]),
254247 format = 'ascii.csv' , comment = '#' )
255- # The following line is needed for systems where the default integer type
256- # is int32, the column will then be interpreted as string which makes the
257- # test fail.
258- data ['objid' ] = data ['objid' ].astype (np .int64 )
259248 compare_xid_data (xid , data )
260249 url_tester (dr )
261250
@@ -265,10 +254,6 @@ def test_list_coordinates(patch_request, dr):
265254 xid = sdss .SDSS .query_region (coords_list , data_release = dr )
266255 data = Table .read (data_path (DATA_FILES ['images_id' ]),
267256 format = 'ascii.csv' , comment = '#' )
268- # The following line is needed for systems where the default integer type
269- # is int32, the column will then be interpreted as string which makes the
270- # test fail.
271- data ['objid' ] = data ['objid' ].astype (np .int64 )
272257 compare_xid_data (xid , data )
273258 url_tester_crossid (dr )
274259
@@ -278,10 +263,6 @@ def test_column_coordinates(patch_request, dr):
278263 xid = sdss .SDSS .query_region (coords_column , data_release = dr )
279264 data = Table .read (data_path (DATA_FILES ['images_id' ]),
280265 format = 'ascii.csv' , comment = '#' )
281- # The following line is needed for systems where the default integer type
282- # is int32, the column will then be interpreted as string which makes the
283- # test fail.
284- data ['objid' ] = data ['objid' ].astype (np .int64 )
285266 compare_xid_data (xid , data )
286267 url_tester_crossid (dr )
287268
@@ -306,10 +287,6 @@ def test_query_crossid(patch_request, dr):
306287 xid = sdss .SDSS .query_crossid (coords_column , data_release = dr )
307288 data = Table .read (data_path (DATA_FILES ['images_id' ]),
308289 format = 'ascii.csv' , comment = '#' )
309- # The following line is needed for systems where the default integer type
310- # is int32, the column will then be interpreted as string which makes the
311- # test fail.
312- data ['objid' ] = data ['objid' ].astype (np .int64 )
313290 compare_xid_data (xid , data )
314291 url_tester_crossid (dr )
315292
0 commit comments