Skip to content

Commit

Permalink
Simplify dry-run of calibrations
Browse files Browse the repository at this point in the history
  • Loading branch information
albireox committed Jan 31, 2025
1 parent 8062dee commit 5483863
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/gort/overwatcher/calibrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,8 +557,6 @@ def __init__(

self._calibration_task: asyncio.Task | None = None

self._ignore_cals: set[str] = set()

async def reset(self, cals_file: str | pathlib.Path | None = None):
"""Resets the list of calibrations for a new SJD.
Expand All @@ -574,8 +572,6 @@ async def reset(self, cals_file: str | pathlib.Path | None = None):
if cals_file is not None:
self.cals_file = cals_file

self._ignore_cals = set()

try:
self.schedule.update_schedule(self.cals_file)
except Exception as ee:
Expand Down Expand Up @@ -603,16 +599,13 @@ async def run_calibration(self, calibration: Calibration):
dome = calibration.model.dome
recipe = calibration.model.recipe

if name in self._ignore_cals:
return

if calibration.is_finished():
self.log.warning(f"Calibration {name} is already finished. Skipping.")
return

if self.overwatcher.state.dry_run:
self.log.warning(f"Dry-run mode. Not running calibration {name}.")
self._ignore_cals.add(name)
self.log.warning(f"Dry-run mode. Marking calibration {name} done.")
await calibration.record_state(CalibrationState.DONE)
return

running_cal = self.get_running_calibration()
Expand Down

0 comments on commit 5483863

Please sign in to comment.