Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

use today as max_time in fast glider #101

Merged
Merged
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: 5 additions & 1 deletion ioos_metrics/ioos_metrics.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Code extracted from IOOS_BTN.ipynb."""

import datetime
import functools
import io
import logging
Expand Down Expand Up @@ -94,7 +95,7 @@ def federal_partners():


@functools.lru_cache(maxsize=128)
def ngdac_gliders_fast(min_time="2000-01-01T00:00:00Z", max_time="2023-12-31T23:59:59Z") -> int:
def ngdac_gliders_fast(min_time="2000-01-01T00:00:00Z", max_time=None) -> int:
MathewBiddle marked this conversation as resolved.
Show resolved Hide resolved
"""NGDAC Glider Days.

This version uses the AllDatasets entry to compute the glider days.
Expand All @@ -121,6 +122,9 @@ def ngdac_gliders_fast(min_time="2000-01-01T00:00:00Z", max_time="2023-12-31T23:
Note that data with NaN can be real glider day with lost data. Which is OK for this metric.

"""
if max_time is None:
max_time = datetime.datetime.now(datetime.UTC).strftime("%Y-%m-%dT%H:%M:%SZ")

df = pd.read_csv(
"https://gliders.ioos.us/erddap/tabledap/allDatasets.csvp?minTime,maxTime,datasetID",
)
Expand Down
Loading