diff --git a/NuRadioReco/modules/__init__.py b/NuRadioReco/modules/__init__.py index e69de29bb..487c88c90 100644 --- a/NuRadioReco/modules/__init__.py +++ b/NuRadioReco/modules/__init__.py @@ -0,0 +1 @@ +from _deprecated import * \ No newline at end of file diff --git a/NuRadioReco/modules/triggerTimeAdjuster.py b/NuRadioReco/modules/_deprecated/triggerTimeAdjuster.py similarity index 92% rename from NuRadioReco/modules/triggerTimeAdjuster.py rename to NuRadioReco/modules/_deprecated/triggerTimeAdjuster.py index c071487a1..6628e3a4b 100644 --- a/NuRadioReco/modules/triggerTimeAdjuster.py +++ b/NuRadioReco/modules/_deprecated/triggerTimeAdjuster.py @@ -1,6 +1,7 @@ from NuRadioReco.modules.base.module import register_run import numpy as np import logging +import warnings from NuRadioReco.utilities import units logger = logging.getLogger('NuRadioReco.triggerTimeAdjuster') @@ -18,9 +19,9 @@ def __init__(self, log_level=logging.NOTSET): logger.setLevel(log_level) self.__sampling_rate_warning_issued = False self.begin() - logger.warning(f"triggerTimeAdjuster is deprecated and will be removed soon. In most cased you can safely delete the application\ - of this module as it is automatically applied in NuRadioMC simulations. If you really need to use this module, \ - please use the channelReadoutWindowCutter module instead.") + warnings.warn("triggerTimeAdjuster is deprecated and will be removed soon. In most cased you can safely delete the application " + "of this module as it is automatically applied in NuRadioMC simulations. If you really need to use this module, " + "please use the channelReadoutWindowCutter module instead.", DeprecationWarning) def begin(self): pass @@ -79,9 +80,9 @@ def run(self, event, station, detector, mode='sim_to_data'): If the ``trigger_name`` was specified in the ``begin`` function, only this trigger is considered. """ - logger.warning(f"triggerTimeAdjuster is deprecated and will be removed soon. In most cased you can safely delete the application\ - of this module as it is automatically applied in NuRadioMC simulations. If you really need to use this module, \ - please use the channelReadoutWindowCutter module instead.") + warnings.warn("triggerTimeAdjuster is deprecated and will be removed soon. In most cased you can safely delete the application " + "of this module as it is automatically applied in NuRadioMC simulations. If you really need to use this module, " + "please use the channelReadoutWindowCutter module instead.", DeprecationWarning) counter = 0 for i, (name, instance, kwargs) in enumerate(event.iter_modules(station.get_id())): if name == 'triggerTimeAdjuster': diff --git a/NuRadioReco/modules/channelLengthAdjuster.py b/NuRadioReco/modules/channelLengthAdjuster.py index 8e37b40f8..d570fdebb 100644 --- a/NuRadioReco/modules/channelLengthAdjuster.py +++ b/NuRadioReco/modules/channelLengthAdjuster.py @@ -11,8 +11,8 @@ class channelLengthAdjuster: def __init__(self): self.number_of_samples = None self.offset = None - logger.warning("In most cases it is advisable to run a trigger module and use the channelReadoutWindowCutter module to cut the traces to the readout window \ - instead of this simple module.") + logger.warning("In most cases it is advisable to run a trigger module and use the channelReadoutWindowCutter module to cut the traces to the readout window " + "instead of this simple module.") self.begin(()) def begin(self, number_of_samples=256, offset=50):