8000 Spurious C contiguity issues on git master · Issue #2956 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content
Spurious C contiguity issues on git master #2956
Closed
@pv

Description

@pv

This Cython code fails on Numpy git master (4600b2f):

import numpy as np
def foo(y):
    cdef double[:,::1] data
    y = y.reshape(y.shape[0], -1).T
    y = np.ascontiguousarray(y, dtype=np.double)
    data = y   # <- raises ValueError: Buffer not C contiguous.

called with

import numpy as np
import asd
asd.foo(np.zeros([90])[:,None])

ascontiguousarray should always return C contiguous arrays with correct flags, but that doesn't seem to be the case currently. Doesn't fail on 1.7.0rc1 and 1.7.x branch.

Observed in Scipy tests with Numpy master:

http://projects.scipy.org/scipy/ticket/1832
http://projects.scipy.org/scipy/ticket/1830

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0