MCPcopy
hub / github.com/pydata/xarray / _decode_datetime_with_cftime

Function _decode_datetime_with_cftime

xarray/coding/times.py:374–386  ·  view source on GitHub ↗
(
    num_dates: np.ndarray, units: str, calendar: str
)

Source from the content-addressed store, hash-verified

372
373
374def _decode_datetime_with_cftime(
375 num_dates: np.ndarray, units: str, calendar: str
376) -> np.ndarray:
377 if TYPE_CHECKING:
378 import cftime
379 else:
380 cftime = attempt_import("cftime")
381 if num_dates.size > 0:
382 return np.asarray(
383 cftime.num2date(num_dates, units, calendar, only_use_cftime_datetimes=True)
384 )
385 else:
386 return np.array([], dtype=object)
387
388
389def _check_date_for_units_since_refdate(

Callers 1

decode_cf_datetimeFunction · 0.85

Calls 1

attempt_importFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…