Skip to content

Commit

Permalink
fix(processing): preserve order of pending items
Browse files Browse the repository at this point in the history
This fix means that the order of pending items is preserved and ensures
that the ranges given in the daily processing don't lead to duplicate
days.
  • Loading branch information
jrs65 committed May 7, 2020
1 parent 888fd42 commit 59bc24c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 3 additions & 2 deletions ch_pipeline/processing/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,9 +339,10 @@ def pending(self):
"""Jobs available to run."""

waiting, running = self.queued()
pending = set(self.available()).difference(self.ls(), waiting, running)
not_pending = set(self.ls()) | set(waiting) | set(running)
pending = [job for job in self.available() if job not in not_pending]

return sorted(list(pending))
return pending


def find_venv():
Expand Down
6 changes: 5 additions & 1 deletion ch_pipeline/processing/daily.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,12 @@ def _available_tags(self):
# - Figure out which sidereal days are covered by this range

csds = []

# For each interval find and add all CSDs that have not already been added
for interval in self._intervals:
csds += csds_in_range(*interval)
csd_i = csds_in_range(*interval)
csd_set = set(csds)
csds += [csd for csd in csd_i if csd not in csd_set]

tags = ["%i" % csd for csd in csds]

Expand Down

0 comments on commit 59bc24c

Please sign in to comment.