From 614972862ca4be370eaf1e286c0208e568ff2adf Mon Sep 17 00:00:00 2001 From: akremin Date: Thu, 3 Oct 2024 12:00:43 -0700 Subject: [PATCH] add option to update_statuses to print updated table --- bin/desi_update_processing_table_statuses | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bin/desi_update_processing_table_statuses b/bin/desi_update_processing_table_statuses index 0dff6671a..3b2d94f21 100755 --- a/bin/desi_update_processing_table_statuses +++ b/bin/desi_update_processing_table_statuses @@ -3,6 +3,7 @@ import argparse import os +import numpy as np from desiutil.log import get_logger from desispec.workflow.tableio import load_table, write_table @@ -30,9 +31,10 @@ def parse_args(): # options=None): help="Query NERSC about jobs with STATUS 'COMPLETED'" + "in addition to all other jobs. Default is False, " + "which skips COMPLETED jobs.") - args = parser.parse_args() + parser.add_argument("--show-updated-table", action="store_true", + help="Print a subset of the columns from the ptable with updated statuses.") - return args + return parser.parse_args() if __name__ == '__main__': @@ -58,4 +60,10 @@ if __name__ == '__main__': if not args.dry_run: write_table(ptable, tablename=ptable_pathname) + if args.show_updated_table: + log.info("Updated processing table:") + cols = ['INTID', 'INT_DEP_IDS', 'EXPID', 'TILEID', + 'OBSTYPE', 'JOBDESC', 'LATEST_QID', 'STATUS'] + log.info(np.array(cols)) + log.info(f"Done updating STATUS column for processing table: {ptable_pathname}")