|
26 | 26 | from mikecore.DfsuFile import DfsuFileType
|
27 | 27 |
|
28 | 28 | from ..eum import EUMType, EUMUnit, ItemInfo
|
29 |
| -from ._data_utils import _get_time_idx_list, _n_selected_timesteps |
| 29 | +from .._time import _get_time_idx_list, _n_selected_timesteps |
30 | 30 |
|
31 | 31 | if TYPE_CHECKING:
|
32 | 32 | from ._dataset import Dataset
|
@@ -620,8 +620,8 @@ def __getitem__(self, key: Any) -> "DataArray":
|
620 | 620 | if isinstance(k, Iterable) or k != slice(None):
|
621 | 621 | if dims[j] == "time":
|
622 | 622 | # getitem accepts fancy indexing only for time
|
623 |
| - k = self._get_time_idx_list(self.time, k) |
624 |
| - if self._n_selected_timesteps(self.time, k) == 0: |
| 623 | + k = _get_time_idx_list(self.time, k) |
| 624 | + if _n_selected_timesteps(self.time, k) == 0: |
625 | 625 | raise IndexError("No timesteps found!")
|
626 | 626 | da = da.isel(**{dims[j]: k})
|
627 | 627 | return da
|
@@ -2088,17 +2088,6 @@ def _time_by_agg_axis(
|
2088 | 2088 |
|
2089 | 2089 | return time
|
2090 | 2090 |
|
2091 |
| - @staticmethod |
2092 |
| - def _get_time_idx_list( |
2093 |
| - time: pd.DatetimeIndex, |
2094 |
| - steps: int | Iterable[int] | str | datetime | pd.DatetimeIndex | slice, |
2095 |
| - ) -> list[int] | slice: |
2096 |
| - """Find list of idx in DatetimeIndex.""" |
2097 |
| - return _get_time_idx_list(time, steps) |
2098 |
| - |
2099 |
| - @staticmethod |
2100 |
| - def _n_selected_timesteps(time: Sized, k: slice | Sized) -> int: |
2101 |
| - return _n_selected_timesteps(time, k) |
2102 | 2091 |
|
2103 | 2092 | @staticmethod
|
2104 | 2093 | def _is_boolean_mask(x: Any) -> bool:
|
|
0 commit comments