(obj)
| 56 | |
| 57 | def is_compatible(unit1, unit2): |
| 58 | def dimensionality(obj): |
| 59 | if isinstance(obj, unit_registry.Quantity | unit_registry.Unit): |
| 60 | unit_like = obj |
| 61 | else: |
| 62 | unit_like = unit_registry.dimensionless |
| 63 | |
| 64 | return unit_like.dimensionality |
| 65 | |
| 66 | return dimensionality(unit1) == dimensionality(unit2) |
| 67 |
no outgoing calls
no test coverage detected
searching dependent graphs…