Skip to content

Commit

Permalink
coops: Improve typing annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
pmav99 committed Mar 2, 2023
1 parent 3f641c3 commit b65cae9
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions searvey/coops.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ def product(
self,
product: StationDataProduct,
start_date: datetime,
end_date: datetime = None,
interval: StationDataInterval = None,
datum: StationDatum = None,
end_date: datetime | None = None,
interval: StationDataInterval | None = None,
datum: StationDatum | None = None,
) -> Dataset:
"""
retrieve data for the current station within the specified parameters
Expand Down Expand Up @@ -107,9 +107,9 @@ def __init__(
station_id: str,
product: StationDataProduct,
start_date: datetime,
end_date: datetime = None,
interval: StationDataInterval = None,
datum: StationDatum = None,
end_date: datetime | None = None,
interval: StationDataInterval | None = None,
datum: StationDatum | None = None,
):
self.station_id = station_id
self.product = product
Expand Down Expand Up @@ -305,9 +305,9 @@ def product(
self,
product: COOPS_Product,
start_date: datetime,
end_date: datetime = None,
interval: COOPS_Interval = None,
datum: COOPS_TidalDatum = None,
end_date: datetime | None = None,
interval: COOPS_Interval | None = None,
datum: COOPS_TidalDatum | None = None,
) -> Dataset:
"""
retrieve data for the current station within the specified parameters
Expand Down Expand Up @@ -398,13 +398,13 @@ class COOPS_Query(StationQuery): # noqa: N801
def __init__(
self,
station: int,
product: COOPS_Product | None,
product: COOPS_Product,
start_date: datetime,
end_date: datetime | None = None,
datum: COOPS_TidalDatum | None = None,
units: COOPS_Units | None = None,
time_zone: COOPS_TimeZone | None = None,
interval: COOPS_Interval = None,
interval: COOPS_Interval | None = None,
):
"""
instantiate a new query with the specified parameters
Expand Down Expand Up @@ -638,7 +638,7 @@ def __coops_stations_html_tables() -> element.ResultSet:


@lru_cache(maxsize=1)
def coops_stations(station_status: StationStatus = None) -> GeoDataFrame:
def coops_stations(station_status: StationStatus | None = None) -> GeoDataFrame:
"""
retrieve a list of CO-OPS stations with associated metadata
Expand Down Expand Up @@ -791,8 +791,8 @@ def coops_stations(station_status: StationStatus = None) -> GeoDataFrame:


def coops_stations_within_region(
region: Polygon,
station_status: StationStatus = None,
region: Polygon | None = None,
station_status: StationStatus | None = None,
) -> GeoDataFrame:
"""
retrieve all stations within the specified region of interest
Expand Down Expand Up @@ -832,7 +832,7 @@ def coops_stations_within_bounds(
miny: float,
maxx: float,
maxy: float,
station_status: StationStatus = None,
station_status: StationStatus | None = None,
) -> GeoDataFrame:
return coops_stations_within_region(
region=shapely.geometry.box(minx=minx, miny=miny, maxx=maxx, maxy=maxy),
Expand All @@ -844,10 +844,10 @@ def coops_product_within_region(
product: COOPS_Product,
region: Union[Polygon, MultiPolygon],
start_date: datetime,
end_date: datetime = None,
datum: COOPS_TidalDatum = None,
interval: COOPS_Interval = None,
station_status: StationStatus = None,
end_date: datetime | None = None,
datum: COOPS_TidalDatum | None = None,
interval: COOPS_Interval | None = None,
station_status: StationStatus | None = None,
) -> Dataset:
"""
retrieve CO-OPS data from within the specified region of interest
Expand Down

0 comments on commit b65cae9

Please sign in to comment.