climate-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jo...@apache.org
Subject [1/2] git commit: CLIMATE-475 - Fix metric imports in ocw.tests.test_metrics
Date Sun, 22 Jun 2014 02:24:23 GMT
Repository: climate
Updated Branches:
  refs/heads/master 6c4763b41 -> 4796c01d3


CLIMATE-475 - Fix metric imports in ocw.tests.test_metrics

- Remove explicit metric class imports from ocw.metrics so the import
  list doesn't become insanely long and unwieldy. Metrics now need to
  reference 'metrics' when they're called throughout the tests.


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

Branch: refs/heads/master
Commit: ae8584c295e7cf90b74a6a84c5afa082b8d6fa93
Parents: ab179cb
Author: Michael Joyce <joyce@apache.org>
Authored: Thu Jun 19 08:44:17 2014 -0700
Committer: Michael Joyce <joyce@apache.org>
Committed: Thu Jun 19 08:44:17 2014 -0700

----------------------------------------------------------------------
 ocw/tests/test_metrics.py | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/ae8584c2/ocw/tests/test_metrics.py
----------------------------------------------------------------------
diff --git a/ocw/tests/test_metrics.py b/ocw/tests/test_metrics.py
index c819f21..2502070 100644
--- a/ocw/tests/test_metrics.py
+++ b/ocw/tests/test_metrics.py
@@ -20,8 +20,8 @@
 import unittest
 import datetime as dt
 
-from ocw.metrics import Bias, TemporalStdDev, SpatialStdDevRatio, PatternCorrelation, MeanBias
 from ocw.dataset import Dataset
+import ocw.metrics as metrics
 
 import numpy as np
 import numpy.testing as npt
@@ -29,7 +29,7 @@ import numpy.testing as npt
 class TestBias(unittest.TestCase):
     '''Test the metrics.Bias metric.'''
     def setUp(self):
-        self.bias = Bias()
+        self.bias = metrics.Bias()
         # Initialize reference dataset
         self.reference_lat = np.array([10, 12, 14, 16, 18])
         self.reference_lon = np.array([100, 102, 104, 106, 108])
@@ -60,7 +60,7 @@ class TestBias(unittest.TestCase):
 class TestTemporalStdDev(unittest.TestCase):
     '''Test the metrics.TemporalStdDev metric.'''
     def setUp(self):
-        self.temporal_std_dev = TemporalStdDev()
+        self.temporal_std_dev = metrics.TemporalStdDev()
         # Initialize target dataset
         self.target_lat = np.array([10, 12, 14, 16, 18])
         self.target_lon = np.array([100, 102, 104, 106, 108])
@@ -82,7 +82,7 @@ class TestTemporalStdDev(unittest.TestCase):
 class TestSpatialStdDevRatio(unittest.TestCase):
     '''Test the metrics.SpatialStdDevRatio metric'''
     def setUp(self):
-        self.spatial_std_dev_ratio = SpatialStdDevRatio()
+        self.spatial_std_dev_ratio = metrics.SpatialStdDevRatio()
         self.ref_dataset = Dataset(
             np.array([1., 1., 1., 1., 1.]),
             np.array([1., 1., 1., 1., 1.]),
@@ -108,7 +108,7 @@ class TestSpatialStdDevRatio(unittest.TestCase):
 class TestPatternCorrelation(unittest.TestCase):
     '''Test the metrics.PatternCorrelation metric'''
     def setUp(self):
-        self.pattern_correlation = PatternCorrelation()
+        self.pattern_correlation = metrics.PatternCorrelation()
         self.ref_dataset = Dataset(
             np.array([1., 1., 1., 1., 1.]),
             np.array([1., 1., 1., 1., 1.]),
@@ -136,7 +136,7 @@ class TestPatternCorrelation(unittest.TestCase):
 class TestMeanBias(unittest.TestCase):
     '''Test the metrics.MeanBias metric.'''
     def setUp(self):
-        self.mean_bias = MeanBias()
+        self.mean_bias = metrics.MeanBias()
         # Initialize reference dataset
         self.reference_lat = np.array([10, 12, 14, 16, 18])
         self.reference_lon = np.array([100, 102, 104, 106, 108])


Mime
View raw message