Return-Path: X-Original-To: apmail-climate-dev-archive@minotaur.apache.org Delivered-To: apmail-climate-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 876E811639 for ; Sun, 6 Apr 2014 22:49:40 +0000 (UTC) Received: (qmail 32462 invoked by uid 500); 6 Apr 2014 22:49:39 -0000 Delivered-To: apmail-climate-dev-archive@climate.apache.org Received: (qmail 32397 invoked by uid 500); 6 Apr 2014 22:49:39 -0000 Mailing-List: contact dev-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 dev@climate.apache.org Received: (qmail 32389 invoked by uid 99); 6 Apr 2014 22:49:39 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 06 Apr 2014 22:49:39 +0000 X-ASF-Spam-Status: No, hits=-2000.3 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Sun, 06 Apr 2014 22:49:38 +0000 Received: (qmail 32323 invoked by uid 99); 6 Apr 2014 22:49:15 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 06 Apr 2014 22:49:15 +0000 Date: Sun, 6 Apr 2014 22:49:15 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: dev@climate.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CLIMATE-399) Use functions in numpy.testing for unit tests involving array comparisons MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/CLIMATE-399?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13961557#comment-13961557 ] ASF GitHub Bot commented on CLIMATE-399: ---------------------------------------- Github user asfgit closed the pull request at: https://github.com/apache/climate/pull/17 > Use functions in numpy.testing for unit tests involving array comparisons > ------------------------------------------------------------------------- > > Key: CLIMATE-399 > URL: https://issues.apache.org/jira/browse/CLIMATE-399 > Project: Apache Open Climate Workbench > Issue Type: Improvement > Components: general > Affects Versions: 0.3-incubating > Reporter: Alex Goodman > Assignee: Alex Goodman > Fix For: 0.4 > > > Currently our unit tests for numpy array equality look something like this: > {code} > self.assertTrue(np.arrray_equal(x, y)) > {code} > which could raise the following exception: > {code} > AssertionError: > False is not true > {code} > This indeed tells us if the test has failed, but it would be better if the output could show where the arrays were inconsistent. The functions included in numpy.testing fulfill this purpose, and are widely used in other projects depending on numpy arrays. Therefore we should replace all instances of the above example with: > {code} > np.testing.assert_array_equal(x, y) > {code} > Which could raise exceptions like: > {code} > AssertionError: > Arrays are not equal > (mismatch 100.0%) > x: array([ 1. , 3, 7]) > y: array([ -2. , -4, -6]) > {code} -- This message was sent by Atlassian JIRA (v6.2#6252)