Skip to content

Commit a78de6a

Browse files
peterfpetersonPeter Peterson
authored and
Peter Peterson
committed
Fixed error in fixing the percent differences to avoid nans. Refs nexusformat#1.
git-svn-id: https://svn.nexusformat.org/code/trunk@1447 ff5d1e40-2be0-497f-93bd-dc18237bd3c7
1 parent 7c20c8c commit a78de6a

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

applications/nxdiff

-8
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,6 @@ def getPercentDiff(left, right, nandiff=float("nan")):
3131
diffs = left-right
3232
combine = numpy.fabs(left) + numpy.fabs(right)
3333

34-
# fix the denominator so there are not nans
35-
try:
36-
indices = (combine == 0)
37-
left[indices] = 1.
38-
except IndexError:
39-
if combine == 0:
40-
left = 1.
41-
4234
# do the percent part
4335
diffs = 100. * numpy.fabs(diffs/left)
4436
try:

0 commit comments

Comments
 (0)