(self, other: int | float)
| 215 | raise ValueError("Could not convert to integer offset at any resolution") |
| 216 | |
| 217 | def __mul__(self, other: int | float) -> Tick: |
| 218 | if not isinstance(other, int | float): |
| 219 | return NotImplemented |
| 220 | if isinstance(other, float): |
| 221 | n = other * self.n |
| 222 | # If the new `n` is an integer, we can represent it using the |
| 223 | # same BaseCFTimeOffset subclass as self, otherwise we need to move up |
| 224 | # to a higher-resolution subclass |
| 225 | if np.isclose(n % 1, 0): |
| 226 | return type(self)(int(n)) |
| 227 | |
| 228 | new_self = self._next_higher_resolution() |
| 229 | return new_self * other |
| 230 | return type(self)(n=other * self.n) |
| 231 | |
| 232 | def as_timedelta(self) -> timedelta: |
| 233 | """All Tick subclasses must implement an as_timedelta method.""" |
nothing calls this directly
no test coverage detected