(
self, start: int, stop: int, step: int, warn_negstep: bool = True
)
| 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, |
no test coverage detected