8000 Void scalars lose their contiguity when pickled and unpickled · Issue #7140 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content
Void scalars lose their contiguity when pickled and unpickled #7140
Closed
@gmarkall

Description

@gmarkall

Running the following:

import numpy as np
from pickle import loads, dumps

dt = np.dtype([('a', np.int32), ('b', np.float32)])
record = np.zeros(1, dt)[0]
print(record.flags)
print(loads(dumps(record)).flags)

Gives the output:

$ python contigdemo.py 
  C_CONTIGUOUS : True
  F_CONTIGUOUS : True
  OWNDATA : False
  WRITEABLE : True
  ALIGNED : True
  UPDATEIFCOPY : False
  C_CONTIGUOUS : False
  F_CONTIGUOUS : False
  OWNDATA : True
  WRITEABLE : True
  ALIGNED : True
  UPDATEIFCOPY : False

The unpickled record has lost its C- and F-contiguity - I would have expected this to be retained.

Metadata

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

      0