Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Replace warnings.warn with cbook._warn_external or logging.warning#12006

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

hershen
Copy link
Contributor

PR Summary

Fix issue#10643

  1. Added stacklevel=2 to all warnings.warn calls that didn't have stacklevel set.
  2. Added new section to contributing.rst advising to set stacklevel when using warnings.warn

Note:
I liked@ImportanceOfBeingErnest 's suggestion of advising to set stacklevel in the documentation. I didn't find a good place for it, so I created a new section in contributing.rst. Please let me know if there's a better place or if it's too long.

PR Checklist

  • Has Pytest style unit tests
  • Code isFlake 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

@jklymak
Copy link
Member

Wow, looks great! You are going to have to rebase__init__.py, but I hope that is straight forward.

However, is there no way for us to automate this? Does it have to be set manually for every warnings call? I admit that a quick google search didn't turn up anything hopeful, but thought I'd ask...

@jklymak
Copy link
Member

We also don't allow lines >79 characters, so you'll have to sort out all the overspilling lines (see the flake8 errors in travis-ci/py3.6 build)

@hershenhershenforce-pushed theadd-stacklevel-to-warnings-fixes-issue-10643 branch from217e695 to3c71722CompareSeptember 3, 2018 02:58
@anntzer
Copy link
Contributor

In general, this is an improvement. But an even better improvement would be to just use _warn_external everywhere -- see#11298 (and adapt the (nice) explanation for it). (See for example (not in this PR) backend_pdf's writeInfoDict which currently warns with stacklevel=2 on invalid keywords, but that'll point to some other internal method of backend_pdf which only makes things more (not less) confusing for the end user.)

However, it would be even betternot to apply either stacklevel=2, or _warn_external, indiscriminately. For example, the change in backend_bases.py in this PR is in key_press_handler, which is invoked asynchronously by the GUI event loop (well, I don't know if there's a good value for stacklevel in that case, so perhaps we can just live with it...).

@hershen
Copy link
ContributorAuthor

Oh, that's a nice idea in _warn_external.

Sorry, I didn't follow your key_press_handler example. Why would _warn_external not work well in that case?

And a git question - is there a way to continue working on this branch without polluting the history (for example changing warnings.warn(___, stacklevel=2) to _warn_external)? Or is it better to just create a new branch from master?

@anntzer
Copy link
Contributor

Perhaps key_press_handler is not the best example but I remember looking into doing a global replace and thinking that some of the warn calls would become more confusing if using _warn_external. I don't have a case right now, someone just needs to do a careful review of the changes.
re: git: you can create a throwaway branch here if you don't want to lose your work, then you can git reset --hard HEAD~ this first branch and rework from there.

@hershen
Copy link
ContributorAuthor

Ok, thanks.

I'm away from a computer until the middle of next week. When I return, I can do a global replace, as I don't know the code well enough to identify when _warn_external isn't appropriate. A more knowledgeable reviewer can then hopefully identify the completed cases. Will that be helpful, or should I pick a different issue to work on?

Thanks for the git tip. I'll play around with it.

@anntzer
Copy link
Contributor

Sounds good.

@@ -874,7 +874,7 @@ def json_dump(data, filename):
try:
json.dump(data, fh, cls=JSONEncoder, indent=2)
except OSError as e:
warnings.warn('Could not save font_manager cache {}'.format(e))
warnings.warn('Could not save font_manager cache {}'.format(e), stacklevel=2)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

For example, I don't think that this warning would get clearer if using _warn_external (or even stacklevel=2).

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

OK, I see what you mean.

Is it safe to assume that this warning will be "triggered" when importing pyplot? If so, then does it make sense to print the user line of code that imports pyplot i.e.import matplotlib.pyplot as plt?

I tried to manipulate _warn_external to do this without success. If this solution is acceptable, any ideas how to achieve that?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Is it safe to assume that this warning will be "triggered" when importing pyplot?

Yes

If so, then does it make sense to print the user line of code that imports pyplot i.e. import matplotlib.pyplot as plt?

