Skip to content

Commit

Permalink
fix: precedence issues
Browse files Browse the repository at this point in the history
Signed-off-by: nstarman <[email protected]>
  • Loading branch information
nstarman committed Feb 21, 2024
1 parent 9ce9469 commit 8c2e200
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions src/vector/_d1/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,22 @@
# 1D


@dispatch(precedence=1)
def represent_as(
current: Cartesian1DVector, target: type[Cartesian1DVector], /, **kwargs: Any
) -> Cartesian1DVector:
"""Self transform of 1D vectors."""
return current


@dispatch(precedence=1)
def represent_as(
current: RadialVector, target: type[RadialVector], /, **kwargs: Any
) -> RadialVector:
"""Self transform of 1D vectors."""
return current


@dispatch
def represent_as(
current: Abstract1DVector, target: type[Abstract1DVector], /, **kwargs: Any
Expand All @@ -32,16 +48,6 @@ def represent_as(
return represent_as(cart1d, target)


@dispatch.multi(
(Cartesian1DVector, type[Cartesian1DVector]), (RadialVector, type[RadialVector])
)
def represent_as(
current: Abstract1DVector, target: type[Abstract1DVector], /, **kwargs: Any
) -> Abstract1DVector:
"""Self transform of 1D vectors."""
return current


@dispatch.multi(
(CartesianDifferential1D, type[CartesianDifferential1D], AbstractVector),
(RadialDifferential, type[RadialDifferential], AbstractVector),
Expand Down

0 comments on commit 8c2e200

Please sign in to comment.