MCPcopy Index your code
hub / github.com/pydata/xarray / _infer_needed_units_cftime

Function _infer_needed_units_cftime

xarray/coding/times.py:1053–1061  ·  view source on GitHub ↗
(ref_date, data_units, calendar)

Source from the content-addressed store, hash-verified

1051
1052
1053def _infer_needed_units_cftime(ref_date, data_units, calendar):
1054 needed_units, data_ref_date = _unpack_time_units_and_ref_date_cftime(
1055 data_units, calendar
1056 )
1057 ref_delta = abs(data_ref_date - ref_date)
1058 data_delta = _time_units_to_timedelta(needed_units)
1059 if (ref_delta % data_delta) > timedelta(seconds=0):
1060 needed_units = _infer_time_units_from_diff(ref_delta)
1061 return needed_units
1062
1063
1064def _eagerly_encode_cf_datetime(

Callers 1

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…