| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -91,7 +91,6 @@ class RedirectFrom(Directive): | |||
| 91 | 91 | def run(self): | |
| 92 | 92 | redirected_doc, = self.arguments | |
| 93 | 93 | env = self.app.env | |
| 94 | - builder = self.app.builder | ||
| 95 | 94 | domain = env.get_domain('redirect_from') | |
| 96 | 95 | current_doc = env.path2doc(self.state.document.current_source) | |
| 97 | 96 | redirected_reldoc, _ = env.relfn2path(redirected_doc, current_doc) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -29,7 +29,6 @@ def on_move(event): | |||
| 29 | 29 | if event.inaxes: | |
| 30 | 30 | # get the x and y pixel coords | |
| 31 | 31 | x, y = event.x, event.y | |
| 32 | - ax = event.inaxes # the axes instance | ||
| 33 | 32 | print('data coords %f %f, pixel coords %f %f' | |
| 34 | 33 | % (event.xdata, event.ydata, x, y)) | |
| 35 | 34 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -190,7 +190,7 @@ def __init__(self, ax): | |||
| 190 | 190 | animated=False) | |
| 191 | 191 | self.canvas.mpl_connect('key_press_event', self.on_key_press) | |
| 192 | 192 | ||
| 193 | - def draw(self, event): | ||
| 193 | + def draw(self): | ||
| 194 | 194 | draw_artist = self.ax.draw_artist | |
| 195 | 195 | if self.background is None: | |
| 196 | 196 | self.background = self.canvas.copy_from_bbox(self.ax.bbox) | |
@@ -318,7 +318,7 @@ def start_anim(event): | |||
| 318 | 318 | ||
| 319 | 319 | def local_draw(): | |
| 320 | 320 | if animation.ax.get_renderer_cache(): | |
| 321 | - animation.draw(None) | ||
| 321 | + animation.draw() | ||
| 322 | 322 | start_anim.timer.add_callback(local_draw) | |
| 323 | 323 | start_anim.timer.start() | |
| 324 | 324 | canvas.mpl_connect('draw_event', on_redraw) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -33,7 +33,7 @@ def some_function(x): | |||
| 33 | 33 | def __init__(self, *args, **kwargs): | |
| 34 | 34 | if args and kwargs: | |
| 35 | 35 | raise TypeError("Only positional or keyword args are allowed") | |
| 36 | - self.params = params = args or kwargs | ||
| 36 | + self.params = args or kwargs | ||
| 37 | 37 | ||
| 38 | 38 | def __call__(self, func): | |
| 39 | 39 | if func.__doc__: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -507,13 +507,7 @@ def seq_id(): | |||
| 507 | 507 | return '%06d' % next(_layoutboxobjnum) | |
| 508 | 508 | ||
| 509 | 509 | ||
| 510 | - def print_children(lb): | ||
| 511 | - """Print the children of the layoutbox.""" | ||
| 512 | - for child in lb.children: | ||
| 513 | - print_children(child) | ||
| 514 | - | ||
| 515 | - | ||
| 516 | - def plot_children(fig, lg=None, level=0, printit=False): | ||
| 510 | + def plot_children(fig, lg=None, level=0): | ||
| 517 | 511 | """Simple plotting to show where boxes are.""" | |
| 518 | 512 | import matplotlib.pyplot as plt | |
| 519 | 513 | import matplotlib.patches as mpatches | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -284,24 +284,22 @@ def add_tool(self, name, tool, *args, **kwargs): | |||
| 284 | 284 | ||
| 285 | 285 | # If initially toggled | |
| 286 | 286 | if tool_obj.toggled: | |
| 287 | - self._handle_toggle(tool_obj, None, None, None) | ||
| 287 | + self._handle_toggle(tool_obj, None, None) | ||
| 288 | 288 | tool_obj.set_figure(self.figure) | |
| 289 | 289 | ||
| 290 | 290 | event = ToolEvent('tool_added_event', self, tool_obj) | |
| 291 | 291 | self._callbacks.process(event.name, event) | |
| 292 | 292 | ||
| 293 | 293 | return tool_obj | |
| 294 | 294 | ||
| 295 | - def _handle_toggle(self, tool, sender, canvasevent, data): | ||
| 295 | + def _handle_toggle(self, tool, canvasevent, data): | ||
| 296 | 296 | """ | |
| 297 | 297 | Toggle tools, need to untoggle prior to using other Toggle tool. | |
| 298 | 298 | Called from trigger_tool. | |
| 299 | 299 | ||
| 300 | 300 | Parameters | |
| 301 | 301 | ---------- | |
| 302 | 302 | tool : `.ToolBase` | |
| 303 | - sender : object | ||
| 304 | - Object that wishes to trigger the tool. | ||
| 305 | 303 | canvasevent : Event | |
| 306 | 304 | Original Canvas event or None. | |
| 307 | 305 | data : object | |
@@ -360,7 +358,7 @@ def trigger_tool(self, name, sender=None, canvasevent=None, data=None): | |||
| 360 | 358 | sender = self | |
| 361 | 359 | ||
| 362 | 360 | if isinstance(tool, backend_tools.ToolToggleBase): | |
| 363 | - self._handle_toggle(tool, sender, canvasevent, data) | ||
| 361 | + self._handle_toggle(tool, canvasevent, data) | ||
| 364 | 362 | ||
| 365 | 363 | tool.trigger(sender, canvasevent, data) # Actually trigger Tool. | |
| 366 | 364 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -356,7 +356,6 @@ def _read(self): | |||
| 356 | 356 | while True: | |
| 357 | 357 | byte = self.file.read(1)[0] | |
| 358 | 358 | self._dtable[byte](self, byte) | |
| 359 | - name = self._dtable[byte].__name__ | ||
| 360 | 359 | if byte == 140: # end of page | |
| 361 | 360 | return True | |
| 362 | 361 | if self.state is _dvistate.post_post: # end of file | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -890,7 +890,7 @@ def set_stretch(self, stretch): | |||
| 890 | 890 | return | |
| 891 | 891 | try: | |
| 892 | 892 | stretch = int(stretch) | |
| 893 | - except ValueError as err: | ||
| 893 | + except ValueError: | ||
| 894 | 894 | pass | |
| 895 | 895 | else: | |
| 896 | 896 | if 0 <= stretch <= 1000: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3822,8 +3822,6 @@ def test_errorbar_nan(fig_test, fig_ref): | |||
| 3822 | 3822 | es = np.array([4, 5, np.nan, np.nan, 6]) | |
| 3823 | 3823 | ax.errorbar(xs, ys, es) | |
| 3824 | 3824 | ax = fig_ref.add_subplot() | |
| 3825 | - ys = np.array([1, 2, np.nan, np.nan, 3]) | ||
| 3826 | - es = np.array([4, 5, np.nan, np.nan, 6]) | ||
| 3827 | 3825 | ax.errorbar([0, 1], [1, 2], [4, 5]) | |
| 3828 | 3826 | ax.errorbar([4], [3], [6], fmt="C0") | |
| 3829 | 3827 | ||
@@ -7787,10 +7785,7 @@ def test_patch_bounds(): # PR 19078 | |||
| 7787 | 7785 | def test_warn_ignored_scatter_kwargs(): | |
| 7788 | 7786 | with pytest.warns(UserWarning, | |
| 7789 | 7787 | match=r"You passed a edgecolor/edgecolors"): | |
| 7790 | - | ||
| 7791 | - c = plt.scatter( | ||
| 7792 | - [0], [0], marker="+", s=500, facecolor="r", edgecolor="b" | ||
| 7793 | - ) | ||
| 7788 | + plt.scatter([0], [0], marker="+", s=500, facecolor="r", edgecolor="b") | ||
| 7794 | 7789 | ||
| 7795 | 7790 | ||
| 7796 | 7791 | def test_artist_sublists(): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -29,7 +29,6 @@ | |||
| 29 | 29 | ||
| 30 | 30 | @pytest.fixture | |
| 31 | 31 | def qt_core(request): | |
| 32 | - backend, = request.node.get_closest_marker('backend').args | ||
| 33 | 32 | qt_compat = pytest.importorskip('matplotlib.backends.qt_compat') | |
| 34 | 33 | QtCore = qt_compat.QtCore | |
| 35 | 34 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments