From 0b32d9946ad5c41c2c756f88c305742b41a4c597 Mon Sep 17 00:00:00 2001 From: Robert Jordens Date: Tue, 5 Apr 2016 15:38:21 +0800 Subject: [PATCH] worker: trust that h5py encodes strings --- artiq/master/worker_impl.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/artiq/master/worker_impl.py b/artiq/master/worker_impl.py index 5af4db6da..55fe26bb9 100644 --- a/artiq/master/worker_impl.py +++ b/artiq/master/worker_impl.py @@ -145,12 +145,6 @@ def examine(device_mgr, dataset_mgr, file): 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 render_diagnostic(self, diagnostic): message = "While compiling {}\n".format(experiment_file) + \ @@ -228,9 +222,9 @@ def main(): elif action == "write_results": with get_hdf5_output(start_time, rid, exp.__name__) as f: dataset_mgr.write_hdf5(f) - string_to_hdf5(f, "version", artiq_version) + f["artiq_version"] = artiq_version if "repo_rev" in expid: - string_to_hdf5(f, "repo_rev", expid["repo_rev"]) + f["repo_rev"] = expid["repo_rev"] put_object({"action": "completed"}) elif action == "examine": examine(ExamineDeviceMgr, ParentDatasetDB, obj["file"])