diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 68eb8a5..6b50ce8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -53,7 +53,7 @@ repos: - --fix - repo: https://github.com/pre-commit/mirrors-mypy - rev: "v1.5.1" + rev: "v1.6.0" hooks: - id: mypy additional_dependencies: ["numpy>=1.21,<1.24", typing_extensions>=4.4.0] diff --git a/src/stream_ml/core/builtin/_isochrone/utils.py b/src/stream_ml/core/builtin/_isochrone/utils.py index 0518557..0d27e6f 100644 --- a/src/stream_ml/core/builtin/_isochrone/utils.py +++ b/src/stream_ml/core/builtin/_isochrone/utils.py @@ -13,7 +13,6 @@ from stream_ml.core.typing import Array if TYPE_CHECKING: - from stream_ml.core.params import Params from stream_ml.core.typing import ArrayNamespace @@ -31,18 +30,21 @@ class Parallax2DistMod(SupportsXP[Array]): neg_clip_mu: float = 1e-30 array_namespace: ArrayNamespace[Array] - def __call__(self, pars: Params[Array], /) -> Params[Array]: + def __call__( + self, pars: dict[str, Array | dict[str, Array]], / + ) -> dict[str, Array | dict[str, Array]]: # Convert parallax (mas) to distance modulus # .. math:: # distmod = 5 log10(d [pc]) - 5 = -5 log10(plx [arcsec]) - 5 # = -5 log10(plx [mas] / 1e3) - 5 # = 10 - 5 log10(plx [mas]) - # dm = 10 - 5 * xp.log10(pars["photometric.parallax"]["mu"].reshape((-1, 1))) - mu = self.xp.clip(pars[self.astrometric_coord]["mu"], self.neg_clip_mu) + # dm = 10 - 5 * xp.log10(pars["photometric.parallax"]["mu"].reshape((-1, + # 1))) + mu = self.xp.clip(pars[self.astrometric_coord]["mu"], self.neg_clip_mu) # type: ignore[arg-type] dm = 10 - 5 * self.xp.log10(mu) ln_dm_sigma = self.xp.log( _five_over_log10 - * self.xp.exp(pars[self.astrometric_coord]["ln-sigma"]) + * self.xp.exp(pars[self.astrometric_coord]["ln-sigma"]) # type: ignore[arg-type] / mu )