ufunc 'over' not supported for the input types in 7_Networks.ipynb
See original GitHub issueWith current master and xarray 0.11.3 or 0.13 and pandas 0.25.1, the http://datashader.org/user_guide/7_Networks.html#Graphs-with-categories section of the user guide is failing with the error:
TypeError: ufunc 'over' not supported for the input types, and the inputs could not
be safely coerced to any supported types according to the casting rule ''safe''
Presumably that code used to work, since the page looks fine on the website. Python’s complaining about overlaying the node and edge plots in this case, even though overlaying those same types of plots in other cells above and below works fine using the same code. Plus if I hack graphplot to overlay just the nodes on themselves or just the edges on themselves, the overlay works, suggesting that the edges and nodes in this case are individually fine but end up as incompatible types of object that can’t be overlaid with over. Yet the two plots appear to have the same type (<class ‘datashader.transfer_functions.Image’>) and dtype (uint32).
I’ll try to see when this problem started, but it has the same behavior on xarray 0.11.3 and 0.13, so if it’s due to a change in xarray it would presumably be from an older version.
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (7 by maintainers)
Top GitHub Comments
This change (from list to
OrderedDict
) was to separately control the ordering of the coordinates and dimensions to match what we (@philippjfr and I) thought was a better convention (dimensions orderedy
thex
, coordinates orderedx
theny
). I think what’s missing is that this logic wasn’t added to the categorical branch of theshade
function. I’ll take a closer look.It doesn’t appear to be an issue with an external library changing, but with the Datashader code itself. The notebook and the reproducer work fine with the last release (Datashader 0.7.0, revision 1b9f3009), and as recently as commit ff89603f on August 23. The first commit where the reproducer breaks is e42694bf, which corresponds to merging pull request #779. #779 does include changes to the construction of categorical xarray objects, and specifically appears to change from having coordinates as lists:
to coordinates as ordered dictionaries, which presumably provides names to the coordinates:
Maybe xarray is balking at merging the categorical and non categorical Image objects because of some declared difference in the names of the coordinates, even though the coordinates themselves are the same? @jonmmease , can you explain what this change was for, or if you can think of something else that changed in this PR that could be causing this problem?