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

Function _align_reference_date_and_unit

xarray/coding/times.py:433–441  ·  view source on GitHub ↗
(
    ref_date: pd.Timestamp, unit: NPDatetimeUnitOptions
)

Source from the content-addressed store, hash-verified

431
432
433def _align_reference_date_and_unit(
434 ref_date: pd.Timestamp, unit: NPDatetimeUnitOptions
435) -> pd.Timestamp:
436 # align to the highest needed resolution of ref_date or unit
437 if np.timedelta64(1, ref_date.unit) > np.timedelta64(1, unit):
438 # this will raise accordingly
439 # if data can't be represented in the higher resolution
440 return timestamp_as_unit(ref_date, cast(PDDatetimeUnitOptions, unit))
441 return ref_date
442
443
444def _check_date_is_after_shift(

Callers 1

Calls 1

timestamp_as_unitFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…