worker: trust that h5py encodes strings

This commit is contained in:
Robert Jördens 2016-04-05 15:38:21 +08:00
parent 587a0f4565
commit 05c61465e0
1 changed files with 2 additions and 8 deletions

View File

@ -137,12 +137,6 @@ def examine(device_mgr, dataset_mgr, file):
register_experiment(class_name, name, arginfo) register_experiment(class_name, name, arginfo)
def string_to_hdf5(f, key, value):
dtype = "S{}".format(len(value))
dataset = f.create_dataset(key, (), dtype)
dataset[()] = value.encode()
def setup_diagnostics(experiment_file, repository_path): def setup_diagnostics(experiment_file, repository_path):
def render_diagnostic(self, diagnostic): def render_diagnostic(self, diagnostic):
message = "While compiling {}\n".format(experiment_file) + \ message = "While compiling {}\n".format(experiment_file) + \
@ -220,9 +214,9 @@ def main():
elif action == "write_results": elif action == "write_results":
with get_hdf5_output(start_time, rid, exp.__name__) as f: with get_hdf5_output(start_time, rid, exp.__name__) as f:
dataset_mgr.write_hdf5(f) dataset_mgr.write_hdf5(f)
string_to_hdf5(f, "version", artiq_version) f["artiq_version"] = artiq_version
if "repo_rev" in expid: if "repo_rev" in expid:
string_to_hdf5(f, "repo_rev", expid["repo_rev"]) f["repo_rev"] = expid["repo_rev"]
put_object({"action": "completed"}) put_object({"action": "completed"})
elif action == "examine": elif action == "examine":
examine(ExamineDeviceMgr, ParentDatasetDB, obj["file"]) examine(ExamineDeviceMgr, ParentDatasetDB, obj["file"])