From e1f3968a4ae9f2f03b6027c1b3c3eb63f7709c91 Mon Sep 17 00:00:00 2001 From: Robert Jordens Date: Tue, 5 Apr 2016 13:35:47 +0800 Subject: [PATCH] worker, hdf5: move datasets to subgroup --- RELEASE_NOTES.rst | 6 ++++++ artiq/master/worker_db.py | 3 ++- artiq/master/worker_impl.py | 7 ++----- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/RELEASE_NOTES.rst b/RELEASE_NOTES.rst index 25c3e1cc8..588e71aa1 100644 --- a/RELEASE_NOTES.rst +++ b/RELEASE_NOTES.rst @@ -3,6 +3,12 @@ Release notes ============= +unreleased [1.0rc3] +------------------- + +* The HDF5 format has changed. The datasets are located in the subgroup ``datasets``. + + 1.0rc2 ------ diff --git a/artiq/master/worker_db.py b/artiq/master/worker_db.py index 628b7e122..f9c8e06d1 100644 --- a/artiq/master/worker_db.py +++ b/artiq/master/worker_db.py @@ -240,4 +240,5 @@ class DatasetManager: return self.ddb.get(key) def write_hdf5(self, f): - result_dict_to_hdf5(f, self.local) + g = f.create_group("datasets") + result_dict_to_hdf5(g, self.local) diff --git a/artiq/master/worker_impl.py b/artiq/master/worker_impl.py index 722a1c9a8..5af4db6da 100644 --- a/artiq/master/worker_impl.py +++ b/artiq/master/worker_impl.py @@ -226,14 +226,11 @@ def main(): exp_inst.analyze() put_object({"action": "completed"}) elif action == "write_results": - f = get_hdf5_output(start_time, rid, exp.__name__) - try: + with get_hdf5_output(start_time, rid, exp.__name__) as f: dataset_mgr.write_hdf5(f) - string_to_hdf5(f, "artiq_version", artiq_version) + string_to_hdf5(f, "version", artiq_version) if "repo_rev" in expid: string_to_hdf5(f, "repo_rev", expid["repo_rev"]) - finally: - f.close() put_object({"action": "completed"}) elif action == "examine": examine(ExamineDeviceMgr, ParentDatasetDB, obj["file"])