Skip to content

Commit

Permalink
Merge pull request #2880 from bsipocz/SDSS_use_uint64
Browse files Browse the repository at this point in the history
BUG: SDSS object IDs to use uint64
  • Loading branch information
bsipocz authored Nov 14, 2023
2 parents 8c15f2f + df76e32 commit 56ee8f2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,8 @@ sdss
- Switching to https to avoid issues originating in relying on server side
redirects. [#2654]

- Fix bug to have object IDs as integers on windows. [#2800, #2806]

- Fix bug to have object IDs as unsigned integers, on Windows, too. [#2800,
#2806, #2879]

simbad
^^^^^^
Expand Down
2 changes: 1 addition & 1 deletion astroquery/sdss/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1042,7 +1042,7 @@ def _parse_result(self, response, verbose=False):
arr = Table.read(response.text, format='ascii.csv', comment="#")
for id_column in ('objid', 'specobjid', 'objID', 'specobjID', 'specObjID'):
if id_column in arr.columns:
arr[id_column] = arr[id_column].astype(np.int64)
arr[id_column] = arr[id_column].astype(np.uint64)

if len(arr) == 0:
return None
Expand Down
16 changes: 8 additions & 8 deletions astroquery/sdss/tests/test_sdss.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ class = 'galaxy'
data = Table.read(data_path(DATA_FILES['images_id']),
format='ascii.csv', comment='#')

data['objid'] = data['objid'].astype(np.int64)
data['objid'] = data['objid'].astype(np.uint64)
compare_xid_data(xid, data)
url_tester(dr)

Expand Down Expand Up @@ -248,8 +248,8 @@ def test_sdss_specobj(patch_request, dr):
message=r'OverflowError converting.*')
data = Table.read(data_path(DATA_FILES['spectra_id']),
format='ascii.csv', comment='#')
data['objid'] = data['objid'].astype(np.int64)
data['specobjid'] = data['specobjid'].astype(np.int64)
data['objid'] = data['objid'].astype(np.uint64)
data['specobjid'] = data['specobjid'].astype(np.uint64)
compare_xid_data(xid, data)
url_tester(dr)

Expand All @@ -266,7 +266,7 @@ def test_sdss_photoobj(patch_request, dr):
data = Table.read(data_path(DATA_FILES['images_id']),
format='ascii.csv', comment='#')

data['objid'] = data['objid'].astype(np.int64)
data['objid'] = data['objid'].astype(np.uint64)
compare_xid_data(xid, data)
url_tester(dr)

Expand All @@ -293,7 +293,7 @@ def test_list_coordinates(patch_request, dr, radius, width):
data = Table.read(data_path(DATA_FILES['images_id']),
format='ascii.csv', comment='#')

data['objid'] = data['objid'].astype(np.int64)
data['objid'] = data['objid'].astype(np.uint64)

compare_xid_data(xid, data)
if width is None:
Expand Down Expand Up @@ -331,7 +331,7 @@ def test_list_coordinates_with_height(patch_request, width, height):
data = Table.read(data_path(DATA_FILES['images_id']),
format='ascii.csv', comment='#')

data['objid'] = data['objid'].astype(np.int64)
data['objid'] = data['objid'].astype(np.uint64)

compare_xid_data(xid, data)

Expand All @@ -347,7 +347,7 @@ def test_column_coordinates(patch_request, dr):
data = Table.read(data_path(DATA_FILES['images_id']),
format='ascii.csv', comment='#')

data['objid'] = data['objid'].astype(np.int64)
data['objid'] = data['objid'].astype(np.uint64)

compare_xid_data(xid, data)
url_tester_crossid(dr)
Expand Down Expand Up @@ -379,7 +379,7 @@ def test_query_crossid(patch_request, dr):
data = Table.read(data_path(DATA_FILES['images_id']),
format='ascii.csv', comment='#')

data['objid'] = data['objid'].astype(np.int64)
data['objid'] = data['objid'].astype(np.uint64)

compare_xid_data(xid, data)
url_tester_crossid(dr)
Expand Down

0 comments on commit 56ee8f2

Please sign in to comment.