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 2013/09/10 19:07:52 UTC

svn commit: r1521553 - /incubator/climate/trunk/ocw/metrics.py

Author: joyce
Date: Tue Sep 10 17:07:51 2013
New Revision: 1521553

URL: http://svn.apache.org/r1521553
Log:
CLIMATE-284 - Make Unary and Binary Metrics inherit from base Metric class for easy membership testing.

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=1521553&r1=1521552&r2=1521553&view=diff
==============================================================================
--- incubator/climate/trunk/ocw/metrics.py (original)
+++ incubator/climate/trunk/ocw/metrics.py Tue Sep 10 17:07:51 2013
@@ -22,7 +22,12 @@ Classes:
 
 from abc import ABCMeta, abstractmethod
 
-class UnaryMetric():
+class Metric(object):
+    '''Base Metric Class'''
+    __metaclass__ = ABCMeta
+
+
+class UnaryMetric(Metric):
     '''Abstract Base Class from which all unary metrics inherit.'''
     __metaclass__ = ABCMeta
 
@@ -37,7 +42,7 @@ class UnaryMetric():
         '''
 
 
-class BinaryMetric():
+class BinaryMetric(Metric):
     '''Abstract Base Class from which all binary metrics inherit.'''
     __metaclass__ = ABCMeta