Skip to content
Snippets Groups Projects
Commit 0bbfdd2a authored by (no author)'s avatar (no author)
Browse files

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
parent ec0cc141
No related branches found
No related tags found
No related merge requests found
......@@ -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) :
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment