Skip to content

BUG: Identified bug with numpy 1.7 ufunc operators#1077

Closed
cpelley wants to merge 2 commits into
SciTools:masterfrom
cpelley:math_mask_bug_rep
Closed

BUG: Identified bug with numpy 1.7 ufunc operators#1077
cpelley wants to merge 2 commits into
SciTools:masterfrom
cpelley:math_mask_bug_rep

Conversation

@cpelley

@cpelley cpelley commented Mar 26, 2014

Copy link
Copy Markdown

Replaces messy #1052

Carwyn Pelley added 2 commits March 26, 2014 16:17
This effects binary operators (add, subtract, division and multiply)
onlt.
@cpelley

cpelley commented Mar 26, 2014

Copy link
Copy Markdown
Author

Ready for review

@cpelley

cpelley commented Mar 26, 2014

Copy link
Copy Markdown
Author

I cannot point this to 1.6.x as it requires enhancements which are in master (masked array equality)

@esc24

esc24 commented Mar 26, 2014

Copy link
Copy Markdown
Member

Note that this can also be fixed by changing https://github.com/SciTools/iris/blob/master/lib/iris/analysis/maths.py#L537 from

operation_function(new_cube.data, out=new_cube.data)

to

new_cube.data = operation_function(new_cube.data)

It's a little cleaner perhaps. I'm not sure of the performance/memory impact of the two approaches.

@cpelley

cpelley commented Mar 26, 2014

Copy link
Copy Markdown
Author

Note that this can also be fixed by changing...

Thanks for your interest @esc24
The workaround provides the same functionality as that intended (in-place operations).
At a glance, the workaround you provide, though cleaner, is not in-place, so twice as much memory will be utilised until it replaces the original array. This would restrict the use to data which is half the size which it can currently handle.

@cpelley

cpelley commented Mar 26, 2014

Copy link
Copy Markdown
Author

I'm closing in favour of targeting the v1.6.x branch (made possible after #1079)

@cpelley cpelley closed this Mar 26, 2014
@esc24

esc24 commented Mar 26, 2014

Copy link
Copy Markdown
Member

Good point @cpelley.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants