From 3294a84b84898821115657367bff75c105a97f5e Mon Sep 17 00:00:00 2001 From: Tomas Bylund Date: Wed, 27 Sep 2023 13:52:34 +0200 Subject: [PATCH 1/4] Changed some numpy calls following the numpy 2.0 migration guide --- ctapipe/instrument/camera/geometry.py | 2 +- ctapipe/instrument/camera/image_conversion.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ctapipe/instrument/camera/geometry.py b/ctapipe/instrument/camera/geometry.py index dd55b14425b..50c227db619 100644 --- a/ctapipe/instrument/camera/geometry.py +++ b/ctapipe/instrument/camera/geometry.py @@ -800,7 +800,7 @@ def pixel_moment_matrix(self): x = self.pix_x.value y = self.pix_y.value - return np.row_stack( + return np.vstack( [ x, y, diff --git a/ctapipe/instrument/camera/image_conversion.py b/ctapipe/instrument/camera/image_conversion.py index c4131a77cc5..1e5fd4d7039 100644 --- a/ctapipe/instrument/camera/image_conversion.py +++ b/ctapipe/instrument/camera/image_conversion.py @@ -294,8 +294,8 @@ def get_orthogonal_grid_edges(pix_x, pix_y, scale_aspect=True): # with the maximal extension of the axes and the size of the pixels, # determine the number of bins in each direction - n_bins_x = int(np.round_(np.abs(np.max(pix_x) - np.min(pix_x)) / d_x) + 2) - n_bins_y = int(np.round_(np.abs(np.max(pix_y) - np.min(pix_y)) / d_y) + 2) + n_bins_x = int(np.round(np.abs(np.max(pix_x) - np.min(pix_x)) / d_x) + 2) + n_bins_y = int(np.round(np.abs(np.max(pix_y) - np.min(pix_y)) / d_y) + 2) x_edges = np.linspace(pix_x.min(), pix_x.max(), n_bins_x) y_edges = np.linspace(pix_y.min(), pix_y.max(), n_bins_y) From dcb87483c22f317d6fc2631e46f098d84cc74658 Mon Sep 17 00:00:00 2001 From: Tomas Bylund Date: Wed, 27 Sep 2023 14:00:04 +0200 Subject: [PATCH 2/4] Changelog --- docs/changes/2406.maintenance.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 docs/changes/2406.maintenance.rst diff --git a/docs/changes/2406.maintenance.rst b/docs/changes/2406.maintenance.rst new file mode 100644 index 00000000000..2d4cf50ceac --- /dev/null +++ b/docs/changes/2406.maintenance.rst @@ -0,0 +1 @@ +Updated some numpy calls to not use depreciated functions. From f07bd163e0d3d3bd87691119312abefcda0ba8dc Mon Sep 17 00:00:00 2001 From: Tomas Bylund Date: Wed, 27 Sep 2023 14:08:36 +0200 Subject: [PATCH 3/4] Fix import order --- ctapipe/instrument/camera/image_conversion.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ctapipe/instrument/camera/image_conversion.py b/ctapipe/instrument/camera/image_conversion.py index 1e5fd4d7039..318ebe10be6 100644 --- a/ctapipe/instrument/camera/image_conversion.py +++ b/ctapipe/instrument/camera/image_conversion.py @@ -1,5 +1,5 @@ -import numpy as np import astropy.units as u +import numpy as np __all__ = [ From 5302e0eefd9a4365f9833970ce674b5147ed232f Mon Sep 17 00:00:00 2001 From: Tomas Bylund Date: Wed, 27 Sep 2023 14:13:19 +0200 Subject: [PATCH 4/4] Fix import order --- ctapipe/instrument/camera/image_conversion.py | 1 - 1 file changed, 1 deletion(-) diff --git a/ctapipe/instrument/camera/image_conversion.py b/ctapipe/instrument/camera/image_conversion.py index 318ebe10be6..759375449ca 100644 --- a/ctapipe/instrument/camera/image_conversion.py +++ b/ctapipe/instrument/camera/image_conversion.py @@ -1,7 +1,6 @@ import astropy.units as u import numpy as np - __all__ = [ "unskew_hex_pixel_grid", "reskew_hex_pixel_grid",