Skip to content

Commit

Permalink
Print number of files to process
Browse files Browse the repository at this point in the history
- Also log deletion of old results from DB
  • Loading branch information
sfegan committed Oct 16, 2024
1 parent d2fb390 commit b94f032
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/cta_stage1.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
failed_files = []
nsuccess = 0;
nskip = 0;
nfile = len(endpoints[opt.start_file_index():])
for ifile, filename in enumerate(endpoints[opt.start_file_index():]):
ifile += opt.start_file_index()
if not first_file:
Expand All @@ -126,14 +127,15 @@
continue
if oids and opt.replace_existing():
for oid in oids:
print(f"Deleting old stage1 results from database, OID : {oid}")
sql.delete_by_oid(opt.db_stage1_table_name(), oid)
print("#%d: processing %s"%(ifile,filename))
print("#%d / %d: processing %s"%(ifile+1,nfile,filename))
try:
calin.util.log.prune_default_protobuf_log()
calin.provenance.chronicle.prune_the_chronicle()
dispatcher.process_cta_zfits_run(filename, cfg)
s1res = s1pev.stage1_results()
print(f"Inserting stage1 results into database, size: {s1res.SpaceUsedLong()/1024**2:,.1f} MB",)
print(f"Inserting stage1 results into database, size: {s1res.SpaceUsedLong()/1024**2:,.1f} MB")
start_time = time.time()
good, oid = sql.insert(opt.db_stage1_table_name(), s1res)
if(good):
Expand Down

0 comments on commit b94f032

Please sign in to comment.