| Conditions | 3 | 
| Total Lines | 9 | 
| Code Lines | 9 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Changes | 0 | ||
| 1 | import attr | ||
| 10 | def update(self, subject: n.Subject): | ||
| 11 | datapoints_object = subject.state | ||
| 12 | key = getattr(subject, 'name', '') | ||
| 13 | if key == '': | ||
| 14 |             raise RuntimeError(f"Subject {subject} with state {str(subject.state)} resulted in an empty string as key (to use in dict/hash).") | ||
| 15 | if key in self.datapoints_objects: | ||
| 16 |             raise RuntimeError(f"Attempted to register a new Datapoints object at the existing key '{key}'.") | ||
| 17 | self.datapoints_objects[key] = datapoints_object | ||
| 18 | self._last_key = key | ||
| 19 | |||
| 30 |