Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9701a43

Browse files
committed
compare: Use PEP-8 variable names.
1 parent 6edf6bc commit 9701a43

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

lib/matplotlib/testing/compare.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -252,19 +252,19 @@ def crop_to_same(actual_path, actual_image, expected_path, expected_image):
252252
def calculate_rms(expectedImage, actualImage):
253253
# calculate the per-pixel errors, then compute the root mean square error
254254
num_values = np.prod(expectedImage.shape)
255-
absDiffImage = abs(expectedImage - actualImage)
255+
abs_diff_image = abs(expectedImage - actualImage)
256256

257257
# On Numpy 1.6, we can use bincount with minlength, which is much faster than
258258
# using histogram
259259
expected_version = version.LooseVersion("1.6")
260260
found_version = version.LooseVersion(np.__version__)
261261
if found_version >= expected_version:
262-
histogram = np.bincount(absDiffImage.ravel(), minlength=256)
262+
histogram = np.bincount(abs_diff_image.ravel(), minlength=256)
263263
else:
264-
histogram = np.histogram(absDiffImage, bins=np.arange(257))[0]
264+
histogram = np.histogram(abs_diff_image, bins=np.arange(257))[0]
265265

266-
sumOfSquares = np.sum(histogram * np.arange(len(histogram))**2)
267-
rms = np.sqrt(float(sumOfSquares) / num_values)
266+
sum_of_squares = np.sum(histogram * np.arange(len(histogram))**2)
267+
rms = np.sqrt(float(sum_of_squares) / num_values)
268268

269269
return rms
270270

0 commit comments

Comments
 (0)