question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ufunc 'over' not supported for the input types in 7_Networks.ipynb

See original GitHub issue

With 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:closed
  • Created 4 years ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
jonmmeasecommented, Oct 2, 2019

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 ordered y the x, coordinates ordered x then y). I think what’s missing is that this logic wasn’t added to the categorical branch of the shade function. I’ll take a closer look.

0reactions
jbednarcommented, Sep 30, 2019

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:

class count_cat(Reduction):
        def finalize(bases, **kwargs):
            dims = kwargs['dims'] + [self.column]
            
            coords = kwargs['coords'] + [cats]

            return xr.DataArray(bases[0], dims=dims, coords=coords)

to coordinates as ordered dictionaries, which presumably provides names to the coordinates:

class count_cat(Reduction):
        def finalize(bases, **kwargs):
            dims = kwargs['dims'] + [self.column]

            coords = kwargs['coords']
            coords[self.column] = cats

            return xr.DataArray(bases[0], dims=dims, coords=coords)

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?

Read more comments on GitHub >

github_iconTop Results From Across the Web

numpy TypeError: ufunc 'invert' not supported for the input ...
Your original array is floating point type (the return value of sigmoid() ); setting values in it to 0 and 1 won't change...
Read more >
The HTML5 input types - Learn web development | MDN
That brings us to the end of our tour of the HTML5 form input types. There are a few other control types that...
Read more >
How to deal with TypeError: ufunc 'isnan' not supported for the ...
I have dealt with all the Nan values in the features dataframe, then why I am still getting this error? sns.heatmap(features, annot ...
Read more >
HTML Input Types - W3Schools
The <input type="color"> is used for input fields that should contain a color. Depending on browser support, a color picker can show up...
Read more >
Form Input | Components - BootstrapVue
If the type prop is set to an input type that is not supported (see above), a text input will be rendered and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found