Skip to content

Commit

Permalink
Raise error on both preset/params=None in PBG; PR formatting comments
Browse files Browse the repository at this point in the history
  • Loading branch information
OliviaLynn committed Sep 18, 2024
1 parent 3e19987 commit 4107120
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/tdastro/astro_utils/passbands.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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.
"""
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4107120

Please sign in to comment.