Skip to content

Commit d45fe48

Browse files
committed
Support most recent unxt (#484)
* ⬆️ dep-bump: unxt v1.10.3+ * 🚨 fix-lint: mypy * 🚨 fix-lint: mypy Signed-off-by: nstarman <[email protected]> (cherry picked from commit 8ab58a3) Signed-off-by: nstarman <[email protected]>
1 parent 7316ccd commit d45fe48

File tree

11 files changed

+32
-27
lines changed

11 files changed

+32
-27
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ dependencies = [
3232
"quax-blocks>=0.4.0",
3333
"quaxed>=0.10.4",
3434
"typing-extensions>=4.13.2",
35-
"unxt>=1.7.3",
35+
"unxt>=1.10.3",
3636
"wadler-lindig>=0.1.6",
3737
"xmmutablemap>=0.1",
3838
]

src/coordinax/_coordinax_space_frames/frame_transforms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
# ---------------------------------------------------------------
3434
# Base Space-Frame Transformation
3535

36-
_icrs_frame = ICRS() # type: ignore[no-untyped-call]
36+
_icrs_frame = ICRS()
3737

3838

3939
@dispatch

src/coordinax/_src/distances/measures.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
import quaxed.numpy as jnp
1414
import unxt as u
15-
from unxt._src.units.api import AstropyUnits
1615

1716
from .base import AbstractDistance
1817

@@ -46,7 +45,7 @@ class Distance(AbstractDistance):
4645
)
4746
"""The value of the `unxt.AbstractQuantity`."""
4847

49-
unit: AstropyUnits = eqx.field(static=True, converter=u.unit)
48+
unit: u.AbstractUnit = eqx.field(static=True, converter=u.unit)
5049
"""The unit associated with this value."""
5150

5251
_: KW_ONLY
@@ -103,7 +102,7 @@ class DistanceModulus(AbstractDistance):
103102
)
104103
"""The value of the `unxt.AbstractQuantity`."""
105104

106-
unit: AstropyUnits = eqx.field(static=True, converter=u.unit)
105+
unit: u.AbstractUnit = eqx.field(static=True, converter=u.unit)
107106
"""The unit associated with this value."""
108107

109108
def __check_init__(self) -> None:
@@ -138,7 +137,7 @@ class Parallax(AbstractDistance):
138137
To disable this check, set `check_negative=False`.
139138
140139
>>> Parallax(-1, "mas", check_negative=False)
141-
Parallax(Array(-1, dtype=int32, ...), unit='mas', check_negative=False)
140+
Parallax(Array(-1, dtype=int32, weak_type=True), unit='mas')
142141
143142
"""
144143

@@ -147,7 +146,7 @@ class Parallax(AbstractDistance):
147146
)
148147
"""The value of the `unxt.AbstractQuantity`."""
149148

150-
unit: AstropyUnits = eqx.field(static=True, converter=u.unit)
149+
unit: u.AbstractUnit = eqx.field(static=True, converter=u.unit)
151150
"""The unit associated with this value."""
152151

153152
_: KW_ONLY

src/coordinax/_src/operators/base.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def __pdoc__(self, **kwargs: Any) -> wl.AbstractDoc:
123123
if not jnp.all(v == getattr(self.__class__, k, _sentinel))
124124
]
125125
# Make the field docs list
126-
if len(fitems) == 1 and kwargs.get("compact_arrays", False):
126+
if len(fitems) == 1 and kwargs.get("short_arrays") == "compact":
127127
docs = [wl.TextDoc(str(fitems[0][1]))]
128128
else:
129129
docs = wl.named_objs(fitems, **kwargs)
@@ -173,9 +173,7 @@ def __str__(self) -> str:
173173
)
174174
175175
"""
176-
return wl.pformat(
177-
self, width=88, vector_form=True, short_arrays=False, compact_arrays=True
178-
)
176+
return wl.pformat(self, width=88, vector_form=True, short_arrays="compact")
179177

180178
# ===========================================
181179
# Operator Composition

src/coordinax/_src/operators/galilean/rotation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ def simplify_op(op: GalileanRotation, /, **kwargs: Any) -> AbstractOperator:
446446
447447
"""
448448
if jnp.allclose(op.rotation, jnp.eye(3), **kwargs):
449-
return Identity() # type: ignore[no-untyped-call]
449+
return Identity()
450450
return op
451451

452452

src/coordinax/_src/vectors/base/base.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -737,9 +737,7 @@ def __repr__(self) -> str:
737737
representation of the vector.
738738
739739
"""
740-
return wl.pformat(
741-
self, vector_form=False, short_arrays=False, compact_arrays=True
742-
)
740+
return wl.pformat(self, vector_form=False, short_arrays="compact")
743741

744742
def __str__(self) -> str:
745743
"""Return a string representation of the vector-like object."""

src/coordinax/_src/vectors/base/vector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ def __pdoc__(self, *, vector_form: bool = False, **kwargs: Any) -> wl.AbstractDo
562562
begin=wl.TextDoc(" "), # indent to opening "<"
563563
docs=wl.named_objs(
564564
[(k, getattr(self, k)) for k in self._AUX_FIELDS],
565-
**kwargs | {"short_arrays": False, "compact_arrays": True},
565+
**kwargs | {"short_arrays": "compact"},
566566
),
567567
sep=wl.comma,
568568
end=wl.TextDoc(""), # no end bracket

src/coordinax/_src/vectors/collection/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
import quaxed.numpy as jnp
1111
import unxt as u
12-
from unxt._src.dimensions.core import name_of
12+
from unxt._src.dimensions import name_of
1313

1414
DimensionLike: TypeAlias = Dimension | str
1515
Shape: TypeAlias = tuple[int, ...]

src/coordinax/_src/vectors/converters.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@
88
_2pid = u.Angle(360, "deg")
99

1010

11-
def converter_azimuth_to_range(
12-
phi: u.AbstractQuantity,
13-
/,
14-
) -> u.AbstractQuantity:
11+
def converter_azimuth_to_range(phi: u.AbstractQuantity, /) -> u.AbstractQuantity:
1512
"""Wrap a polar angle to the range [0, 2pi).
1613
1714
It's safe to do this conversion since this is a phase cut, unlike `theta`,

src/coordinax/_src/vectors/d4/spacetime.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,8 @@ def __pdoc__(self, *, vector_form: bool = False, **kwargs: Any) -> wl.AbstractDo
206206
+ wl.TextDoc(")")
207207
).group()
208208

209-
vs = np.array2string( # type: ignore[call-overload] # TODO: use other method
210-
jnp.stack(
209+
vs = np.array2string(
210+
jnp.stack( # type: ignore[arg-type]
211211
tuple(
212212
u.ustrip(v)
213213
for v in cast(

0 commit comments

Comments
 (0)