Measured in seconds
| 9 | |
| 10 | @dataclass |
| 11 | class Time: |
| 12 | """ |
| 13 | Measured in seconds |
| 14 | """ |
| 15 | |
| 16 | seconds: float |
| 17 | SECONDS_TO_HOURS = 1 / 3600 |
| 18 | |
| 19 | @property |
| 20 | def hours(self) -> float: |
| 21 | return self.seconds * Time.SECONDS_TO_HOURS |
| 22 | |
| 23 | @classmethod |
| 24 | def from_seconds(cls, seconds: float) -> "Time": |
| 25 | return cls(seconds=seconds) |
| 26 | |
| 27 | |
| 28 | @dataclass |
no outgoing calls
searching dependent graphs…