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

Changed some numpy calls following the numpy 2.0 migration guide #2406

Merged
merged 4 commits into from
Oct 21, 2023
Merged
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
2 changes: 1 addition & 1 deletion ctapipe/instrument/camera/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
7 changes: 3 additions & 4 deletions ctapipe/instrument/camera/image_conversion.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import numpy as np
import astropy.units as u

import numpy as np

__all__ = [
"unskew_hex_pixel_grid",
Expand Down Expand Up @@ -294,8 +293,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)

Expand Down
1 change: 1 addition & 0 deletions docs/changes/2406.maintenance.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Updated some numpy calls to not use depreciated functions.