Returns the nearest day in the target calendar of the corresponding "decimal year" in the source calendar.
(times, target_calendar)
| 245 | |
| 246 | |
| 247 | def _interpolate_day_of_year(times, target_calendar): |
| 248 | """Returns the nearest day in the target calendar of the corresponding "decimal year" in the source calendar.""" |
| 249 | source_calendar = times.dt.calendar |
| 250 | return np.round( |
| 251 | _days_in_year(times.dt.year, target_calendar) |
| 252 | * times.dt.dayofyear |
| 253 | / _days_in_year(times.dt.year, source_calendar) |
| 254 | ).astype(int) |
| 255 | |
| 256 | |
| 257 | def _random_day_of_year(time, target_calendar, use_cftime): |
no test coverage detected
searching dependent graphs…