Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 96074c7

Browse files
authored
Merge pull request #10095 from anntzer/remove-debugging
MNT: Remove some debugging code.
2 parents 355943e + 10c48c9 commit 96074c7

File tree

6 files changed

+4
-42
lines changed

6 files changed

+4
-42
lines changed

lib/matplotlib/backends/backend_gtkagg.py

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
from matplotlib.backends._gtkagg import agg_to_gtk_drawable
1818

1919

20-
DEBUG = False
21-
2220
class NavigationToolbar2GTKAgg(NavigationToolbar2GTK):
2321
def _get_canvas(self, fig):
2422
return FigureCanvasGTKAgg(fig)
@@ -41,7 +39,6 @@ class FigureCanvasGTKAgg(FigureCanvasGTK, FigureCanvasAgg):
4139

4240
def configure_event(self, widget, event=None):
4341

44-
if DEBUG: print('FigureCanvasGTKAgg.configure_event')
4542
if widget.window is None:
4643
return
4744
try:
@@ -58,14 +55,10 @@ def configure_event(self, widget, event=None):
5855
self.figure.set_size_inches(winch, hinch, forward=False)
5956
self._need_redraw = True
6057
self.resize_event()
61-
if DEBUG: print('FigureCanvasGTKAgg.configure_event end')
6258
return True
6359

6460
def _render_figure(self, pixmap, width, height):
65-
if DEBUG: print('FigureCanvasGTKAgg.render_figure')
6661
FigureCanvasAgg.draw(self)
67-
if DEBUG: print('FigureCanvasGTKAgg.render_figure pixmap', pixmap)
68-
#agg_to_gtk_drawable(pixmap, self.renderer._renderer, None)
6962

7063
buf = self.buffer_rgba()
7164
ren = self.get_renderer()
@@ -76,17 +69,12 @@ def _render_figure(self, pixmap, width, height):
7669
buf, gtk.gdk.COLORSPACE_RGB, True, 8, w, h, w*4)
7770
pixmap.draw_pixbuf(pixmap.new_gc(), pixbuf, 0, 0, 0, 0, w, h,
7871
gtk.gdk.RGB_DITHER_NONE, 0, 0)
79-
if DEBUG: print('FigureCanvasGTKAgg.render_figure done')
8072

8173
def blit(self, bbox=None):
82-
if DEBUG: print('FigureCanvasGTKAgg.blit', self._pixmap)
8374
agg_to_gtk_drawable(self._pixmap, self.renderer._renderer, bbox)
84-
8575
x, y, w, h = self.allocation
86-
87-
self.window.draw_drawable (self.style.fg_gc[self.state], self._pixmap,
88-
0, 0, 0, 0, w, h)
89-
if DEBUG: print('FigureCanvasGTKAgg.done')
76+
self.window.draw_drawable(self.style.fg_gc[self.state], self._pixmap,
77+
0, 0, 0, 0, w, h)
9078

9179
def print_png(self, filename, *args, **kwargs):
9280
# Do this so we can save the resolution of figure in the PNG file

lib/matplotlib/backends/backend_ps.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1345,18 +1345,13 @@ def write(self, *kl, **kwargs):
13451345
paperHeight,
13461346
orientation)
13471347

1348-
if rcParams['ps.usedistiller'] == 'ghostscript':
1348+
if (rcParams['ps.usedistiller'] == 'ghostscript'
1349+
or rcParams['text.usetex']):
13491350
gs_distill(tmpfile, isEPSF, ptype=papertype, bbox=bbox,
13501351
rotated=psfrag_rotated)
13511352
elif rcParams['ps.usedistiller'] == 'xpdf':
13521353
xpdf_distill(tmpfile, isEPSF, ptype=papertype, bbox=bbox,
13531354
rotated=psfrag_rotated)
1354-
elif rcParams['text.usetex']:
1355-
if False:
1356-
pass # for debugging
1357-
else:
1358-
gs_distill(tmpfile, isEPSF, ptype=papertype, bbox=bbox,
1359-
rotated=psfrag_rotated)
13601355

13611356
if is_writable_file_like(outfile):
13621357
if file_requires_unicode(outfile):

lib/matplotlib/backends/qt_editor/formlayout.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@
4444
__version__ = '1.0.10'
4545
__license__ = __doc__
4646

47-
DEBUG = False
48-
4947
import copy
5048
import datetime
5149
import warnings
@@ -222,12 +220,6 @@ def __init__(self, data, comment="", parent=None):
222220
if comment:
223221
self.formlayout.addRow(QtWidgets.QLabel(comment))
224222
self.formlayout.addRow(QtWidgets.QLabel(" "))
225-
if DEBUG:
226-
print("\n"+("*"*80))
227-
print("DATA:", self.data)
228-
print("*"*80)
229-
print("COMMENT:", comment)
230-
print("*"*80)
231223

232224
def get_dialog(self):
233225
"""Return FormDialog instance"""
@@ -238,8 +230,6 @@ def get_dialog(self):
238230

239231
def setup(self):
240232
for label, value in self.data:
241-
if DEBUG:
242-
print("value:", value)
243233
if label is None and value is None:
244234
# Separator: (None, None)
245235
self.formlayout.addRow(QtWidgets.QLabel(" "), QtWidgets.QLabel(" "))

lib/matplotlib/offsetbox.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434

3535
from matplotlib import docstring
3636

37-
#from bboximage import BboxImage
3837
from matplotlib.image import BboxImage
3938

4039
from matplotlib.patches import bbox_artist as mbbox_artist

lib/matplotlib/sankey.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -734,13 +734,6 @@ def _get_angle(a, r):
734734
vertices = translate(rotate(vertices))
735735
kwds = dict(s=patchlabel, ha='center', va='center')
736736
text = self.ax.text(*offset, **kwds)
737-
if False: # Debug
738-
print("llpath\n", llpath)
739-
print("ulpath\n", self._revert(ulpath))
740-
print("urpath\n", urpath)
741-
print("lrpath\n", self._revert(lrpath))
742-
xs, ys = list(zip(*vertices))
743-
self.ax.plot(xs, ys, 'go-')
744737
if rcParams['_internal.classic_mode']:
745738
fc = kwargs.pop('fc', kwargs.pop('facecolor', '#bfd1d4'))
746739
lw = kwargs.pop('lw', kwargs.pop('linewidth', 0.5))

lib/matplotlib/transforms.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1909,9 +1909,6 @@ def __init__(self, matrix=None, **kwargs):
19091909
Affine2DBase.__init__(self, **kwargs)
19101910
if matrix is None:
19111911
matrix = np.identity(3)
1912-
elif DEBUG:
1913-
matrix = np.asarray(matrix, float)
1914-
assert matrix.shape == (3, 3)
19151912
self._mtx = matrix
19161913
self._invalid = 0
19171914

0 commit comments

Comments
 (0)