Skip to content

Commit

Permalink
Use uint64
Browse files Browse the repository at this point in the history
  • Loading branch information
delucchi-cmu committed Nov 29, 2023
1 parent 71999d6 commit 2968ecf
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/hipscat_import/catalog/map_reduce.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,9 @@ def reduce_pixel_shards(
dataframe["Dir"] = np.full(
rows_written,
fill_value=int(destination_pixel_number / 10_000) * 10_000,
dtype=np.uint32,
dtype=np.uint64,
)
dataframe["Npix"] = np.full(rows_written, fill_value=destination_pixel_number, dtype=np.uint32)
dataframe["Npix"] = np.full(rows_written, fill_value=destination_pixel_number, dtype=np.uint64)

if add_hipscat_index:
## If we had a meaningful index before, preserve it as a column.
Expand Down
4 changes: 2 additions & 2 deletions src/hipscat_import/index/map_reduce.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ def create_index(args):
if args.include_order_pixel:
## Take out the hive dictionary behavior.
data["Norder"] = data["Norder"].astype(np.uint8)
data["Dir"] = data["Dir"].astype(np.uint32)
data["Npix"] = data["Npix"].astype(np.uint32)
data["Dir"] = data["Dir"].astype(np.uint64)
data["Npix"] = data["Npix"].astype(np.uint64)
data = data.reset_index()
if not args.include_hipscat_index:
data = data.drop(columns=[HIPSCAT_ID_COLUMN])
Expand Down
8 changes: 4 additions & 4 deletions tests/hipscat_import/catalog/test_run_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ def test_dask_runner(
pa.field("ra_error", pa.float32()),
pa.field("dec_error", pa.float32()),
pa.field("Norder", pa.uint8()),
pa.field("Dir", pa.uint32()),
pa.field("Npix", pa.uint32()),
pa.field("Dir", pa.uint64()),
pa.field("Npix", pa.uint64()),
pa.field("_hipscat_index", pa.uint64()),
]
)
Expand All @@ -203,8 +203,8 @@ def test_dask_runner(
"ra_error": np.float32,
"dec_error": np.float32,
"Norder": np.uint8,
"Dir": np.uint32,
"Npix": np.uint32,
"Dir": np.uint64,
"Npix": np.uint64,
}
)
assert data_frame.dtypes.equals(expected_dtypes)
Expand Down
4 changes: 2 additions & 2 deletions tests/hipscat_import/index/test_run_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ def test_run_index(
[
pa.field("_hipscat_index", pa.uint64()),
pa.field("Norder", pa.uint8()),
pa.field("Dir", pa.uint32()),
pa.field("Npix", pa.uint32()),
pa.field("Dir", pa.uint64()),
pa.field("Npix", pa.uint64()),
pa.field("id", pa.int64()),
]
)
Expand Down

0 comments on commit 2968ecf

Please sign in to comment.