From 82d196da8aed6662b9fa0f4dd930a2b19daf047f Mon Sep 17 00:00:00 2001 From: muelleram Date: Wed, 18 Sep 2024 12:03:50 +0200 Subject: [PATCH] minor docstring improvements TimeMappingDict --- bw_timex/helper_classes.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bw_timex/helper_classes.py b/bw_timex/helper_classes.py index 36cc8b6..4eb87b5 100644 --- a/bw_timex/helper_classes.py +++ b/bw_timex/helper_classes.py @@ -110,7 +110,7 @@ def __init__(self, start_id=2, *args, **kwargs) -> None: ) # check_id that is different from the start id for the reversed dict def add(self, process_time_tuple, unique_id=None): - """ " + """ Adds a new process_time_tuple to the `TimeMappingDict` object. Parameters @@ -142,7 +142,8 @@ def add(self, process_time_tuple, unique_id=None): return self._current_id - 1 def reversed(self): - """return a reversed version of dict, update if necessary + """ + Returns a reversed version of dict, updates it only if necessary Parameters ---------- @@ -154,7 +155,7 @@ def reversed(self): A reversed dictionary of the `TimeMappingDict` object. """ - if self._check_id != self._current_id: + if self._check_id != self._current_id: # if the dict has been updated self.reversed_dict = {v: k for k, v in self.items()} self._check_id = self._current_id return self.reversed_dict