-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: regroup spherical classes into separate files (#199)
* refactor: regroup spherical classes into separate files Signed-off-by: nstarman <nstarman@users.noreply.github.com>
- Loading branch information
Showing
9 changed files
with
710 additions
and
617 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
"""Built-in vector classes.""" | ||
|
||
__all__ = [ | ||
"AbstractSphericalPosition", | ||
"AbstractSphericalVelocity", | ||
"AbstractSphericalAcceleration", | ||
] | ||
|
||
from abc import abstractmethod | ||
from typing_extensions import override | ||
|
||
from unxt import Quantity | ||
|
||
from .base import AbstractAcceleration3D, AbstractPosition3D, AbstractVelocity3D | ||
from coordinax._src.utils import classproperty | ||
|
||
_90d = Quantity(90, "deg") | ||
_180d = Quantity(180, "deg") | ||
_360d = Quantity(360, "deg") | ||
|
||
|
||
class AbstractSphericalPosition(AbstractPosition3D): | ||
"""Abstract spherical vector representation.""" | ||
|
||
@override | ||
@classproperty | ||
@classmethod | ||
@abstractmethod | ||
def differential_cls(cls) -> "type[AbstractSphericalVelocity]": ... | ||
|
||
|
||
class AbstractSphericalVelocity(AbstractVelocity3D): | ||
"""Spherical differential representation.""" | ||
|
||
@override | ||
@classproperty | ||
@classmethod | ||
@abstractmethod | ||
def integral_cls(cls) -> type[AbstractSphericalPosition]: ... | ||
|
||
@override | ||
@classproperty | ||
@classmethod | ||
@abstractmethod | ||
def differential_cls(cls) -> "type[AbstractSphericalAcceleration]": ... | ||
|
||
|
||
class AbstractSphericalAcceleration(AbstractAcceleration3D): | ||
"""Spherical acceleration representation.""" | ||
|
||
@override | ||
@classproperty | ||
@classmethod | ||
@abstractmethod | ||
def integral_cls(cls) -> type[AbstractSphericalVelocity]: ... |
Oops, something went wrong.