visgl / deck.gl

WebGL2 powered visualization framework
https://deck.gl
MIT License
12.26k stars 2.08k forks source link

[Feat] [pydeck] Convert numpy arrays to lists during JSON serialization #6850

Open dakoop opened 2 years ago

dakoop commented 2 years ago

Target Use Case

I've passed numpy arrays to pydeck many times, often in the context of a PathLayer, and run into the object has no vars error. After recalling what this means, I go figure out where the issue is and make sure everything ends up as lists. This would shortcut that issue, and help others not get lost trying to decode the error message.

Proposal

Just a couple of lines and a numpy import:

https://github.com/dakoop/deck.gl/commit/f8dd1ef4aaab09bdb9e39b619b42c4210426ae5e

RmStorm commented 1 year ago

I'm running into this issue to. Would be nice if pydeck did it under the hood! The 'object has no vars' error is quite unclear it's taken me a while to figure out what's going on..