Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

coops: Differentiate between empty region and no region input #92

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions examples/IOC_data.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
},
"outputs": [],
"source": [
"east_stations[~east_stations.contacts.str.contains(\"NOAA\")]"
"east_stations[~east_stations.contacts.str.contains(\"NOAA\", na=False)]"
]
},
{
Expand Down Expand Up @@ -253,7 +253,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "python3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -267,7 +267,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.16"
"version": "3.10.9"
}
},
"nbformat": 4,
Expand Down
5 changes: 2 additions & 3 deletions searvey/coops.py
Original file line number Diff line number Diff line change
Expand Up @@ -821,10 +821,9 @@ def coops_stations_within_region(
"""

stations = coops_stations(station_status=station_status)
if region:
if region is not None:
return stations[stations.within(region)]
else:
return stations
return stations


def coops_stations_within_bounds(
Expand Down
2 changes: 2 additions & 0 deletions searvey/stations.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ def _get_ioc_stations(
ioc_gdf = ioc.get_ioc_stations(region=region)

# Normalize IOC
# Drop delay `NA'` : https://github.com/oceanmodeling/searvey/issues/91
ioc_gdf = ioc_gdf[ioc_gdf.delay != "NA'"]
# Convert delay to minutes
ioc_gdf = ioc_gdf.assign(
delay=pd.concat(
Expand Down