brainunit.typing module#

Physical Type Utilities#

PhysicalType

Create a physical type that works with both type annotations and isinstance.

is_physical_type

Check whether obj is a PhysicalType-created class.

quantity_type

Return a runtime-checkable Quantity type for isinstance.

Core Type Aliases#

QuantityLike

Represent a union type

UnitLike

Represent a union type

DimensionLike

Represent a union type

Pre-built Physical-Type Aliases#

Runtime Validation#

validate_units

Decorator that validates Quantity argument units at call time.