Closed carstenbauer closed 5 years ago
Linear indexing doesn't seem to be supported in python,
>>> fig, ax = plt.subplots(2,2)
>>> ax
array([[<matplotlib.axes._subplots.AxesSubplot object at 0x000002B5540D3208>,
<matplotlib.axes._subplots.AxesSubplot object at 0x000002B5540FA780>],
[<matplotlib.axes._subplots.AxesSubplot object at 0x000002B554121CF8>,
<matplotlib.axes._subplots.AxesSubplot object at 0x000002B5541532B0>]],
dtype=object)
>>> ax[3]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
IndexError: index 3 is out of bounds for axis 0 with size 2
so this really was an artefact of the conversion to a julia array (although a nice one). So I guess we don't want the old behavior back, because we want to mimic python as best as possible?
NumPy arrays of PyObject
values seems to have been broken at some point? (Or Matplotlib switched its output type to a numpy array of dtype=object
for this?) I have a PR in PyCall that fixes this and goes back to returning Array{PyObject}
.
Don't know whether this belongs here or in PyCall.jl.
Before the big transition in PyCall, that is
we had
The axes object is a julia array of
PyObject
s, which, among other things, allowed one to access axes by linear indexing:After the transition, that is
we have
To me this seems like a breaking change that isn't indicated anywhere.
Can/Should we get back the old behavior?