From 410712077b6da0de3a3490773dd4d54fbe17d805 Mon Sep 17 00:00:00 2001 From: Olivia Lynn Date: Wed, 18 Sep 2024 10:24:45 -0400 Subject: [PATCH] Raise error on both preset/params=None in PBG; PR formatting comments --- src/tdastro/astro_utils/passbands.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/tdastro/astro_utils/passbands.py b/src/tdastro/astro_utils/passbands.py index 10c8adff..28e1e60c 100644 --- a/src/tdastro/astro_utils/passbands.py +++ b/src/tdastro/astro_utils/passbands.py @@ -53,6 +53,9 @@ def __init__( """ self.passbands = {} + if preset is None and passband_parameters is None: + raise ValueError("PassbandGroup must be initialized with either a preset or passband_parameters.") + if preset is not None: self._load_preset(preset, **kwargs) @@ -330,9 +333,9 @@ def process_transmission_table( Parameters ---------- - delta_wave : Optional[float] = None + delta_wave : Optional[float] = 5.0 The grid step of the wave grid. Default is 5.0 Angstroms. - trim_quantile : Optional[float] = None + trim_quantile : Optional[float] = 1e-3 The quantile to trim the transmission table by. For example, if trim_quantile is 1e-3, the transmission table will be trimmed to include only the central 99.8% of rows. """ @@ -437,6 +440,7 @@ def _normalize_transmission_table(self, transmission_table: np.ndarray) -> np.nd ------- np.ndarray A 2D array of wavelengths and normalized transmissions. + Raises ------ ValueError