Skip to content

Commit

Permalink
Skip bad light curves
Browse files Browse the repository at this point in the history
  • Loading branch information
golmschenk committed Jul 26, 2024
1 parent 57e7e3c commit 7bb66ea
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/qusi/internal/light_curve_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ def observation_iter(self) -> Iterator[LightCurveObservation]:
label = self.load_label_from_path_function(light_curve_path)
light_curve = LightCurve.new(times, fluxes)
light_curve_observation = LightCurveObservation.new(light_curve, label)
light_curve_observation.path = light_curve_path
yield light_curve_observation

def __getitem__(self, index: int) -> LightCurveObservation:
Expand Down
14 changes: 11 additions & 3 deletions src/qusi/internal/light_curve_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,17 @@ def __iter__(self):
injectable_light_curve_collection_iter
)
injectee_light_curve = next(base_collection_iter)
injected_light_curve = inject_light_curve(
injectee_light_curve, injectable_light_curve
)
# TODO: Here's where the error occurs.
try:
injected_light_curve = inject_light_curve(
injectee_light_curve, injectable_light_curve
)
except ValueError as error:
with Path('problem_light_curves.txt').open('a') as problem_files_list_file:
print(f'#############################', flush=True)
print(f'{injectee_light_curve.path}', file=problem_files_list_file, flush=True)
print(f'{injectable_light_curve.path}', file=problem_files_list_file, flush=True)
continue
transformed_injected_light_curve = (
self.post_injection_transform(injected_light_curve)
)
Expand Down

0 comments on commit 7bb66ea

Please sign in to comment.