You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to the documentation, the argument of .c2p() may be individual values for x, y (and z), as well as lists, lists of lists and numpy.arrays. However, when using just lists [x,y,z] or 1D np.arrays the returned coordinates are wrong.
ax.c2p(1,2) and ax.c2p(1,2,1) return reasonable values
ax.c2p(np.array([1,2])) appears to be treated as two "points" with x=1 and x=2 respectively, returning [[x1, x2],[y1, y2],[z1, z2]] rather than [[x1 y1 z1],[x2, y2, z2]], similar for all other 1D-lists
ax.c2p([[1,2],[2,3]]) appears to correctly return two points
System specifications
System Details
OS : Windows 10
RAM: enough
Python version (python/py/python3 --version): 3.11.6
The text was updated successfully, but these errors were encountered:
Let me preface this by saying that I'm (personally) not a big fan of this behavior.
However, the reason for this is when passing a list (ax.c2p([1,2])) it's treating it as you passed a list of the structure [x1, x2], [y1, y2], [z1, z2] - see the implementation if you're interested. (edit: oops you already figured this out)
I would like to make this behavior less confusing, so I'm open to ideas!
I would say the expected behavior would be: list of coordinates - in list of coordinates out
But I can also imagine that it is not easy to distinguish the different formats. But I think the following behavior would be more logical axes.c2p(x,y,z) -> np.array([X, Y, Z]) axes.c2p([[x,y,z]]) -> [np.array([X, Y, Z])] axes.c2p([[x1,y1,z1],[x2,y2,z2]]) -> [np.array([X1, Y1, Z1]),np.array([X2, Y2, Z2])]
Personally I cannot see any use case where I would expect to get individual lists of the Xs, Ys and Zs back...
Description of bug / unexpected behavior
According to the documentation, the argument of
.c2p()
may be individual values for x, y (and z), as well as lists, lists of lists andnumpy.array
s. However, when using just lists[x,y,z]
or 1D np.arrays the returned coordinates are wrong.Expected behavior
How to reproduce the issue
Code for reproducing the problem
returns
ax.c2p(1,2)
andax.c2p(1,2,1)
return reasonable valuesax.c2p(np.array([1,2]))
appears to be treated as two "points" withx=1
andx=2
respectively, returning[[x1, x2],[y1, y2],[z1, z2]]
rather than[[x1 y1 z1],[x2, y2, z2]]
, similar for all other 1D-listsax.c2p([[1,2],[2,3]])
appears to correctly return two pointsSystem specifications
System Details
python/py/python3 --version
): 3.11.6The text was updated successfully, but these errors were encountered: