Skip to content

Commit

Permalink
minor docstring improvements TimeMappingDict
Browse files Browse the repository at this point in the history
  • Loading branch information
muelleram committed Sep 18, 2024
1 parent 47e8da3 commit 82d196d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions bw_timex/helper_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
----------
Expand All @@ -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

0 comments on commit 82d196d

Please sign in to comment.