-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Bug in AxesStack.add #7194
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Also: you'll want to change the warnings.warn line to use str(key). Otherwise once you fix the line in question, you get an exception
TypeError: not all arguments converted during string formatting |
I am having a hard time understanding what is going on here (and which parts of the above are existing code, which parts are output, and which parts are your markup on either of the above). |
Sorry, I'll try to be a bit clearer: The bug is here: The issue is that a_existing is an Axes object, whereas the items in self._elements are tuples of (key, (index, Axes)) (see the Stack.push call on L138). So when you try to remove a tuple of (key, Axes), Stack fails with the cryptic exception "Unknown element o". If you muck with the code in Stack.remove to throw ValueError("Unknown element o: %s vs %s" % (o, self._elements)), you get what I pasted in there. That's the indication that the (index,Axes) tuple has been swapped for Axes. |
|
My local patch is as follows:
|
Did you define plt somewhere else? I got this error when I the above code. >>> from matplotlib import figure
>>> a=figure.AxesStack()
>>> a.add('123',plt.figure().add_subplot(111))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'plt' is not defined |
Yes somewhere I probably import matplotlib.pyplot as plt On Oct 18, 2016 6:07 PM, "JunTan" notifications@github.com wrote:
|
Closing as we're just going (in the long run) to deprecate AxesStack (or rather, make it private). See #9037 and linked issues. |
I think I've found a bug where the format of data actually stored in Stack is different from that expected in Stack.remove. It seems that the line below needs to be:
Stack.remove(self, self._entry_from_axes(a_existing))
I don't have a minimal repro case (probably something to do with multi-threading in a tensorflow py_func), but I've been seeing exceptions in the .remove method. Adding some more useful exception messaging shows me a missing self._ind 0th tuple element.
To help us understand and resolve your issue please check that you have provided
the information below.
that demonstrates the issue i.e a small piece of code which reproduces the issue
and can be run with out any other (or as few as possible) external dependencies.
note where it used to work.
The text was updated successfully, but these errors were encountered: