From a37d517370162b1583307505e9b6be26cd341774 Mon Sep 17 00:00:00 2001 From: Karl Kosack Date: Wed, 3 Jul 2024 15:20:10 +0200 Subject: [PATCH 1/3] Remove some obsolete TODOs --- src/ctapipe/calib/camera/calibrator.py | 8 +------- src/ctapipe/core/provenance.py | 3 --- src/ctapipe/image/pixel_likelihood.py | 4 ---- src/ctapipe/io/simteleventsource.py | 5 +---- src/ctapipe/reco/hillas_intersection.py | 10 ++-------- src/ctapipe/tools/info.py | 4 ---- src/ctapipe/tools/utils.py | 3 --- 7 files changed, 4 insertions(+), 33 deletions(-) diff --git a/src/ctapipe/calib/camera/calibrator.py b/src/ctapipe/calib/camera/calibrator.py index baf3d2f1057..7bfdafd5335 100644 --- a/src/ctapipe/calib/camera/calibrator.py +++ b/src/ctapipe/calib/camera/calibrator.py @@ -244,12 +244,6 @@ def _calibrate_dl1(self, event, tel_id): waveforms -= np.atleast_2d(dl1_calib.pedestal_offset)[..., np.newaxis] if n_samples == 1: - # To handle ASTRI and dst - # TODO: Improved handling of ASTRI and dst - # - dst with custom EventSource? - # - Read into dl1 container directly? - # - Don't do anything if dl1 container already filled - # - Update on SST review decision dl1 = DL1CameraContainer( image=np.squeeze(waveforms).astype(np.float32), peak_time=np.zeros(n_pixels, dtype=np.float32), @@ -322,7 +316,7 @@ def __call__(self, event): event : container A `~ctapipe.containers.ArrayEventContainer` event container """ - # TODO: How to handle different calibrations depending on tel_id? + tel = event.r1.tel or event.dl0.tel or event.dl1.tel for tel_id in tel.keys(): self._calibrate_dl0(event, tel_id) diff --git a/src/ctapipe/core/provenance.py b/src/ctapipe/core/provenance.py index 02ee888ab75..f969bc95c78 100644 --- a/src/ctapipe/core/provenance.py +++ b/src/ctapipe/core/provenance.py @@ -1,8 +1,5 @@ """ Provenance-related functionality - -TODO: have this register whenever ctapipe is loaded - """ import json diff --git a/src/ctapipe/image/pixel_likelihood.py b/src/ctapipe/image/pixel_likelihood.py index a1586f88681..e59538ae569 100644 --- a/src/ctapipe/image/pixel_likelihood.py +++ b/src/ctapipe/image/pixel_likelihood.py @@ -21,10 +21,6 @@ neg_log_likelihood(image, prediction, spe, ped) 59.9 µs per loop -TODO: -===== -- Need to implement more tests, particularly checking for error states -- Additional terms may be useful to add to the likelihood """ import numpy as np diff --git a/src/ctapipe/io/simteleventsource.py b/src/ctapipe/io/simteleventsource.py index e4ff831dacb..7ecf8135a30 100644 --- a/src/ctapipe/io/simteleventsource.py +++ b/src/ctapipe/io/simteleventsource.py @@ -637,10 +637,7 @@ def prepare_subarray_info(self, telescope_descriptions, header): ) except ValueError: telescope = unknown_telescope(mirror_area, n_pixels) - - # TODO: switch to warning or even an exception once - # we start relying on this. - self.log.debug( + self.log.warning( "Could not determine telescope from sim_telarray metadata," " guessing using builtin lookup-table: %d: %s", tel_id, diff --git a/src/ctapipe/reco/hillas_intersection.py b/src/ctapipe/reco/hillas_intersection.py index 603293ba883..2ab4c3e0bf4 100644 --- a/src/ctapipe/reco/hillas_intersection.py +++ b/src/ctapipe/reco/hillas_intersection.py @@ -1,12 +1,6 @@ # Licensed under a 3-clause BSD style license - see LICENSE.rst -""" - -TODO: -- Speed tests, need to be certain the looping on all telescopes is not killing -performance -- Introduce new weighting schemes -- Make intersect_lines code more readable - +"""An alternate implementation of the Hillas line-intersection method that more +closely follows the HESS implementation. """ import itertools import warnings diff --git a/src/ctapipe/tools/info.py b/src/ctapipe/tools/info.py index f100b24e80e..c2d9468b371 100644 --- a/src/ctapipe/tools/info.py +++ b/src/ctapipe/tools/info.py @@ -140,10 +140,6 @@ def _info_tools(): print("the following can be executed by typing ctapipe-:") print("") - # TODO: how to get a one-line description or - # full help text from the docstring or ArgumentParser? - # This is the function names, we want the command-line names - # that are defined in setup.py !??? from textwrap import TextWrapper from ctapipe.tools.utils import get_all_descriptions diff --git a/src/ctapipe/tools/utils.py b/src/ctapipe/tools/utils.py index 5b1e468db93..06916dd21be 100644 --- a/src/ctapipe/tools/utils.py +++ b/src/ctapipe/tools/utils.py @@ -50,9 +50,6 @@ def get_installed_tools(): """Get list of installed scripts via ``pkg-resources``. See https://setuptools.pypa.io/en/latest/pkg_resources.html#convenience-api - - TODO: not sure if this will be useful ... maybe to check if the list - of installed packages matches the available scripts somehow? """ console_tools = { ep.name: ep.value From b47cada3e43550a5745421391ed04974f4c5064f Mon Sep 17 00:00:00 2001 From: Karl Kosack Date: Wed, 3 Jul 2024 15:22:07 +0200 Subject: [PATCH 2/3] add changelog entry --- docs/changes/2573.maintenance.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 docs/changes/2573.maintenance.rst diff --git a/docs/changes/2573.maintenance.rst b/docs/changes/2573.maintenance.rst new file mode 100644 index 00000000000..4de28946442 --- /dev/null +++ b/docs/changes/2573.maintenance.rst @@ -0,0 +1 @@ +Removed some obsolete TODOs scattered around the code From a5b503c07c696317076b3543de1b45e2cba053e0 Mon Sep 17 00:00:00 2001 From: Karl Kosack Date: Wed, 3 Jul 2024 18:01:24 +0200 Subject: [PATCH 3/3] emit only info not warning on telescope type guess --- src/ctapipe/io/simteleventsource.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ctapipe/io/simteleventsource.py b/src/ctapipe/io/simteleventsource.py index 7ecf8135a30..e89bc12f0b4 100644 --- a/src/ctapipe/io/simteleventsource.py +++ b/src/ctapipe/io/simteleventsource.py @@ -637,9 +637,9 @@ def prepare_subarray_info(self, telescope_descriptions, header): ) except ValueError: telescope = unknown_telescope(mirror_area, n_pixels) - self.log.warning( - "Could not determine telescope from sim_telarray metadata," - " guessing using builtin lookup-table: %d: %s", + self.log.info( + "Could not determine telescope type from sim_telarray metadata," + " guessing using builtin lookup-table: tel_id %d: %s", tel_id, telescope, )