| 35 | return platform.machine().startswith('arm') and architecture[0] == '32bit' |
| 36 | |
| 37 | class PhysicalQuantity(float): |
| 38 | def __new__(cls, value): |
| 39 | return float.__new__(cls, value) |
| 40 | |
| 41 | def __add__(self, x): |
| 42 | assert_(isinstance(x, PhysicalQuantity)) |
| 43 | return PhysicalQuantity(float(x) + float(self)) |
| 44 | __radd__ = __add__ |
| 45 | |
| 46 | def __sub__(self, x): |
| 47 | assert_(isinstance(x, PhysicalQuantity)) |
| 48 | return PhysicalQuantity(float(self) - float(x)) |
| 49 | |
| 50 | def __rsub__(self, x): |
| 51 | assert_(isinstance(x, PhysicalQuantity)) |
| 52 | return PhysicalQuantity(float(x) - float(self)) |
| 53 | |
| 54 | def __mul__(self, x): |
| 55 | return PhysicalQuantity(float(x) * float(self)) |
| 56 | __rmul__ = __mul__ |
| 57 | |
| 58 | def __truediv__(self, x): |
| 59 | return PhysicalQuantity(float(self) / float(x)) |
| 60 | |
| 61 | def __rtruediv__(self, x): |
| 62 | return PhysicalQuantity(float(x) / float(self)) |
| 63 | |
| 64 | |
| 65 | class PhysicalQuantity2(ndarray): |
no outgoing calls
searching dependent graphs…