Skip to content

Commit

Permalink
Remove unused schema.py
Browse files Browse the repository at this point in the history
  • Loading branch information
jak574 committed Feb 6, 2024
1 parent 3950e7a commit b1cccec
Showing 1 changed file with 0 additions and 33 deletions.
33 changes: 0 additions & 33 deletions python/across_api/base/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
Field,
PlainSerializer,
computed_field,
model_validator,
)

# Define a Pydantic type for astropy Time objects, which will be serialized as
Expand Down Expand Up @@ -43,38 +42,6 @@ def __hash__(self):
return hash((type(self),) + tuple(self.__dict__.values()))


class DateRangeSchema(BaseSchema):
"""
Schema that defines date range
Parameters
----------
begin
The start date of the range.
end
The end date of the range.
Returns
-------
data
The validated data with converted dates.
Raises
------
AssertionError
If the end date is before the begin date.
"""

begin: AstropyTime
end: AstropyTime

@model_validator(mode="after")
@classmethod
def check_dates(cls, data: Any) -> Any:
assert data.begin <= data.end, "End date should not be before begin"
return data


class TLEGetSchema(BaseSchema):
epoch: AstropyTime

Expand Down

0 comments on commit b1cccec

Please sign in to comment.