From 0bbfdd2aeb40146feab1d72f76de8f02b3e00abc Mon Sep 17 00:00:00 2001
From: "(no author)" <(no author)@8a9318a1-56ba-4d59-b755-99d26321be01>
Date: Tue, 25 Aug 2009 19:32:18 +0000
Subject: [PATCH] changing the meaning of the non-finite tolerance to measure
 only non-finite differences

git-svn-id: https://svn.ssec.wisc.edu/repos/glance/trunk@70 8a9318a1-56ba-4d59-b755-99d26321be01
---
 pyglance/glance/compare.py  | 6 ++----
 pyglance/glance/exconfig.py | 3 ++-
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/pyglance/glance/compare.py b/pyglance/glance/compare.py
index 2e21b39..a14f490 100644
--- a/pyglance/glance/compare.py
+++ b/pyglance/glance/compare.py
@@ -550,10 +550,8 @@ def _check_pass_or_fail(varRunInfo, variableStats, defaultValues) :
     # check to see if it failed on nonfinite data
     if not (nonfiniteTolerance is None) :
         non_finite_pts = variableStats['Finite Data Statistics']['finite_in_only_one_count']
-        non_finite_pts = non_finite_pts + variableStats['Missing Value Statistics']['common_missing_count'] # TODO, should this line be removed?
-        non_finite_pts = non_finite_pts + variableStats['NaN Statistics']['common_nan_count']
-        non_finite_fraction = float(non_finite_pts) / float(variableStats['General Statistics']['num_data_points'])
-        passedNonFinite = non_finite_fraction <= nonfiniteTolerance
+        non_finite_diff_fraction = float(non_finite_pts) / float(variableStats['General Statistics']['num_data_points'])
+        passedNonFinite = non_finite_diff_fraction <= nonfiniteTolerance
         
         # combine the two test results
         if (didPass is None) :
diff --git a/pyglance/glance/exconfig.py b/pyglance/glance/exconfig.py
index 1f29e08..b1e99d7 100644
--- a/pyglance/glance/exconfig.py
+++ b/pyglance/glance/exconfig.py
@@ -69,7 +69,8 @@ defaultValues = {'epsilon': 0.0,                        # the acceptable differe
                                                         # None indicates that variables should not be tested
                                                         # on nearness of epsilon comparison
                                                         
-                 'nonfinite_data_tolerance': None,      # the allowed fraction of non-finite data
+                 'nonfinite_data_tolerance': None,      # the allowed fraction of non-finite data that
+                                                        # that differs between the two files
                                                         # None indicates that variables should not be tested
                                                         # on amount of non-finite data
                  
-- 
GitLab