Changeset 25178 for issm/trunk-jpl/test/NightlyRun/runme.py
- Timestamp:
- 06/29/20 12:39:59 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/test/NightlyRun/runme.py
r25168 r25178 1 1 #!/usr/bin/env python 2 import argparse 3 from glob import glob 2 4 import os 3 import argparse 5 from sys import float_info 6 from traceback import format_exc 7 4 8 import numpy as np 5 from traceback import format_exc 6 from sys import float_info 7 from glob import glob 8 from GetIds import * 9 9 10 try: 10 11 from parallelrange import parallelrange … … 12 13 import devpath 13 14 from parallelrange import parallelrange 14 from IdToName import IdToName15 15 from arch import archread 16 16 from arch import archwrite 17 from GetIds import * 18 from IdToName import IdToName 17 19 18 20 … … 182 184 # Matlab uses base 1, so use base 1 in labels 183 185 archive = np.array(archread(archive_file, archive_name + '_field' + str(k + 1))) 184 # Because np.array is weird (str(np.array(None)) becomes 'None' but np.array(None) is never equal to None, it basically becomes a type of string in an array):186 # NOTE: str(np.array(None)) becomes 'None' but np.array(None) is never equal to None: it basically becomes a type of string in an array 185 187 if str(archive) == 'None': 186 188 raise NameError("Field name '" + archive_name + '_field' + str(k + 1) + "' does not exist in archive file.") … … 196 198 #disp test result 197 199 if (np.any(error_diff > tolerance) or np.isnan(error_diff)): 198 print(('ERROR difference: { } > {} test id: {} test name: {} field: {}'.format(error_diff, tolerance, id, id_string, fieldname)))200 print(('ERROR difference: {:7.2g} > {:7.2g} test id: {} test name: {} field: {}'.format(error_diff, tolerance, id, id_string, fieldname))) 199 201 errorcount += 1 200 202 erroredtest_list.append(id) 201 203 else: 202 print(('SUCCESS difference: { } < {} test id: {} test name: {} field: {}'.format(error_diff, tolerance, id, id_string, fieldname)))204 print(('SUCCESS difference: {:7.2g} < {:7.2g} test id: {} test name: {} field: {}'.format(error_diff, tolerance, id, id_string, fieldname))) 203 205 204 206 except Exception as message:
Note:
See TracChangeset
for help on using the changeset viewer.