You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@climate.apache.org by jo...@apache.org on 2014/11/06 21:51:14 UTC

[5/6] climate git commit: CLIMATE-542: Change from camelcase to snakecase

CLIMATE-542: Change from camelcase to snakecase


Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/8859ab0e
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/8859ab0e
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/8859ab0e

Branch: refs/heads/master
Commit: 8859ab0ebde89851fc498708609695a5e2c76d96
Parents: 7363794
Author: rlaidlaw <rl...@gmail.com>
Authored: Thu Nov 6 12:15:48 2014 -0800
Committer: rlaidlaw <rl...@gmail.com>
Committed: Thu Nov 6 12:15:48 2014 -0800

----------------------------------------------------------------------
 ocw/metrics.py | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/8859ab0e/ocw/metrics.py
----------------------------------------------------------------------
diff --git a/ocw/metrics.py b/ocw/metrics.py
index 1ef5f87..5c99e3e 100644
--- a/ocw/metrics.py
+++ b/ocw/metrics.py
@@ -171,18 +171,18 @@ class TemporalCorrelation(BinaryMetric):
             array of confidence levels associated with the temporal correlation
             coefficients
         '''
-        nTimes, nLats, nLons = reference_dataset.values.shape
-        coefficients = numpy.zeros([nLats, nLons])
-        levels = numpy.zeros([nLats, nLons])
-        for iLats in numpy.arange(nLats):
-            for iLons in numpy.arange(nLons):
-                coefficients[iLats, iLons], levels[iLats, iLons] = (
+        num_times, num_lats, num_lons = reference_dataset.values.shape
+        coefficients = numpy.zeros([num_lats, num_lons])
+        levels = numpy.zeros([num_lats, num_lons])
+        for i in numpy.arange(num_lats):
+            for j in numpy.arange(num_lons):
+                coefficients[i, j], levels[i, j] = (
                     stats.pearsonr(
-                        reference_dataset.values[:, iLats, iLons],
-                        target_dataset.values[:, iLats, iLons]
+                        reference_dataset.values[:, i, j],
+                        target_dataset.values[:, i, j]
                     )
                 )
-                levels[iLats, iLons] = 1 - levels[iLats, iLons]
+                levels[i, j] = 1 - levels[i, j]
         return coefficients, levels