In src/pypetal/pipeline.py, run_pipeline() documents line_names=None as the default, but the function currently can’t run in that mode. The problem is that len(line_names) is evaluated before handling the None case:
if len(line_names) != len(fnames):
so with the default argument this immediately raises:
TypeError: object of type 'NoneType' has no len()
Even beyond that, the later “fallback” block for generating default names is also broken: it creates a NumPy array and then tries to use .append(), and it doesn’t include the continuum, so the resulting list would have the wrong length anyway.
A simple fix is to generate sensible default names first, and only then check consistency, e.g.:
if line_names is None:
line_names = ["continuum"] + [f"line{i+1}" for i in range(len(line_fnames))]
This makes the documented default actually usable and keeps the naming consistent with the number of light curves.
In
src/pypetal/pipeline.py,run_pipeline()documentsline_names=Noneas the default, but the function currently can’t run in that mode. The problem is thatlen(line_names)is evaluated before handling theNonecase:if len(line_names) != len(fnames):so with the default argument this immediately raises:
TypeError: object of type 'NoneType' has no len()Even beyond that, the later “fallback” block for generating default names is also broken: it creates a NumPy array and then tries to use
.append(), and it doesn’t include the continuum, so the resulting list would have the wrong length anyway.A simple fix is to generate sensible default names first, and only then check consistency, e.g.:
This makes the documented default actually usable and keeps the naming consistent with the number of light curves.