Skip to content

Commit

Permalink
Fix end of file issues and add --outfile to desi_update_proctable_sta…
Browse files Browse the repository at this point in the history
…tuses
  • Loading branch information
akremin committed Oct 9, 2024
1 parent 9e29ec4 commit 5cb164d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
3 changes: 2 additions & 1 deletion bin/desi_proc_night
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,5 @@ def parse_args():
return args

if __name__ == '__main__':
args = parse
args = parse_args()
proc_night(**args.__dict__)
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@ from desispec.workflow.queue import update_from_queue

def parse_args(): # options=None):
"""
Get command line arguments for desi_update_processing_table_statuses
Get command line arguments for desi_update_proctable_statuses
"""
parser = argparse.ArgumentParser(description="Update the STATUS of all jobs "
+ "in a DESI processing table by "
+ "querying Slurm.")

parser.add_argument("-n","--night", type=str, default=None,
required=False, help="The night you want processed.")
parser.add_argument("-o","--outfile", type=str, default=None,
required=False, help="Output filename, if different from default.")
parser.add_argument("--proc-table-pathname", type=str, required=False, default=None,
help="Directory name where the output processing table should be saved.")
parser.add_argument("--tab-filetype", type=str, required=False, default='csv',
Expand Down Expand Up @@ -68,7 +70,11 @@ if __name__ == '__main__':
check_complete_jobs=args.check_complete_jobs)

if args.dry_run_level < 3:
write_table(ptable, tablename=ptable_pathname)
if args.outfile is not None:
outfile = args.outfile
else:
outfile = ptable_pathname
write_table(ptable, tablename=outfile)

if args.show_updated_table:
log.info("Updated processing table:")
Expand Down
2 changes: 1 addition & 1 deletion py/desispec/scripts/daily_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -520,4 +520,4 @@ def daily_processing_manager(specprod=None, exp_table_path=None, proc_table_path
print("Exiting")
## Flush the outputs
sys.stdout.flush()
sys.std
sys.stderr.flush()

0 comments on commit 5cb164d

Please sign in to comment.