Fix switch_ts to reset state & clean up IRC when switching TS guesses#866
Fix switch_ts to reset state & clean up IRC when switching TS guesses#866
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes Scheduler.switch_ts() to properly reset state when a TS guess is invalidated, preventing stale jobs/flags from affecting the next TS guess.
Changes:
- Clean up IRC species spawned from the invalidated TS guess (remove jobs, output, species entries, labels).
- Reset per-label
output[label]['job_types']flags andconvergenceso the next guess re-runs the pipeline. - Discard pending pipe-batch entries for the invalidated TS label/directions.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
arc/scheduler.py |
Adds TS-switch cleanup for IRC species, resets job state, and clears pending pipe batches. |
arc/scheduler_test.py |
Adds a unit test intended to validate the cleanup/reset behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
a6cc203 to
a160ef7
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #866 +/- ##
==========================================
+ Coverage 60.11% 60.30% +0.19%
==========================================
Files 102 102
Lines 31045 31073 +28
Branches 8087 8097 +10
==========================================
+ Hits 18664 18740 +76
+ Misses 10067 9994 -73
- Partials 2314 2339 +25
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
a160ef7 to
d66ba64
Compare
alongd
left a comment
There was a problem hiding this comment.
Looks good, but I think the addition should be inside delete_all_species_jobs()
d66ba64 to
ccbfb89
Compare
ccbfb89 to
a267fe7
Compare
|
a267fe7 to
042494c
Compare
042494c to
03fdcba
Compare
When a TS guess fails validation (e.g., NMD check), switch_ts picks the next guess but previously left stale state behind:
1. IRC species from the invalidated guess were never cleaned up. delete_all_species_jobs('TS0') only deletes jobs under the TS0 label, but IRC species like IRC_TS0_1 are separate entries in running_jobs/species_dict/etc. These orphaned species
continued running in parallel with the new guess, potentially interfering with job processing.
2. job_types flags (freq, sp, opt) were never reset. After guess N's freq completed, job_types['freq'] = True carried over to guess N+1, causing the scheduler to skip re-running freq for the new geometry.
3. convergence was never reset to None.
4. The old line self.output[label]['geo'] = ... wrote to the wrong dict level (top-level keys instead of self.output[label]['paths']), making it dead code.
5. Pending pipe batches from the old guess were never discarded.
When a TS guess fails validation (e.g., NMD check), switch_ts picks the next guess but previously left stale state behind:
continued running in parallel with the new guess, potentially interfering with job processing.