Changeset 1201
- Timestamp:
- 05/02/09 19:19:57 (3 years ago)
- File:
-
- 1 edited
-
trunk/applications/nxdiff (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/applications/nxdiff
r1200 r1201 342 342 rightLength *= right.dims 343 343 344 # the thre ashold for printing values345 try: 346 thre ashold = kwargs["threashold"]344 # the threshold for printing values 345 try: 346 threshold = kwargs["threshold"] 347 347 except KeyError: 348 thre ashold = None348 threshold = None 349 349 350 350 try: … … 354 354 355 355 # how many items to show 356 if not thre ashold:356 if not threshold: 357 357 try: 358 358 numItems = kwargs["numitems"] … … 382 382 print rightSym, right.attrs 383 383 384 if thre ashold is None:384 if threshold is None: 385 385 try: 386 386 print leftSym, left.data.__str__(last=leftLength) … … 401 401 if isNaN(myDiff): 402 402 nanIndices.append(index) 403 elif myDiff > thre ashold:403 elif myDiff > threshold: 404 404 changeInfo.append((index, myDiff, left.data[i], right.data[i])) 405 405 print "%d values changed between number and NaN" % len(nanIndices) 406 406 print "%d values changed more than %.2f%%" % (len(changeInfo), 407 thre ashold)407 threshold) 408 408 if shownandiffs and len(nanIndices) > 0: 409 409 print "Indices changed between number and NaN:", nanIndices … … 449 449 + "is ten (10). To show all values specify minus one " 450 450 + "(-1).") 451 parser.add_option("", "--show-percent", dest="thre ashold",452 help="Set a thre ashold for the minimum percentage "451 parser.add_option("", "--show-percent", dest="threshold", 452 help="Set a threshold for the minimum percentage " 453 453 + "difference shown in values. This turns on " 454 454 + "\"--show-values\" mode and overrides " … … 470 470 parser.set_defaults(ignorelinks=False) 471 471 parser.set_defaults(numvalues=None) 472 parser.set_defaults(thre ashold=None)472 parser.set_defaults(threshold=None) 473 473 parser.set_defaults(shownandiffs=False) 474 474 parser.set_defaults(ignorenotes=False) … … 488 488 else: 489 489 options.numvalues = 0 490 if options.thre ashold is not None:490 if options.threshold is not None: 491 491 options.showvalues = True 492 options.thre ashold = float(options.threashold)492 options.threshold = float(options.threshold) 493 493 if len(args) != 2: 494 494 parser.error("Must compare two files") … … 543 543 printDataDiff(left, right, diff, format=format, 544 544 numitems=options.numvalues, 545 thre ashold=options.threashold,545 threshold=options.threshold, 546 546 shownandiffs=options.shownandiffs)
Note: See TracChangeset
for help on using the changeset viewer.
