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

Function _unpack_time_unit_and_ref_date

xarray/coding/times.py:313–323  ·  view source on GitHub ↗
(
    units: str,
)

Source from the content-addressed store, hash-verified

311
312
313def _unpack_time_unit_and_ref_date(
314 units: str,
315) -> tuple[NPDatetimeUnitOptions, pd.Timestamp]:
316 # same us _unpack_netcdf_time_units but finalizes ref_date for
317 # processing in encode_cf_datetime
318 time_unit, _ref_date = _unpack_netcdf_time_units(units)
319 time_unit = _netcdf_to_numpy_timeunit(time_unit)
320 ref_date = pd.Timestamp(_ref_date)
321 ref_date = _cast_timestamp_to_coarsest_resolution(ref_date)
322 ref_date = _maybe_strip_tz_from_timestamp(ref_date)
323 return time_unit, ref_date
324
325
326def _unpack_time_units_and_ref_date_cftime(units: str, calendar: str):

Callers 3

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…