From 5ff7186a3d41c2892738bc0c3ec18c4a7138ae0a Mon Sep 17 00:00:00 2001 From: Wei Ji <23487320+weiji14@users.noreply.github.com> Date: Wed, 19 Jun 2024 19:36:50 +1200 Subject: [PATCH] Use int64 dtype for bin_id column instead of uint32 Change to follow the pandas 3.0 default RangeIndex column's dtype. --- pygmt/src/grdhisteq.py | 2 +- pygmt/tests/test_grdhisteq.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pygmt/src/grdhisteq.py b/pygmt/src/grdhisteq.py index 0365f5238dc..352c83cfe9a 100644 --- a/pygmt/src/grdhisteq.py +++ b/pygmt/src/grdhisteq.py @@ -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, ) diff --git a/pygmt/tests/test_grdhisteq.py b/pygmt/tests/test_grdhisteq.py index 76892905269..56e74253f4f 100644 --- a/pygmt/tests/test_grdhisteq.py +++ b/pygmt/tests/test_grdhisteq.py @@ -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):