Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: grdhisteq.compute_bins: use int64 dtype for bin_id column instead of uint32 #3294

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Use int64 dtype for bin_id column instead of uint32
Change to follow the pandas 3.0 default RangeIndex column's dtype.
  • Loading branch information
weiji14 committed Jun 19, 2024
commit 5ff7186a3d41c2892738bc0c3ec18c4a7138ae0a
2 changes: 1 addition & 1 deletion pygmt/src/grdhisteq.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def compute_bins(
dtype={
"start": np.float32,
"stop": np.float32,
"bin_id": np.uint32,
"bin_id": np.int64,
},
index_col="bin_id" if output_type == "pandas" else None,
)
2 changes: 1 addition & 1 deletion pygmt/tests/test_grdhisteq.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def fixture_expected_df():
return pd.DataFrame(
data=np.array([[345.5, 519.5, 0], [519.5, 726.5, 1]]),
columns=["start", "stop", "bin_id"],
).astype({"start": np.float32, "stop": np.float32, "bin_id": np.uint32})
).astype({"start": np.float32, "stop": np.float32, "bin_id": np.int64})


def test_equalize_grid_outgrid_file(grid, expected_grid, region):
Expand Down