Angles – ephemerista.angles

The angles.py module.

This module contains the Angle class which provides a generic angle model for other Ephemerista data structures.

class ephemerista.angles.Angle(*, degrees)

Generic angle model.

Notes

Subclasses of Angle may override the degrees field to customise constraints.

Examples

>>> class Inclination(Angle):
...     degrees: float = Field(ge=0, le=180)
>>> inc = Inclination.from_radians(1.5707963267948966)
>>> inc.degrees
90.0
classmethod from_degrees(degrees)

Construct an Angle object from a value in degrees.

Parameters:

degrees (float) – The value of the angle in degrees

Return type:

Self

classmethod from_radians(radians)

Construct an Angle object from a value in radians.

Parameters:

radians (float) – The value of the angle in radians

Return type:

Self

model_config: ClassVar[ConfigDict] = {'alias_generator': <function to_camel>, 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

property radians

Value of the angle in radians.

Type:

float

class ephemerista.angles.Latitude(*, degrees)

Latitude.

model_config: ClassVar[ConfigDict] = {'alias_generator': <function to_camel>, 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class ephemerista.angles.Longitude(*, degrees)

Longitude.

model_config: ClassVar[ConfigDict] = {'alias_generator': <function to_camel>, 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].