forked from M-Labs/artiq
master: name results 'year-month-day/hour-minute/runid-experiment'
This commit is contained in:
parent
cc172699ea
commit
1aec6a0462
|
@ -9,3 +9,4 @@ doc/manual/_build
|
||||||
/dist
|
/dist
|
||||||
/*.egg-info
|
/*.egg-info
|
||||||
/.coverage
|
/.coverage
|
||||||
|
examples/results
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
import sys
|
import sys
|
||||||
|
import os
|
||||||
|
import time
|
||||||
from inspect import isclass
|
from inspect import isclass
|
||||||
import traceback
|
import traceback
|
||||||
|
|
||||||
|
@ -80,6 +82,7 @@ def get_unit(file, unit):
|
||||||
|
|
||||||
|
|
||||||
def run(rid, run_params):
|
def run(rid, run_params):
|
||||||
|
start_time = time.localtime()
|
||||||
unit = get_unit(run_params["file"], run_params["unit"])
|
unit = get_unit(run_params["file"], run_params["unit"])
|
||||||
|
|
||||||
realtime_results = unit.realtime_results()
|
realtime_results = unit.realtime_results()
|
||||||
|
@ -115,8 +118,12 @@ def run(rid, run_params):
|
||||||
finally:
|
finally:
|
||||||
dbh.close()
|
dbh.close()
|
||||||
|
|
||||||
filename = "{:05}-{}.h5".format(rid, unit.__name__)
|
dirname = os.path.join("results",
|
||||||
f = h5py.File(filename, "w")
|
time.strftime("%y-%m-%d", start_time),
|
||||||
|
time.strftime("%H-%M", start_time))
|
||||||
|
filename = "{:09}-{}.h5".format(rid, unit.__name__)
|
||||||
|
os.makedirs(dirname, exist_ok=True)
|
||||||
|
f = h5py.File(os.path.join(dirname, filename), "w")
|
||||||
try:
|
try:
|
||||||
rdb.write_hdf5(f)
|
rdb.write_hdf5(f)
|
||||||
finally:
|
finally:
|
||||||
|
|
Loading…
Reference in New Issue