From 427d64d7ee7bf0c6efdd499af56789e9b0f7c308 Mon Sep 17 00:00:00 2001
From: ahmedk <karim.ahmed@xfel.eu>
Date: Fri, 11 Feb 2022 09:46:08 +0100
Subject: [PATCH] if new save the empty dictionary to reset
 calibration_metadata.yml

---
 src/cal_tools/tools.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/cal_tools/tools.py b/src/cal_tools/tools.py
index 4613e111f..f2eeded2b 100644
--- a/src/cal_tools/tools.py
+++ b/src/cal_tools/tools.py
@@ -789,6 +789,8 @@ class CalibrationMetadata(dict):
             else:
                 print(f"Warning: existing {self._yaml_fn} is malformed, "
                       "will be overwritten")
+        else:
+            self.save()
 
     def save(self):
         with self._yaml_fn.open("w") as fd:
-- 
GitLab