Skip to content

Commit

Permalink
Revert default none stn status & fixstyling
Browse files Browse the repository at this point in the history
  • Loading branch information
SorooshMani-NOAA committed Aug 23, 2024
1 parent 475fd6e commit 39b2962
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion stormevents/nhc/track.py
Original file line number Diff line number Diff line change
Expand Up @@ -1134,7 +1134,7 @@ def __compute_velocity(data: DataFrame) -> DataFrame:
.astype("timedelta64[s]")
.astype(float)
)
with numpy.errstate(invalid='ignore'):
with numpy.errstate(invalid="ignore"):
speeds = pandas.Series(distances / abs(intervals), index=indices)
bearings = pandas.Series(inverse_azimuths % 360, index=indices)
# use forward azimuths for negative intervals
Expand Down
12 changes: 4 additions & 8 deletions stormevents/stormevent.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ def coops_product_within_region(
region: Polygon,
start_date: datetime = None,
end_date: datetime = None,
status: StationStatus = StationStatus.ACTIVE,
status: StationStatus = None,
datum: COOPS_TidalDatum = None,
units: COOPS_Units = None,
time_zone: COOPS_TimeZone = None,
Expand Down Expand Up @@ -491,10 +491,9 @@ def coops_product_within_region(

stations = gpd.GeoDataFrame()
if not region.is_empty:
stations = get_coops_stations(
region=region, metadata_source='main'
)
stations = stations[stations.status == status.value]
stations = get_coops_stations(region=region, metadata_source="main")
if status is not None:
stations = stations[stations.status == status.value]

if len(stations) > 0:
stations_data = []
Expand All @@ -508,12 +507,10 @@ def coops_product_within_region(
datum=datum,
).data


station_data["nos_id"] = station.Index
station_data.set_index(["nos_id", station_data.index], inplace=True)
station_data = station_data.to_xarray()


if len(station_data["t"]) > 0:
station_data = station_data.assign_coords(
nws_id=("nos_id", [station.nws_id]),
Expand All @@ -535,7 +532,6 @@ def coops_product_within_region(
coords={"t": None, "nos_id": None, "nws_id": None, "x": None, "y": None}
)


return stations_ds

def __repr__(self) -> str:
Expand Down

0 comments on commit 39b2962

Please sign in to comment.