I wouldn't overthink it (there isn't anything really smart to do in this case IMO) and would just trigger a warning at this line; or perhaps is actually makes sense to use logging.warning instead of warnings.warn here in fact, now that I think of it...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

After further thought, I convinced myself that that should exactly be the criterion forwarnings vslogging: by showing the line of offending code, does that point the user to something they should modify?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Sounds good, thanks.

@timhoffm
Copy link
Member

@hershen still interested to work on this?

@hershen
Copy link
ContributorAuthor

I am. Sorry it got set aside for so long. I'll try to finish it this weekend.

@timhoffm
Copy link
Member

No hurry. Just wanted to make sure this is not orphaned.

@hershenhershenforce-pushed theadd-stacklevel-to-warnings-fixes-issue-10643 branch 2 times, most recently fromaa8420c tob00921bCompareOctober 16, 2018 21:37
@hershen
Copy link
ContributorAuthor

I (finally) switched thewarnings.warn to eitherlogging.warning orcbook._warn_external. I followed@anntzer's advice and tried to choosecbook._warn_external when I thought the reason for the warning is the user's code or if the warning will help the user find the instance in the code where the warning occurred andlogging.warning when the user can't fix his code. Please have a look if the choice of function makes sense. Please pay particular attention to the following places where I felt even less sure which function to choose:

  • lib/matplotlib/artist.py (lines 404, 855)
  • lib/matplotlib/backend_manager.py (263)
  • lib/matplotlib/font_manager.py (1230, 1239)
  • lib/matplotlib/lines.py (475)
  • lib/matplotlib/mathtext.py (all)
  • lib/matplotlib/textpath.py (321, 370)
  • lib/matplotlib/tight_layout.py (230)
  • lib/matplotlib/axes/_base.py (3912)
  • lib/matplotlib/backends/backend_pgf.py (402)
  • lib/matplotlib/backends/backend_webagg_core.py (243)
  • lib/matplotlib/backends/qt_editor/formlayout.py (97, 268)
  • lib/matplotlib/style/core.py (193)
  • lib/mplt_toolkits/mplot3d/axes3d.py (1081)

