Ignore:
Timestamp:
06/29/20 12:39:59 (5 years ago)
Author:
jdquinn
Message:

BUG: Corrected test2010.py; results output precison for runme.py to match runme.m

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/test/NightlyRun/runme.py

    r25168 r25178  
    11#!/usr/bin/env python
     2import argparse
     3from glob import glob
    24import os
    3 import argparse
     5from sys import float_info
     6from traceback import format_exc
     7
    48import 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
    910try:
    1011    from parallelrange import parallelrange
     
    1213    import devpath
    1314    from parallelrange import parallelrange
    14 from IdToName import IdToName
    1515from arch import archread
    1616from arch import archwrite
     17from GetIds import *
     18from IdToName import IdToName
    1719
    1820
     
    182184                        # Matlab uses base 1, so use base 1 in labels
    183185                        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
    185187                        if str(archive) == 'None':
    186188                            raise NameError("Field name '" + archive_name + '_field' + str(k + 1) + "' does not exist in archive file.")
     
    196198                        #disp test result
    197199                        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)))
    199201                            errorcount += 1
    200202                            erroredtest_list.append(id)
    201203                        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)))
    203205
    204206                    except Exception as message:
Note: See TracChangeset for help on using the changeset viewer.