Return-Path: X-Original-To: apmail-climate-commits-archive@minotaur.apache.org Delivered-To: apmail-climate-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1E12311FAE for ; Sun, 22 Jun 2014 02:24:25 +0000 (UTC) Received: (qmail 27041 invoked by uid 500); 22 Jun 2014 02:24:25 -0000 Delivered-To: apmail-climate-commits-archive@climate.apache.org Received: (qmail 26963 invoked by uid 500); 22 Jun 2014 02:24:24 -0000 Mailing-List: contact commits-help@climate.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@climate.apache.org Delivered-To: mailing list commits@climate.apache.org Received: (qmail 26947 invoked by uid 99); 22 Jun 2014 02:24:24 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 22 Jun 2014 02:24:24 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 1D2AA886270; Sun, 22 Jun 2014 02:24:23 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: joyce@apache.org To: commits@climate.apache.org Date: Sun, 22 Jun 2014 02:24:23 -0000 Message-Id: <69f945be339441f78fd166a8c040f4b0@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/2] git commit: CLIMATE-475 - Fix metric imports in ocw.tests.test_metrics 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 Authored: Thu Jun 19 08:44:17 2014 -0700 Committer: Michael Joyce 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])