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

Method _process_range_read

tables/leaf.py:551–572  ·  view source on GitHub ↗
(
        self, start: int, stop: int, step: int, warn_negstep: bool = True
    )

Source from the content-addressed store, hash-verified

549
550 # This method is appropriate for calls to read() methods
551 def _process_range_read(
552 self, start: int, stop: int, step: int, warn_negstep: bool = True
553 ) -> tuple[int, int, int]:
554 nrows = self.nrows
555 if start is not None and stop is None and step is None:
556 # Protection against start greater than available records
557 # nrows == 0 is a special case for empty objects
558 if 0 < nrows <= start:
559 raise IndexError(
560 "start of range (%s) is greater than "
561 "number of rows (%s)" % (start, nrows)
562 )
563 step = 1
564 if start == -1: # corner case
565 stop = nrows
566 else:
567 stop = start + 1
568 # Finally, get the correct values (over the main dimension)
569 start, stop, step = self._process_range(
570 start, stop, step, warn_negstep=warn_negstep
571 )
572 return (start, stop, step)
573
574 def _g_copy(
575 self,

Callers 9

readMethod · 0.80
_g_copy_with_statsMethod · 0.80
_g_copy_with_statsMethod · 0.80
_whereMethod · 0.80
_g_copy_with_statsMethod · 0.80
_g_copy_with_statsMethod · 0.80
readMethod · 0.80
_g_copy_with_statsMethod · 0.80
_computeFunction · 0.80

Calls 1

_process_rangeMethod · 0.95

Tested by

no test coverage detected