Skip to content

Commit

Permalink
More extensive typing
Browse files Browse the repository at this point in the history
Co-authored-by: Clément Robert <[email protected]>
  • Loading branch information
cphyc and neutrinoceros committed Nov 27, 2023
1 parent ded6e1c commit 57f7b5f
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions yt/data_objects/time_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,11 +443,9 @@ def particle_trajectories(
def _get_by_attribute(
self,
attribute: str,
value: Union[unyt_quantity, tuple[float, str]],
tolerance: Union[None, unyt_quantity, tuple[float, str]] = None,
side: Union[
Literal["nearest"], Literal["smaller"], Literal["larger"]
] = "nearest",
value: Union[unyt_quantity, tuple[float, Union[Unit, str]]],
tolerance: Union[None, unyt_quantity, tuple[float, Union[Unit, str]]] = None,
side: Literal["nearest", "smaller", "larger"] = "nearest",
) -> "Dataset":
r"""
Get a dataset at or near to a given value.
Expand Down Expand Up @@ -549,12 +547,10 @@ def _get_by_attribute(

def get_by_time(
self,
time: Union[unyt_quantity, tuple],
tolerance: Union[None, unyt_quantity, tuple] = None,
side: Union[
Literal["nearest"], Literal["smaller"], Literal["larger"]
] = "nearest",
):
time: Union[unyt_quantity, tuple[float, Union[Unit, str]]],
tolerance: Union[None, unyt_quantity, tuple[float, Union[Unit, str]]] = None,
side: Literal["nearest", "smaller", "larger"] = "nearest",
) -> Dataset:
"""
Get a dataset at or near to a given time.
Expand Down Expand Up @@ -585,10 +581,8 @@ def get_by_redshift(
self,
redshift: float,
tolerance: Optional[float] = None,
side: Union[
Literal["nearest"], Literal["smaller"], Literal["larger"]
] = "nearest",
):
side: Literal["nearest", "smaller", "larger"] = "nearest",
) -> Dataset:
"""
Get a dataset at or near to a given time.
Expand Down

0 comments on commit 57f7b5f

Please sign in to comment.