(
num_dates: np.ndarray, units: str, calendar: str
)
| 372 | |
| 373 | |
| 374 | def _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 | |
| 389 | def _check_date_for_units_since_refdate( |
no test coverage detected
searching dependent graphs…