Skip to content

Commit

Permalink
enforce strict abstract-concrete (#71)
Browse files Browse the repository at this point in the history
Signed-off-by: nstarman <nstarman@users.noreply.github.com>
  • Loading branch information
nstarman committed Jan 19, 2024
1 parent 805666f commit c6480a9
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/galax/dynamics/_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from galax.potential._potential.base import AbstractPotentialBase


class AbstractPhaseSpacePositionBase(eqx.Module): # type: ignore[misc]
class AbstractPhaseSpacePositionBase(eqx.Module, strict=True): # type: ignore[call-arg, misc]
"""Abstract Base Class of Phase-Space Positions.
Todo:
Expand Down
2 changes: 1 addition & 1 deletion src/galax/dynamics/mockstream/_df/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
Carry: TypeAlias = tuple[IntLike, Vec3, Vec3, Vec3, Vec3]


class AbstractStreamDF(eqx.Module): # type: ignore[misc]
class AbstractStreamDF(eqx.Module, strict=True): # type: ignore[call-arg, misc]
lead: bool = eqx.field(default=True, static=True)
trail: bool = eqx.field(default=True, static=True)

Expand Down
2 changes: 1 addition & 1 deletion src/galax/integrate/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def __call__(self, t: FloatScalar, qp: Vec6, args: tuple[Any, ...]) -> Vec6:
...


class AbstractIntegrator(eqx.Module): # type: ignore[misc]
class AbstractIntegrator(eqx.Module, strict=True): # type: ignore[call-arg, misc]
"""Integrator Class.
The integrators are classes that are used to integrate the equations of
Expand Down
2 changes: 1 addition & 1 deletion src/galax/potential/_potential/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
default_integrator = DiffraxIntegrator()


class AbstractPotentialBase(eqx.Module, metaclass=ModuleMeta): # type: ignore[misc]
class AbstractPotentialBase(eqx.Module, metaclass=ModuleMeta, strict=True): # type: ignore[misc]
"""Potential Class."""

units: eqx.AbstractVar[UnitSystem]
Expand Down
2 changes: 1 addition & 1 deletion src/galax/potential/_potential/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from .utils import converter_to_usys


class AbstractPotential(AbstractPotentialBase):
class AbstractPotential(AbstractPotentialBase, strict=True):
_: KW_ONLY
units: UnitSystem = eqx.field(converter=converter_to_usys, static=True)
_G: float = eqx.field(init=False, static=True, repr=False, converter=float)
Expand Down
2 changes: 1 addition & 1 deletion src/galax/potential/_potential/param/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from galax.utils.dataclasses import converter_float_array


class AbstractParameter(eqx.Module): # type: ignore[misc]
class AbstractParameter(eqx.Module, strict=True): # type: ignore[call-arg, misc]
"""Abstract Base Class for Parameters on a Potential.
Parameters are time-dependent quantities that are used to define a
Expand Down

0 comments on commit c6480a9

Please sign in to comment.