Skip to content

Commit 7bb66ea

Browse files
committed
Skip bad light curves
1 parent 57e7e3c commit 7bb66ea

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

src/qusi/internal/light_curve_collection.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ def observation_iter(self) -> Iterator[LightCurveObservation]:
275275
label = self.load_label_from_path_function(light_curve_path)
276276
light_curve = LightCurve.new(times, fluxes)
277277
light_curve_observation = LightCurveObservation.new(light_curve, label)
278+
light_curve_observation.path = light_curve_path
278279
yield light_curve_observation
279280

280281
def __getitem__(self, index: int) -> LightCurveObservation:

src/qusi/internal/light_curve_dataset.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,17 @@ def __iter__(self):
134134
injectable_light_curve_collection_iter
135135
)
136136
injectee_light_curve = next(base_collection_iter)
137-
injected_light_curve = inject_light_curve(
138-
injectee_light_curve, injectable_light_curve
139-
)
137+
# TODO: Here's where the error occurs.
138+
try:
139+
injected_light_curve = inject_light_curve(
140+
injectee_light_curve, injectable_light_curve
141+
)
142+
except ValueError as error:
143+
with Path('problem_light_curves.txt').open('a') as problem_files_list_file:
144+
print(f'#############################', flush=True)
145+
print(f'{injectee_light_curve.path}', file=problem_files_list_file, flush=True)
146+
print(f'{injectable_light_curve.path}', file=problem_files_list_file, flush=True)
147+
continue
140148
transformed_injected_light_curve = (
141149
self.post_injection_transform(injected_light_curve)
142150
)

0 commit comments

Comments
 (0)