Skip to content

Commit

Permalink
no maybe untuple
Browse files Browse the repository at this point in the history
  • Loading branch information
dlwh committed Nov 6, 2023
1 parent 679287f commit e94d062
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/haliax/axis.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import equinox as eqx

from haliax.util import ensure_tuple, maybe_untuple
from haliax.util import ensure_tuple

from ._src.util import index_where

Expand Down Expand Up @@ -109,7 +109,7 @@ def axis_spec_to_shape_dict(axis_spec: AxisSelection) -> Dict[str, Optional[int]


def _dict_to_spec(axis_spec: Mapping[str, Optional[int]]) -> AxisSelection:
return maybe_untuple(tuple(Axis(name, size) if size is not None else name for name, size in axis_spec.items()))
return tuple(Axis(name, size) if size is not None else name for name, size in axis_spec.items())


@overload
Expand Down Expand Up @@ -241,7 +241,7 @@ def unsize_axes(axis_spec: AxisSelection, to_unsize: Optional[AxisSelection] = N
"""

if to_unsize is None:
return maybe_untuple(tuple(axis_name(ax) for ax in ensure_tuple(axis_spec))) # type: ignore
return tuple(axis_name(ax) for ax in ensure_tuple(axis_spec)) # type: ignore

to_unsize = ensure_tuple(to_unsize)
axis_spec_dict: dict[str, Optional[int]] = axis_spec_to_shape_dict(axis_spec) # type: ignore
Expand Down

0 comments on commit e94d062

Please sign in to comment.