|
12 | 12 | from abc import ABC, abstractmethod |
13 | 13 | from dataclasses import dataclass |
14 | 14 | from functools import cached_property |
15 | | -from itertools import chain |
16 | 15 |
|
17 | 16 | import numpy as np |
18 | 17 |
|
|
21 | 20 | from .dimensions import Scales |
22 | 21 |
|
23 | 22 | if typing.TYPE_CHECKING: |
24 | | - from typing import Any, Callable, Iterator, Mapping, NoReturn |
| 23 | + from typing import Any, Callable, Mapping, NoReturn |
25 | 24 |
|
26 | 25 | from numpy.typing import NDArray |
27 | 26 | from pandas import DataFrame, Series |
@@ -324,22 +323,12 @@ def __getitem__(self, name: str) -> Field: |
324 | 323 | self._cache.insert(self.step.istep, fld_name, fld) |
325 | 324 | return self[name] |
326 | 325 |
|
327 | | - @cached_property |
328 | | - def _present_fields(self) -> list[str]: |
329 | | - return [fld for fld in chain(self._vars, self._extra) if fld in self] |
330 | | - |
331 | | - def __iter__(self) -> Iterator[str]: |
332 | | - return iter(self._present_fields) |
333 | | - |
334 | 326 | def __contains__(self, item: Any) -> bool: |
335 | 327 | try: |
336 | 328 | return self[item] is not None |
337 | 329 | except error.MissingDataError: |
338 | 330 | return False |
339 | 331 |
|
340 | | - def __len__(self) -> int: |
341 | | - return len(self._present_fields) |
342 | | - |
343 | 332 | def __eq__(self, other: object) -> bool: |
344 | 333 | return self is other |
345 | 334 |
|
|
0 commit comments