Find the day in `other`'s month that satisfies a BaseCFTimeOffset's onOffset policy, as described by the `day_option` argument. Parameters ---------- other : cftime.datetime day_option : 'start', 'end' 'start': returns 1 'end': returns last day of the month
(other, day_option: DayOption)
| 235 | |
| 236 | |
| 237 | def _get_day_of_month(other, day_option: DayOption) -> int: |
| 238 | """Find the day in `other`'s month that satisfies a BaseCFTimeOffset's |
| 239 | onOffset policy, as described by the `day_option` argument. |
| 240 | |
| 241 | Parameters |
| 242 | ---------- |
| 243 | other : cftime.datetime |
| 244 | day_option : 'start', 'end' |
| 245 | 'start': returns 1 |
| 246 | 'end': returns last day of the month |
| 247 | |
| 248 | Returns |
| 249 | ------- |
| 250 | day_of_month : int |
| 251 | |
| 252 | """ |
| 253 | |
| 254 | if day_option == "start": |
| 255 | return 1 |
| 256 | elif day_option == "end": |
| 257 | return other.daysinmonth |
| 258 | elif day_option is None: |
| 259 | # Note: unlike `_shift_month`, _get_day_of_month does not |
| 260 | # allow day_option = None |
| 261 | raise NotImplementedError() |
| 262 | raise ValueError(day_option) |
| 263 | |
| 264 | |
| 265 | def _adjust_n_months(other_day, n, reference_day): |
no outgoing calls
no test coverage detected
searching dependent graphs…