From 47102012c959546987e6b9037271c6bb9e2e1c6d Mon Sep 17 00:00:00 2001 From: Steinn Ymir Agustsson Date: Sun, 5 Nov 2023 00:58:44 +0100 Subject: [PATCH] bugfix --- sed/calibrator/delay.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/sed/calibrator/delay.py b/sed/calibrator/delay.py index 275e4444..219376ac 100644 --- a/sed/calibrator/delay.py +++ b/sed/calibrator/delay.py @@ -35,14 +35,7 @@ def __init__( config (dict, optional): Config dictionary. Defaults to None. """ self._config: dict = config or {} - self.loader: str = self._config["core"]["loader"] - if self.loader == "hextof": - self._append_delay_axis_docstring: str = self.append_delay_axis_hextof.__doc__ - elif self.loader == "mpes": - self._append_delay_axis_docstring = self.append_delay_axis_mpes.__doc__ - else: - raise NotImplementedError(f"Loader '{self.loader}' not implemented.") self.adc_column: str = self._config["dataframe"].get("adc_column", None) self.delay_stage_column: str = self._config["dataframe"].get("delay_stage_column", None) @@ -59,6 +52,10 @@ def append_delay_axis( **kwargs, ) -> Tuple[Union[pd.DataFrame, dask.dataframe.DataFrame], dict]: """TODO: docstring""" + if self.loader not in ["mpes", "hextof"]: + raise NotImplementedError( + f"Delay calibration is implemented for 'mpes' and 'hextof', not {self.loader}.", + ) method = getattr(self, f"append_delay_axis_{self.loader}") return method(df, *args, **kwargs)