From ad2c2ce341261fc6e4e4456e1ab11472f9e230ad Mon Sep 17 00:00:00 2001 From: Alessio Berti Date: Mon, 23 Mar 2026 16:24:02 +0100 Subject: [PATCH] Remove deprecated pkg_resources and use importlib. --- ctapipe_io_magic/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ctapipe_io_magic/__init__.py b/ctapipe_io_magic/__init__.py index 96f5edc..03d12eb 100644 --- a/ctapipe_io_magic/__init__.py +++ b/ctapipe_io_magic/__init__.py @@ -15,7 +15,7 @@ from decimal import Decimal from astropy import units as u from astropy.time import Time -from pkg_resources import resource_filename +from importlib.resources import files from ctapipe.io import EventSource, DataLevel from ctapipe.core import Provenance, Container, Field @@ -159,7 +159,7 @@ class ReportLaserContainer(Container): def load_camera_geometry(): """Load camera geometry from bundled resources of this repo""" - f = resource_filename("ctapipe_io_magic", "resources/MAGICCam.camgeom.fits.gz") + f = str(files("ctapipe_io_magic") / "resources/MAGICCam.camgeom.fits.gz") Provenance().add_input_file(f, role="CameraGeometry") return CameraGeometry.from_table(f)