@@ -221,7 +221,7 @@ def do_constrained_layout(fig, renderer, h_pad, w_pad,
# so this does the same w/o zeroing layout.
ax._set_position(newpos, which='original')
else:
warnings.warn('constrained_layout not applied. At least '
cbook._warn_ext('constrained_layout not applied. At least '
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

typo

hershen reacted with thumbs up emoji
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Good catch, thanks!

@@ -850,7 +852,7 @@ def set_rasterized(self, rasterized):
rasterized : bool or None
"""
if rasterized and not hasattr(self.draw, "_supports_rasterization"):
warnings.warn("Rasterization of '%s' will be ignored" % self)
logging.warning("Rasterization of '%s' will be ignored" % self)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

looks like cbook._warn_external

@@ -241,8 +240,8 @@ def handle_event(self, event):
return handler(event)

def handle_unknown_event(self, event):
warnings.warn('Unhandled message type {0}. {1}'.format(
event['type'], event), stacklevel=2)
cbook._warn_external('Unhandled message type {0}. {1}'.format(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I think this should use logging (it's basically an event handler and thus likely to be called asynchronously anyways).

@@ -1573,10 +1572,10 @@ def save_figure(self, *args):
if ext in ('svg', 'pdf', 'ps', 'eps', 'png') and format != ext:
# looks like they forgot to set the image type drop
# down, going with the extension.
warnings.warn(
cbook._warn_external(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

logging
(this is most likely called throgh gui interaction)

@@ -1837,10 +1836,10 @@ def trigger(self, *args):
if ext in ('svg', 'pdf', 'ps', 'eps', 'png') and format != ext:
# looks like they forgot to set the image type drop
# down, going with the extension.
warnings.warn(
cbook._warn_external(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

same as above

@@ -2396,7 +2395,7 @@ def _get_uniform_gridstate(ticks):
try:
ax.set_yscale('log')
except ValueError as exc:
warnings.warn(str(exc))
cbook._warn_external(str(exc))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

logging (most likely called through gui interaction)

@@ -2409,7 +2408,7 @@ def _get_uniform_gridstate(ticks):
try:
ax.set_xscale('log')
except ValueError as exc:
warnings.warn(str(exc))
cbook._warn_external(str(exc))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

same as above

@@ -472,7 +472,7 @@ def contains(self, mouseevent):

# Convert pick radius from points to pixels
if self.figure is None:
warnings.warn('no figure set when check if mouse is on line')
logging.warning('no figure set when check if mouse is on line')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I think warn_external here (can be callback or direct call).

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Isn't this gui interaction?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I was thinking that one can also call contains() directly, but actually that's almost certainly much rarer, so logging is fine.

@@ -1595,7 +1590,7 @@ def _set_glue(self, x, sign, totals, error_type):
self.glue_ratio = 0.
if o == 0:
if len(self.children):
warnings.warn(
cbook._warn_external(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

also logging? a bit borderline but consistent with the rest of the mathtext module

@@ -244,7 +244,7 @@ def _set_logger_verbose_level(level_str='silent', file_str='sys.stdout'):
fileo = open(file_str, 'w')
# if this fails, we will just write to stdout
except IOError:
warnings.warn('could not open log file "{0}"'
logging.warning('could not open log file "{0}"'
Copy link
Contributor

@anntzeranntzerOct 17, 2018
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

throughout the PR:

  • You should use the module-level logger_log = logging.getLogger(__name__) then_log.warning(...).
  • Alignment of subsequent lines are a bit messed up sometimes.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

  • Ah, right. I even read that I should do that, but for some reason it didn't register.
  • Thanks for pointing that out. I wasn't really paying attention to that.

@anntzer
Copy link
Contributor

Thanks for the thorough changes! Left some comments.

@hershenhershenforce-pushed theadd-stacklevel-to-warnings-fixes-issue-10643 branch from416fed2 to1bece33CompareOctober 19, 2018 05:11

##############################################################################
# FONTS


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

no empty line here?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I added it because I gotE302 expected 2 blank lines, found 1 from flake8 when it wasn't there.
Is there a better solution?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Putting the blank linebefore the ##### seems more logical? Should hopefully also placate the style checker.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

You're right. That fixed it.

matplotlib.cbook._warn_external(
'The left and right margins cannot be made large enough to '
'accommodate all axes decorations. ')
matplotlib.cbook._warn_external('The left and right margins cannot '
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

just dofrom matplotlib import cbook at the top?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Fixed, thanks.

Copy link
Contributor

@anntzeranntzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Only minor formatting points left.

@hershenhershenforce-pushed theadd-stacklevel-to-warnings-fixes-issue-10643 branch from6e355a7 tobd01a00CompareOctober 19, 2018 17:11
@hershen
Copy link
ContributorAuthor

Squashed.

Copy link
Member

@QuLogicQuLogic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

A few typos; I mostly assume@anntzer has looked over the other bits.

`warnings.warn`) is that `cbook._warn_external` should be used for things the
user must change to stop the warning (typically in the source), whereas
`logging.warning` can be more persistent. Moreover, note that
`cbook._warn_extrenal` will by default only emit a given warning *once* for
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Typo: extrenal

layouting or rendering) should only log at this level.
By default, `warnings.warn` displays the line of code that has the `warn` call.
This usually isn't more informative than the warning message itself. Therefore,
Matplotlib uses `cbook._warn_external` which uses `warnings.warn`, but it goes
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Remove 'it'

up the stack and displays the first line of code outside of Matplotlib.
For example, for the module::

#in my_matplotlib_module.py
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Space after#

running the script::

from matplotlib import my_matplotlib_module
my_matplotlib_module.set_range(0,0) #set range
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Space after, and#; two spaces before#.

UserWarning: Attempting to set identical bottom==top
warnings.warn('Attempting to set identical bottom==top')

Modifiying the module to use `cbook._warn_extermal`::
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Typo: Modifiying; extermal.

@@ -2,7 +2,7 @@
A module providing some utility functions regarding bezier path manipulation.
"""

importwarnings
importmatplotlib.cbook as cbook
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Move down to below numpy (can also add a blank line after numpy)

@@ -20,7 +20,7 @@
'''

import logging
importwarnings
importmatplotlib.cbook as cbook
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Move down to matplotlib section below.

@@ -29,6 +28,9 @@
from matplotlib import cbook, rcParams, backend_tools

import wx
import logging
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Move up to stdlib section of imports.

'range. It may be necessary to add an '
'interval value to the '
'AutoDateLocator\'s intervald '
'dictionary. Defaulting to {'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Funny place to break; better to keep{0} together.

warnings.warn(
"Casting input data from '{0}' to 'float64'"
"for imshow".format(A.dtype))
cbook._warn_external("Casting input data from '{"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Same here; keep{0} together.

@hershen
Copy link
ContributorAuthor

Thanks for the thorough review@QuLogic. I addressed all your comments (and fixed a few other places where I had the same issues).

I'll squash again when you're happy.

@hershen
Copy link
ContributorAuthor

Sorry, but what did I do to make the travis/no language test angry?

@QuLogic
Copy link
Member

Seems to be a bug in Homebrew's NumPy package. Feel free to squash, but it probably won't fix it.

@hershenhershenforce-pushed theadd-stacklevel-to-warnings-fixes-issue-10643 branch 2 times, most recently from6cf17f3 to9ecdec3CompareOctober 22, 2018 04:18
@hershen
Copy link
ContributorAuthor

OK. Squashed.

The travis issues here seem to be common to all the commits in PRs in the last ~15 hours, so I assume it's not something I'm did wrong.

@hershenhershenforce-pushed theadd-stacklevel-to-warnings-fixes-issue-10643 branch from9ecdec3 to226f1d4CompareOctober 27, 2018 21:22
@hershen
Copy link
ContributorAuthor

Rebased.

Copy link
Member

@timhoffmtimhoffm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thanks for working through all the warnings.

warnings.warn("streamed pgf-code does not support raster "
"graphics, consider using the pgf-to-pdf option",
UserWarning, stacklevel=2)
_log.warning("streamed pgf-code does not support raster "
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Isn't this of the category "things the that the user must change to stop the warning" and thus should be_warn_external?

anntzer reacted with thumbs up emoji
@@ -241,8 +242,8 @@ def handle_event(self, event):
return handler(event)

def handle_unknown_event(self, event):
warnings.warn('Unhandled message type {0}. {1}'.format(
event['type'], event), stacklevel=2)
_log.warning('Unhandled message type {0}. {1}'.format(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

also_warn_external?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This was changed to_log.warning following@anntzer's suggestion.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

In practice this will almost always get called asynchronously by the webserver event handler so "external" will point to the call to mainloop(), which is not really helpful.

@@ -1573,10 +1575,10 @@ def save_figure(self, *args):
if ext in ('svg', 'pdf', 'ps', 'eps', 'png') and format != ext:
# looks like they forgot to set the image type drop
# down, going with the extension.
warnings.warn(
_log.warning(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

improper use ->_warn_external?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This was changed to_log.warning following@anntzer's suggestion.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

In practice this will almost always get called through a wx GUI event handler so "external" will point to the call to mainloop(), which is not really helpful.

@@ -1837,10 +1839,10 @@ def trigger(self, *args):
if ext in ('svg', 'pdf', 'ps', 'eps', 'png') and format != ext:
# looks like they forgot to set the image type drop
# down, going with the extension.
warnings.warn(
_log.warning(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

improper use ->_warn_external?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This was changed to_log.warning following@anntzer's suggestion.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

In practice this will almost always get called through a wx GUI event handler so "external" will point to the call to mainloop(), which is not really helpful.

@@ -93,7 +94,7 @@ def to_qcolor(color):
try:
rgba = mcolors.to_rgba(color)
except ValueError:
warnings.warn('Ignoring invalid color %r' % color, stacklevel=2)
_log.warning('Ignoring invalid color %r' % color)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

improper value passed ->_warn_external?

anntzer reacted with thumbs up emoji
warnings.warn('Matplotlib is currently using %s, which is a '
'non-GUI backend, so cannot show the figure.'
% get_backend())
and warn):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Why the additional spaces?PEP-8 example suggests:

if (this_is_one_thing        and that_is_another_thing):    do_something()

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Good catch!

"Using bbox_to_anchor=(0,0,1,1) now.")
cbook._warn_external("Using the axes or figure transform "
"requires a bounding box in the respective "
"coordinates. Using bbox_to_anchor=(0,0,1,"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I wouldn't break the parenthesis for better readability in the code. Would break befrore "Using" here even though the line will get quite short.

anntzer reacted with thumbs up emoji
@@ -1074,7 +1080,7 @@ def mouse_init(self, rotate_btn=1, zoom_btn=3):
c3 = canv.mpl_connect('button_release_event', self._button_release)
self._cids = [c1, c2, c3]
else:
warnings.warn(
_log.warning(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Is this not also a case the user should do something about (and thus_warn_external).

anntzer reacted with thumbs up emoji
@@ -765,7 +767,7 @@ def include_dirs_hook():
ext.include_dirs.append(numpy.get_include())
if not has_include_file(
ext.include_dirs, os.path.join("numpy", "arrayobject.h")):
warnings.warn(
_log.warning(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

User action required ->_warn_extenal.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This doesn't live in the matplotlib package so "external" will point to this very file; showing the source won't help.

@hershen
Copy link
ContributorAuthor

Thanks@timhoffm for the review!
Some of your suggestions were what I had originally, but@anntzer suggested I change them.
As I'm not familiar enough with the codebase, I'll wait for you two to agree.

@anntzer
Copy link
Contributor

Agreed with@timhoffm on some, left comments on others.

timhoffm reacted with thumbs up emoji

…_external.2) Updated contributions guidelines to use cbook._warn_external.
@hershenhershenforce-pushed theadd-stacklevel-to-warnings-fixes-issue-10643 branch from226f1d4 to67e57b2CompareOctober 29, 2018 18:29
@hershen
Copy link
ContributorAuthor

Added@timhoffm's suggestions.

@timhoffmtimhoffm added this to thev3.1 milestoneOct 29, 2018
@jklymak
Copy link
Member

jklymak commentedOct 29, 2018
edited
Loading

@anntzer, can you merge if your review still holds? !!

@timhoffmtimhoffm merged commitad779b4 intomatplotlib:masterOct 29, 2018
@hershenhershen deleted the add-stacklevel-to-warnings-fixes-issue-10643 branchOctober 29, 2018 21:50
@kbrose
Copy link
Contributor

Can the title of this PR be updated to reflect its contents? I had a hard time finding it because its title ("Added stacklevel=2 to all warnings.warn calls (issue 10643)") leaves out the important part of changing every warning.warn call.

@timhoffmtimhoffm changed the titleAdded stacklevel=2 to all warnings.warn calls (issue 10643)Change most warnings.warn to -Nov 15, 2018
@timhoffmtimhoffm changed the titleChange most warnings.warn to -Change most warnings.warn to cook._warn_external or logging.warningNov 15, 2018
@hershenhershen changed the titleChange most warnings.warn to cook._warn_external or logging.warningReplace warnings.warn with cbook._warn_external or logging.warningNov 15, 2018
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@QuLogicQuLogicQuLogic left review comments

@anntzeranntzeranntzer approved these changes

@timhoffmtimhoffmtimhoffm approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
v3.1.0
Development

Successfully merging this pull request may close these issues.

6 participants
@hershen@jklymak@anntzer@timhoffm@QuLogic@kbrose

[8]ページ先頭

©2009-2025 Movatter.jp