Skip to content

Commit b2fcf3b

Browse files
authored
Merge pull request #5481 from emmanuel-ferdman/fix-warnings-format
fix: Remove global warning format side effect
2 parents 4e953f3 + 87befc3 commit b2fcf3b

File tree

2 files changed

+0
-16
lines changed

2 files changed

+0
-16
lines changed

plotly/matplotlylib/renderer.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,6 @@
1414
from plotly.matplotlylib import mpltools
1515

1616

17-
# Warning format
18-
def warning_on_one_line(msg, category, filename, lineno, file=None, line=None):
19-
return "%s:%s: %s:\n\n%s\n\n" % (filename, lineno, category.__name__, msg)
20-
21-
22-
warnings.formatwarning = warning_on_one_line
23-
24-
2517
class PlotlyRenderer(Renderer):
2618
"""A renderer class inheriting from base for rendering mpl plots in plotly.
2719

plotly/tools.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,6 @@
5555
ALTERNATIVE_HISTNORM = "probability"
5656

5757

58-
# Warning format
59-
def warning_on_one_line(message, category, filename, lineno, file=None, line=None):
60-
return "%s:%s: %s:\n\n%s\n\n" % (filename, lineno, category.__name__, message)
61-
62-
63-
warnings.formatwarning = warning_on_one_line
64-
65-
6658
### mpl-related tools ###
6759
def mpl_to_plotly(fig, resize=False, strip_style=False, verbose=False):
6860
"""Convert a matplotlib figure to plotly dictionary and send.

0 commit comments

Comments
 (0)