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

BUG: Histogramdd breaks on big arrays in Windows #22561

Merged
merged 6 commits into from Nov 18, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Binary file added am.np.npy
Binary file not shown.
Binary file added am.npz
Binary file not shown.
2 changes: 1 addition & 1 deletion numpy/lib/histograms.py
Expand Up @@ -970,7 +970,7 @@ def histogramdd(sample, bins=10, range=None, density=None, weights=None):
sample = np.atleast_2d(sample).T
N, D = sample.shape

nbin = np.empty(D, int)
nbin = np.empty(D, np.intp)
edges = D*[None]
dedges = D*[None]
if weights is not None:
Expand Down
8 changes: 8 additions & 0 deletions numpy/lib/tests/test_histograms.py
Expand Up @@ -397,6 +397,14 @@ def test_histogram_bin_edges(self):
edges = histogram_bin_edges(arr, bins='auto', range=(0, 1))
assert_array_equal(edges, e)

def test_big_arrays(self):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. We need to mark this for large memory use, have a look for @requires_memory. I suspect it should also be marked with @pytest.mark.slow to skip on most runs.

sample = np.zeros([100000000, 3])
xbins = 400
ybins = 400
zbins = np.arange(16000)
hist = np.histogramdd(sample=sample, bins=(xbins, ybins, zbins))
assert_equal(type(hist),type((1, 2)))


class TestHistogramOptimBinNums:
"""
Expand Down