From 87552bf290c04c053019e9e8431ce7b8e1250392 Mon Sep 17 00:00:00 2001
From: Cyril Danilevski <cyril.danilevski@xfel.eu>
Date: Wed, 11 Nov 2020 18:16:22 +0100
Subject: [PATCH] Cast numpy.float64 to float and round it

---
 cal_tools/cal_tools/agipdlib.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/cal_tools/cal_tools/agipdlib.py b/cal_tools/cal_tools/agipdlib.py
index 25df16192..1b4b976d6 100644
--- a/cal_tools/cal_tools/agipdlib.py
+++ b/cal_tools/cal_tools/agipdlib.py
@@ -58,10 +58,10 @@ def get_acq_rate(fast_paths: Tuple[str, str, int],
         with h5py.File(slow_data_file, "r") as fin:
             if slow_data_path in fin:
                 # The acquisition rate value is stored in a 1D array of type
-                # float. Use the 3rd value, arbitrarily chosen. It's okay to
-                # loose precision here because the usage is about defining the
-                # rate for meta-data.
-                return round(fin[slow_data_path][3], 1)
+                # float. Use the 3rd value, arbitrarily chosen.
+                # It is desired to loose precision here because the usage is
+                # about bucketing the rate for managing meta-data.
+                return round(float(fin[slow_data_path][3]), 1)
 
     # Compute acquisition rate from fast data
     fast_data_file, karabo_id, module = fast_paths
-- 
GitLab