Skip to content

Commit

Permalink
extra fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael McCrackan committed Jan 2, 2025
1 parent a077d98 commit 9f19b4d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion sotodlib/preprocess/preprocess_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def get_groups(obs_id, configs, context):

if (gb == 'detset') and (len(group_by) == 1):
groups = context.obsfiledb.get_detsets(obs_id)
return group_by, [[g] for g in groups]
return group_by, [[g] for g in groups], None

det_info = context.get_det_info(obs_id)
rs = det_info.subset(keys=group_by).distinct()
Expand Down
9 changes: 5 additions & 4 deletions sotodlib/site_pipeline/preprocess_tod.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ def preprocess_tod(obs_id,
group_by, groups, error = pp_util.get_groups(obs_id, configs, context)

if error is not None:
return error[0], [None, None]
if run_parallel:
return error[0], [None, None]
else:
return

all_groups = groups.copy()
for g in all_groups:
Expand Down Expand Up @@ -330,7 +333,6 @@ def main(

# clean up lingering files from previous incomplete runs
policy_dir = os.path.dirname(configs['archive']['policy']['filename']) + '/temp/'
print(policy_dir)
for obs in obs_list:
obs_id = obs['obs_id']
found = False
Expand Down Expand Up @@ -361,7 +363,6 @@ def main(
run_list.append( (obs, None) )
else:
group_by, groups, _ = pp_util.get_groups(obs["obs_id"], configs, context)

if len(x) != len(groups):
[groups.remove([a[f'dets:{gb}'] for gb in group_by]) for a in x]
run_list.append( (obs, groups) )
Expand Down Expand Up @@ -403,7 +404,7 @@ def main(
continue
futures.remove(future)

if db_datasets:
if err is None and db_datasets:
logger.info(f'Processing future result db_dataset: {db_datasets}')
for db_dataset in db_datasets:
pp_util.cleanup_mandb(err, db_dataset, configs, logger)
Expand Down

0 comments on commit 9f19b4d

Please sign in to comment.