From 05c61465e07cd2b5232cb7504e6d905531126fd6 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 a6258b94f..d8d065e5b 100644 --- a/artiq/master/worker_impl.py +++ b/artiq/master/worker_impl.py @@ -137,12 +137,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) + \ @@ -220,9 +214,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"])