ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/branches/development/validation/compare.py
Revision: 1658
Committed: Thu Oct 27 18:37:20 2011 UTC (13 years, 6 months ago) by chuckv
Content type: text/x-python
File size: 1019 byte(s)
Log Message:
Adding bits for numerical validation of openmd results.

File Contents

# User Rev Content
1 chuckv 1658 import comparator
2     import sys
3     import argparse
4     import logging
5    
6     if __name__ == "__main__":
7     parser = argparse.ArgumentParser(description='File comparison tool for floating point data')
8     parser.add_argument( 'original', help = 'Original file to compare against' )
9     parser.add_argument( 'new', help = 'New file to comare against' )
10     parser.add_argument( 'epsilon', type = float, help = 'Epsilon to compare files with' )
11     parser.add_argument( '--scale', type = float, default = float(1), help = 'Scaling factor for New file values' )
12     parser.add_argument( '--ignore-sign', action='store_true', default = False, help = 'Ignore sign differences between files' )
13     parser.add_argument( '--verbose', '-v', action='store_true', default = False, help = 'Verbose output' )
14    
15     args = parser.parse_args()
16    
17     level = logging.INFO
18     if args.verbose:
19     level = logging.DEBUG
20    
21     files_same = comparator.compare( args.original, args.new, args.epsilon, args.scale, ignoreSign=arg.ignore_sign)
22    
23     if not files_same:
24     logging.warn("Files Differ")

Properties

Name Value
svn:executable *