Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/iris/analysis/stats.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (C) British Crown Copyright 2013 - 2015, Met Office
# (C) British Crown Copyright 2013 - 2019, Met Office
#
# This file is part of Iris.
#
Expand Down Expand Up @@ -31,6 +31,8 @@
def _ones_like(cube):
"""
Return a copy of cube with the same mask, but all data values set to 1.

The operation is non-lazy.
Copy link
Member

@lbdreyer lbdreyer Mar 13, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I may be missing some context here as to the purpose of this PR, but this line doesn't seem necessary to add.

I'm assuming your intention is to clarify which functions are lazy for the user. If that is the case, it is surely not necessary to add this to a private function, which won't be included in the documentation?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this note would be useful for the next developer who looks at the code, wanting to make the public function lazy?

"""
ones_cube = cube.copy()
ones_cube.data = np.ones_like(cube.data)
Expand Down Expand Up @@ -85,6 +87,8 @@ def pearsonr(cube_a, cube_b, corr_coords=None, weights=None, mdtol=1.,
Reference:
http://www.statsoft.com/textbook/glosp.html#Pearson%20Correlation

This operation is non-lazy.

"""

# Assign larger cube to cube_1
Expand Down