Update current trajectory position in mask. If the new position has already been filled, raise `InvalidIndexError`.
(self, xm, ym, broken_streamlines=True)
| 461 | self._mask[t] = 0 |
| 462 | |
| 463 | def _update_trajectory(self, xm, ym, broken_streamlines=True): |
| 464 | """ |
| 465 | Update current trajectory position in mask. |
| 466 | |
| 467 | If the new position has already been filled, raise `InvalidIndexError`. |
| 468 | """ |
| 469 | if self._current_xy != (xm, ym): |
| 470 | if self[ym, xm] == 0: |
| 471 | self._traj.append((ym, xm)) |
| 472 | self._mask[ym, xm] = 1 |
| 473 | self._current_xy = (xm, ym) |
| 474 | else: |
| 475 | if broken_streamlines: |
| 476 | raise InvalidIndexError |
| 477 | else: |
| 478 | pass |
| 479 | |
| 480 | |
| 481 | class InvalidIndexError(Exception): |
no outgoing calls
no test coverage detected