-
Notifications
You must be signed in to change notification settings - Fork 99
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
AbstractPlotRenderers return different array shapes when passing a single point to map_screen #550
Comments
I'm guessing you meant "this issue can be closed". Can you do the audit @aaronayres35 ? |
So I've gone through the code base and I think it looks like we've got everything. The only thing that stood out was the @rahulporuri what do you think? |
Nice catch. I'll try to look into the history of why that method was added - but it looks like we can close this issue and open another one regarding deprecating and potentially removing that method. |
so it looks like the |
Base2DPlot
andBaseXYPlot
both implement theAbstractPlotRenderer
interface, in particular themap_screen
method.When a single
(x, y)
point is passed toBase2DPlot.map_screen
, the returned array is of the form[[x, y]]
(nested, shape =(1, 2)
), as set byGridMapper.map_screen
:chaco/chaco/grid_mapper.py
Lines 114 to 123 in 4a66835
When a single
(x, y)
point is passed toBaseXYPlot.map_screen
, the returned array is of the form[x, y]
(flattened, shape =(2,)
):chaco/chaco/base_xy_plot.py
Lines 336 to 353 in 4a66835
This difference forces objects that interact with
AbstractPlotRenderer
s to make an assumption about the behavior of themap_screen
method. For example, theDataLabelTool
assumes themap_screen
return shape matches that ofBaseXYPlot
for a single point ((2,)
):chaco/chaco/tools/data_label_tool.py
Lines 53 to 54 in 4a66835
And therefore this tool throws an exception when used with a
Base2DPlot
:even though it would otherwise be compatible.
This issue also looks like it applies to the
map_data
method although I have not tested it.The text was updated successfully, but these errors were encountered: