climate-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jo...@apache.org
Subject svn commit: r1521542 - /incubator/climate/trunk/ocw/metrics.py
Date Tue, 10 Sep 2013 16:33:31 GMT
Author: joyce
Date: Tue Sep 10 16:33:30 2013
New Revision: 1521542

URL: http://svn.apache.org/r1521542
Log:
CLIMATE-290 - Update TemporalStdDev to use UnaryMetric

Modified:
    incubator/climate/trunk/ocw/metrics.py

Modified: incubator/climate/trunk/ocw/metrics.py
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/ocw/metrics.py?rev=1521542&r1=1521541&r2=1521542&view=diff
==============================================================================
--- incubator/climate/trunk/ocw/metrics.py (original)
+++ incubator/climate/trunk/ocw/metrics.py Tue Sep 10 16:33:30 2013
@@ -77,27 +77,20 @@ class Bias(BinaryMetric):
         return ref_dataset.values - target_dataset.values
 
 
-class TemporalStdDev(Metric):
+class TemporalStdDev(UnaryMetric):
     '''Calculate the standard deviation over the time.'''
 
-    def __init__(self):
-        '''Default constructor.
-
-        .. note::
-           Overrides Metric.__init__()
-        '''
-        self.is_unary = True
-
-    def run(self, datasets):
+    def run(self, target_dataset):
         '''Calculate the temporal std. dev. for a datasets.
 
         .. note::
-           Overrides Metric.run()
+           Overrides UnaryMetric.run()
+
+        :param target_dataset: The target_dataset on which to calculate the 
+            temporal standard deviation.
+        :type target_dataset: Dataset
 
-        :param datasets: The datasets on which to calculate the temporal
-                std. dev. in datasets[0].
-        :type datasets: Tuple
-        :returns: An array containing the temporal std. dev.
+        :returns: The temporal standard deviation of the target dataset
         :rtype: Numpy Array
         '''
         return datasets[0].values.std(axi=0, ddof=1)



Mime
View raw message