MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / _update_trajectory

Method _update_trajectory

lib/matplotlib/streamplot.py:463–478  ·  view source on GitHub ↗

Update current trajectory position in mask. If the new position has already been filled, raise `InvalidIndexError`.

(self, xm, ym, broken_streamlines=True)

Source from the content-addressed store, hash-verified

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
481class InvalidIndexError(Exception):

Callers 2

_start_trajectoryMethod · 0.95
update_trajectoryMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected