Skip to content

dsshow crashing with AttributeError after numpy update #1209

Closed

Description

ALL software version info

ds.__version__
'0.14.4'

np.__version__
'1.24.3'

Description of expected behavior and the observed behavior

import datashader as ds
from datashader.mpl_ext import dsshow
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd

x = np.arange(10)
y = x + 1.0
df = pd.DataFrame({"time": x, "data": y})
fig, ax = plt.subplots()
ax.plot(x, y)
dsshow(df, ds.Point("time", "data"))

In datashader\core.py, function bypixel throws an error with the np.warnings command:


  File "test_broken.py", line 14, in <module>
    dsshow(df, ds.Point("time", "data"))

  File "C:\Users\%username%\Documents\venvs\everything310\lib\site-packages\datashader\mpl_ext.py", line 716, in dsshow
    artist = ScalarDSArtist(

  File "C:\Users\%username%\Documents\venvs\everything310\lib\site-packages\datashader\mpl_ext.py", line 386, in __init__
    binned = self.aggregate(self.axes.get_xlim(), self.axes.get_ylim())

  File "C:\Users\%username%\Documents\venvs\everything310\lib\site-packages\datashader\mpl_ext.py", line 238, in aggregate
    binned = bypixel(self.df, canvas, self.glyph, self.aggregator)

  File "C:\Users\%username%\Documents\venvs\everything310\lib\site-packages\datashader\core.py", line 1258, in bypixel
    with np.warnings.catch_warnings():

  File "C:\Users\%username%\Documents\venvs\everything310\lib\site-packages\numpy\__init__.py", line 320, in __getattr__
    raise AttributeError("module {!r} has no attribute "

AttributeError: module 'numpy' has no attribute 'warnings'

Seems to be fine in older versions of numpy. I'm not sure if this is now expected behavior that needs to be adapted or if it's an upstream bug in numpy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions