From 39529a2f289450219d6e13ed1ef2bc2414b0145e Mon Sep 17 00:00:00 2001
From: Jan David Mol <mol@astron.nl>
Date: Wed, 15 Mar 2023 10:49:43 +0100
Subject: [PATCH] L2SS-1262: Remove confusing 'statistics' property and updated
 TimeIt documentation

---
 .../tangostationcontrol/devices/device_decorators.py       | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/tangostationcontrol/tangostationcontrol/devices/device_decorators.py b/tangostationcontrol/tangostationcontrol/devices/device_decorators.py
index c4f48d8a4..f92409d72 100644
--- a/tangostationcontrol/tangostationcontrol/devices/device_decorators.py
+++ b/tangostationcontrol/tangostationcontrol/devices/device_decorators.py
@@ -80,8 +80,8 @@ def fault_on_error():
 
 def TimeIt(log_function=None, max_history_len=10):
     """
-    Wrapper to time calls, per object. Stores the timing log in a
-    <function>.statistics property as a dict with the following
+    Wrapper to time calls, per object ("self"). Stores the timing log in a
+    <function>.get_statistic(self) function returning a dict with the following
     information:
 
       "count":        number of times the function was called
@@ -128,9 +128,6 @@ def TimeIt(log_function=None, max_history_len=10):
             # return function result (if any)
             return result
 
-        # provide a way to access all collected statistics
-        timer_wrapper.statistics = statistics
-
         # get the statistics for a specific object
         timer_wrapper.get_statistic = lambda self: statistics.get(
             self, default_statistic.copy()
-- 
GitLab