Skip to content

Commit 5835875

Browse files
committed
Fields: rm unused len and iter impl
1 parent 19ddff0 commit 5835875

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

src/stagpy/step.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
from abc import ABC, abstractmethod
1313
from dataclasses import dataclass
1414
from functools import cached_property
15-
from itertools import chain
1615

1716
import numpy as np
1817

@@ -21,7 +20,7 @@
2120
from .dimensions import Scales
2221

2322
if typing.TYPE_CHECKING:
24-
from typing import Any, Callable, Iterator, Mapping, NoReturn
23+
from typing import Any, Callable, Mapping, NoReturn
2524

2625
from numpy.typing import NDArray
2726
from pandas import DataFrame, Series
@@ -324,22 +323,12 @@ def __getitem__(self, name: str) -> Field:
324323
self._cache.insert(self.step.istep, fld_name, fld)
325324
return self[name]
326325

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-
334326
def __contains__(self, item: Any) -> bool:
335327
try:
336328
return self[item] is not None
337329
except error.MissingDataError:
338330
return False
339331

340-
def __len__(self) -> int:
341-
return len(self._present_fields)
342-
343332
def __eq__(self, other: object) -> bool:
344333
return self is other
345334

0 commit comments

Comments
 (0)