Skip to content
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

Docs page not working #1117

Closed
kthyng opened this issue Sep 7, 2022 · 2 comments
Closed

Docs page not working #1117

kthyng opened this issue Sep 7, 2022 · 2 comments

Comments

@kthyng
Copy link

kthyng commented Sep 7, 2022

I tried to run the Polygons docs page with binder and it doesn't run through: https://datashader.org/user_guide/Polygons.html

It worked if I installed spatialpandas at version 0.4.2 and additionally installed holoviews and geopandas.

As an aside, I was running this because I have not been able to get my own code running using the example code I've found, but seems easier to use this as the bug report. My bug in other code is the same as in this notebook with the newest version of spatialpandas at this cell:
image

--------------------------------------------------------------------------- TypeError Traceback (most recent call last) in

/srv/conda/envs/notebook/lib/python3.7/site-packages/datashader/core.py in polygons(self, source, geometry, agg)
750 agg = any_rdn()
751 glyph = PolygonGeom(geometry)
--> 752 return bypixel(source, self, glyph, agg)
753
754 def quadmesh(self, source, x=None, y=None, agg=None):

/srv/conda/envs/notebook/lib/python3.7/site-packages/datashader/core.py in bypixel(source, canvas, glyph, agg)
1263 if len(cols_to_keep) < len(source.columns):
1264 source = source[cols_to_keep]
-> 1265 dshape = dshape_from_pandas(source)
1266 elif isinstance(source, dd.DataFrame):
1267 dshape = dshape_from_dask(source)

/srv/conda/envs/notebook/lib/python3.7/site-packages/datashader/utils.py in dshape_from_pandas(df)
441 """Return a datashape.DataShape object given a pandas dataframe."""
442 return len(df) * datashape.Record([(k, dshape_from_pandas_helper(df[k]))
--> 443 for k in df.columns])
444
445

/srv/conda/envs/notebook/lib/python3.7/site-packages/datashader/utils.py in (.0)
441 """Return a datashape.DataShape object given a pandas dataframe."""
442 return len(df) * datashape.Record([(k, dshape_from_pandas_helper(df[k]))
--> 443 for k in df.columns])
444
445

/srv/conda/envs/notebook/lib/python3.7/site-packages/datashader/utils.py in dshape_from_pandas_helper(col)
431 elif isinstance(col.dtype, (RaggedDtype, GeometryDtype)):
432 return col.dtype
--> 433 dshape = datashape.CType.from_numpy_dtype(col.dtype)
434 dshape = datashape.string if dshape == datashape.object_ else dshape
435 if dshape in (datashape.string, datashape.datetime_):

/srv/conda/envs/notebook/lib/python3.7/site-packages/datashape/coretypes.py in from_numpy_dtype(self, dt)
777 except KeyError:
778 pass
--> 779 if np.issubdtype(dt, np.datetime64):
780 unit, _ = np.datetime_data(dt)
781 defaults = {'D': date_, 'Y': date_, 'M': date_, 'W': date_}

/srv/conda/envs/notebook/lib/python3.7/site-packages/numpy/core/numerictypes.py in issubdtype(arg1, arg2)
416 """
417 if not issubclass_(arg1, generic):
--> 418 arg1 = dtype(arg1).type
419 if not issubclass_(arg2, generic):
420 arg2 = dtype(arg2).type

TypeError: Cannot interpret 'MultiPolygonDtype(float64)' as a data type

@ianthomas23
Copy link
Member

Datashader recently removed spatialpandas as a compulsory dependency, but left places in the code which assumed it was always available. This has been fixed this week (#1116).

If I run the User Guide polygon code using the latest Datashader master branch it runs OK, so it looks like we have fixed this problem. There should be a new 0.14.3 release shortly.

@kthyng
Copy link
Author

kthyng commented Sep 8, 2022

ok thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants