From 9198fc9ecf53b8568e83878fff42094193f39e2d Mon Sep 17 00:00:00 2001 From: Maximilian Linhoff Date: Mon, 20 Jan 2025 17:07:51 +0100 Subject: [PATCH 1/3] Add sphinx conf.py to RTD config --- .readthedocs.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 6ffd378669e..ff447e4e8f6 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -14,3 +14,6 @@ python: path: . extra_requirements: - docs + +sphinx: + configuration: docs/conf.py From 05c4821d0b9c030fb0b94d152d3aaf5fef32bd03 Mon Sep 17 00:00:00 2001 From: Maximilian Linhoff Date: Mon, 20 Jan 2025 17:11:09 +0100 Subject: [PATCH 2/3] Build RTD on current Ubuntu LTS --- .readthedocs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index ff447e4e8f6..a336585d0ae 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -1,7 +1,7 @@ version: 2 build: - os: ubuntu-22.04 + os: ubuntu-24.04 apt_packages: - ffmpeg - graphviz From bcb7e989d150030ff1f2d5954c45074b92fb5afc Mon Sep 17 00:00:00 2001 From: Maximilian Linhoff Date: Mon, 20 Jan 2025 18:36:18 +0100 Subject: [PATCH 3/3] Add explicit cast necessary in numpy >=2.1 --- docs/changes/2682.maintenance.rst | 1 + src/ctapipe/calib/camera/calibrator.py | 2 +- src/ctapipe/io/simteleventsource.py | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 docs/changes/2682.maintenance.rst diff --git a/docs/changes/2682.maintenance.rst b/docs/changes/2682.maintenance.rst new file mode 100644 index 00000000000..23299e41d16 --- /dev/null +++ b/docs/changes/2682.maintenance.rst @@ -0,0 +1 @@ +Add compatibility with numpy>=2.1. diff --git a/src/ctapipe/calib/camera/calibrator.py b/src/ctapipe/calib/camera/calibrator.py index 3c7683da24d..f367856ccfe 100644 --- a/src/ctapipe/calib/camera/calibrator.py +++ b/src/ctapipe/calib/camera/calibrator.py @@ -204,7 +204,7 @@ def _calibrate_dl0(self, event, tel_id): dl0_pixel_status = r1.pixel_status.copy() # set dvr pixel bit in pixel_status for pixels kept by DVR - dl0_pixel_status[signal_pixels] |= PixelStatus.DVR_STORED_AS_SIGNAL + dl0_pixel_status[signal_pixels] |= np.uint8(PixelStatus.DVR_STORED_AS_SIGNAL) # unset dvr bits for removed pixels dl0_pixel_status[~signal_pixels] &= ~np.uint8(PixelStatus.DVR_STATUS) diff --git a/src/ctapipe/io/simteleventsource.py b/src/ctapipe/io/simteleventsource.py index 4c98e864aac..28bfe5bfbd2 100644 --- a/src/ctapipe/io/simteleventsource.py +++ b/src/ctapipe/io/simteleventsource.py @@ -998,8 +998,8 @@ def _get_r1_pixel_status(self, tel_id, selected_gain_channel): low_gain_stored = selected_gain_channel == GainChannel.LOW # set gain bits - pixel_status[high_gain_stored] |= PixelStatus.HIGH_GAIN_STORED - pixel_status[low_gain_stored] |= PixelStatus.LOW_GAIN_STORED + pixel_status[high_gain_stored] |= np.uint8(PixelStatus.HIGH_GAIN_STORED) + pixel_status[low_gain_stored] |= np.uint8(PixelStatus.LOW_GAIN_STORED) # reset gain bits for completely disabled pixels disabled = tel_desc["disabled_pixels"]["HV_disabled"]