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

Rebase, BUG: Fixed deepcopy of F-order object arrays. #8125

Merged
merged 2 commits into from
Oct 7, 2016

Conversation

charris
Copy link
Member

@charris charris commented Oct 7, 2016

Rebase of #6456.

Fixes a bug with deepcopy of object arrays in F-order:

In [1]: import numpy as np

In [2]: np.__version__       
Out[2]: '1.11.0.dev0+9cc55dc'

In [3]: a = {'a': 1}

In [4]: b = {'b': 2}

In [5]: np.array([[a, b], [a, b]], order='F')
Out[5]: 
array([[{'a': 1}, {'b': 2}],
       [{'a': 1}, {'b': 2}]], dtype=object)

In [6]: import copy

In [7]: copy.deepcopy(np.array([[a, b], [a, b]], order='F'))
Out[7]: 
array([[{'a': 1}, {'a': 1}],
       [{'b': 2}, {'b': 2}]], dtype=object)

This was discovered as part of a bug found with biggus in SciTools/biggus#157.

@charris charris merged commit b0159a9 into numpy:master Oct 7, 2016
@charris charris deleted the deepcopy_object branch October 7, 2016 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants