MCPcopy Create free account
hub / github.com/PyTables/PyTables / itersequence

Method itersequence

tables/table.py:1732–1754  ·  view source on GitHub ↗

Iterate over a sequence of row coordinates.

(self, sequence: Sequence)

Source from the content-addressed store, hash-verified

1730 return internal_to_flavor(coords, self.flavor)
1731
1732 def itersequence(self, sequence: Sequence) -> Iterator[tableextension.Row]:
1733 """Iterate over a sequence of row coordinates."""
1734 if not hasattr(sequence, "__getitem__"):
1735 raise TypeError(
1736 "Wrong 'sequence' parameter type. Only sequences "
1737 "are suported."
1738 )
1739 # start, stop and step are necessary for the new iterator for
1740 # coordinates, and perhaps it would be useful to add them as
1741 # parameters in the future (not now, because I've just removed
1742 # the `sort` argument for 2.1).
1743 #
1744 # *Important note*: Negative values for step are not supported
1745 # for the general case, but only for the itersorted() and
1746 # read_sorted() purposes! The self._process_range_read will raise
1747 # an appropriate error.
1748 # F. Alted 2008-09-18
1749 # A.V. 20130513: _process_range_read --> _process_range
1750 start, stop, step = self._process_range(None, None, None)
1751 if (start > stop) or (len(sequence) == 0):
1752 return iter([])
1753 row = tableextension.Row(self)
1754 return row._iter(start, stop, step, coords=sequence)
1755
1756 def _check_sortby_csi(
1757 self, sortby: Column | str, check_csi: bool

Callers 9

_table__where_indexedFunction · 0.80
test05aMethod · 0.80
test05bMethod · 0.80
test06aMethod · 0.80
test06bMethod · 0.80
test07aMethod · 0.80
test07bMethod · 0.80
test08aMethod · 0.80
test08bMethod · 0.80

Calls 1

_process_rangeMethod · 0.45

Tested by 8

test05aMethod · 0.64
test05bMethod · 0.64
test06aMethod · 0.64
test06bMethod · 0.64
test07aMethod · 0.64
test07bMethod · 0.64
test08aMethod · 0.64
test08bMethod · 0.64