Skip to content

Commit

Permalink
examples/ccdb_run2time.py get SOR/EOR info for run
Browse files Browse the repository at this point in the history
  • Loading branch information
adriansev committed Jan 25, 2024
1 parent df96b06 commit 6c8c7fb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 32 deletions.
4 changes: 2 additions & 2 deletions alienpy/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import sys

ALIENPY_VERSION_HASH = '9f67987'
ALIENPY_VERSION_DATE = '20231222_090018'
ALIENPY_VERSION_HASH = '4290435'
ALIENPY_VERSION_DATE = '20240125_213910'
ALIENPY_VERSION_STR = '1.5.7'

if __name__ == '__main__':
Expand Down
35 changes: 5 additions & 30 deletions examples/ccdb_run2time.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,16 @@

rez_list = []
for r in args[0].runnr:
rez = DO_ccdb_query([f'/RCT/Info/RunInformation/{r}'])
if not 'objects' in rez.ansdict or not rez.ansdict['objects']:
run_info = ccdb_runinfo(r)
if not 'objects' in run_info or not run_info['objects']:
print(f'No information found for {r}', file = sys.stderr, flush = True)
continue

sor_nice = unixtime2local(rez.ansdict['objects'][0]['SOR'])
eor_nice = unixtime2local(rez.ansdict['objects'][0]['EOR'])
sor_nice = unixtime2local(run_info['objects'][0]['SOR'])
eor_nice = unixtime2local(run_info['objects'][0]['EOR'])

r_info = { 'run': r,
'sor': rez.ansdict['objects'][0]['SOR'], 'eor': rez.ansdict['objects'][0]['EOR'],
'sor': run_info['objects'][0]['SOR'], 'eor': run_info['objects'][0]['EOR'],
'sor_nice': sor_nice, 'eor_nice': eor_nice}
rez_list.append(r_info)

Expand All @@ -60,28 +60,3 @@
for i in rez_list:
print(f'run="{i["run"]}" sor="{i["sor"]}" eor="{i["eor"]}" sor_nice="{i["sor_nice"]}" eor_nice="{i["eor_nice"]}"')


























0 comments on commit 6c8c7fb

Please sign in to comment.