Open adrn opened 3 days ago
Something I just noticed when testing unrelated code:
class MyUnitSystem(AbstractUnitSystem): length: Annotated[u.Unit, u.get_physical_type("length")] time: Annotated[u.Unit, u.get_physical_type("time")] # raises error: usys = unitsystem(u.kpc, u.Myr)
# Return if the unit system is already registered if dimensions in UNITSYSTEMS_REGISTRY: > return UNITSYSTEMS_REGISTRY[dimensions](*units_) E TypeError: AbstractUnitSystem.__init__() takes 1 positional argument but 3 were given
Hm. This means it's not processing the fields as base dimensions. Can you try u.UnitBase as the annotated type?
u.UnitBase
Something I just noticed when testing unrelated code: