Skip to content

[BUG] Segmentation fault when working on a transposed numpy array with first dimension 1. #393

Open
@RubendeBruin

Description

@RubendeBruin

Issue raised as follow-up to: pydata/xarray#6002

Reproduce

import numpy as np
import bottleneck as bn

n_time = 1
spec_data = np.random.random(size=(n_time,192,121))

bn.nanmax(spec_data.transpose(0, 2, 1))


 ---> Segmentation fault

numpy.transpose returns a view, so I guess that's what causes bottleneck to segfault? Not sure, though, especially since changing the order does not trigger the segfault: spec_data.transpose(1, 0, 2)... maybe bottleneck doesn't like views with a first dimension of size 1?

Expected behaviour
Should not crash

Environment
Confirmed Windows & Linux , P37 and P39.

confirmed with:
bottleneck: 1.3.2
numpy: 1.21.4

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions