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 034FA10091 for ; Fri, 16 Aug 2013 17:03:22 +0000 (UTC) Received: (qmail 54541 invoked by uid 500); 16 Aug 2013 17:03:22 -0000 Delivered-To: apmail-climate-commits-archive@climate.apache.org Received: (qmail 54515 invoked by uid 500); 16 Aug 2013 17:03:21 -0000 Mailing-List: contact commits-help@climate.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@climate.incubator.apache.org Delivered-To: mailing list commits@climate.incubator.apache.org Received: (qmail 54508 invoked by uid 99); 16 Aug 2013 17:03:21 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Aug 2013 17:03:21 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Aug 2013 17:03:19 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id A8B07238888A; Fri, 16 Aug 2013 17:02:58 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1514789 - /incubator/climate/branches/RefactorInput/ocw/tests/test_evaluation.py Date: Fri, 16 Aug 2013 17:02:58 -0000 To: commits@climate.incubator.apache.org From: joyce@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20130816170258.A8B07238888A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: joyce Date: Fri Aug 16 17:02:58 2013 New Revision: 1514789 URL: http://svn.apache.org/r1514789 Log: CLIMATE-256 - Update Evaluation tests for new Bounds related code. Modified: incubator/climate/branches/RefactorInput/ocw/tests/test_evaluation.py Modified: incubator/climate/branches/RefactorInput/ocw/tests/test_evaluation.py URL: http://svn.apache.org/viewvc/incubator/climate/branches/RefactorInput/ocw/tests/test_evaluation.py?rev=1514789&r1=1514788&r2=1514789&view=diff ============================================================================== --- incubator/climate/branches/RefactorInput/ocw/tests/test_evaluation.py (original) +++ incubator/climate/branches/RefactorInput/ocw/tests/test_evaluation.py Fri Aug 16 17:02:58 2013 @@ -20,7 +20,7 @@ import unittest import numpy as np import datetime as dt -from ocw.dataset import Dataset +from ocw.dataset import Dataset, Bounds from ocw.evaluation import Evaluation from ocw.metrics import Bias, TemporalStdDev @@ -63,6 +63,21 @@ class TestEvaluation(unittest.TestCase): # TemporalStdDev is a "unary" metric and should be stored as such self.assertEqual(len(self.eval.unary_metrics), 1) + def test_valid_subregion(self): + bound = Bounds( + -10, 10, + -20, 20, + dt.datetime(2000, 1, 1), dt.datetime(2001, 1, 1)) + + self.eval.subregions = [bound, bound] + self.assertEquals(len(self.eval.subregions), 2) + + def test_invalid_subregion_bound(self): + bound = "This is not a bounds object" + + with self.assertRaises(ValueError): + self.eval.subregions = [bound] + def test_add_ref_dataset(self): self.eval = Evaluation(self.test_dataset, [], [])