Skip to content

Commit

Permalink
add_nights may be passed as None
Browse files Browse the repository at this point in the history
  • Loading branch information
weaverba137 committed Oct 9, 2024
1 parent 28ff879 commit 087f6fb
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions py/gfa_reduce/scripts/daily_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from .gfa_single_night import _gfa_single_night


def gfa_recent_nights(add_nights=[], workers=8):
def gfa_recent_nights(add_nights=None, workers=8):
"""Process all recent nights with GFA data that have not been processed yet.
This is a wrapper on several other functions.
Expand All @@ -51,8 +51,7 @@ def gfa_recent_nights(add_nights=[], workers=8):
log.debug('Most recent night with raw GFA data: %s', max(nights))
log.debug('Most recent night with processed GFA data: %s', max(processed_nights))


if max(processed_nights) >= max(nights):
if (max(processed_nights) >= max(nights)) and (add_nights is None or len(add_nights) == 0):
log.info('No new raw GFA data to process.')
return

Expand All @@ -67,8 +66,10 @@ def gfa_recent_nights(add_nights=[], workers=8):
t0 = time.time()
num_processed = 0
for night in nights:
_n = _gfa_single_night(night=night, numworkers=workers, out_basedir=out_basedir, guider=True, focus=False, indir=basedir)
num_processed = num_processed + _n
_n = _gfa_single_night(night=night, numworkers=workers,
out_basedir=out_basedir, guider=True, focus=False,
indir=basedir)
num_processed += _n

dt = time.time() - t0

Expand Down

0 comments on commit 087f6fb

Please sign in to comment.