Changeset 21412


Ignore:
Timestamp:
11/22/16 07:04:11 (8 years ago)
Author:
bdef
Message:

BUG:minor typos and changing print formating in runme.py

Location:
issm/trunk-jpl/test/NightlyRun
Files:
4 edited

Legend:

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

    r21408 r21412  
    5454        #GET benchmark {{{
    5555        if not benchmark in ['all','nightly','ismip','eismint','thermal','mesh','validation','tranforcing','adolc','slr']:
    56                 print "runme warning: benchmark '%s' not supported, defaulting to test 'nightly'." % benchmark
     56                print("runme warning: benchmark '{}' not supported, defaulting to test 'nightly'.".format(benchmark))
    5757                benchmark='nightly'
    5858        # }}}
    5959        #GET procedure {{{
    6060        if not procedure in ['check','update']:
    61                 print "runme warning: procedure '%s' not supported, defaulting to test 'check'." % procedure
     61                print("runme warning: procedure '{}' not supported, defaulting to test 'check'.".format(procedure))
    6262                procedure='check'
    6363        # }}}
    6464        #GET output {{{
    6565        if not output in ['nightly','none']:
    66                 print "runme warning: output '%s' not supported, defaulting to test 'none'." % output
     66                print("runme warning: output '{}' not supported, defaulting to test 'none'.".format(output))
    6767                output='none'
    6868        # }}}
     
    167167
    168168                                for k,fieldname in enumerate(field_names):
    169 
     169                                        print fieldname
    170170                                        try:
     171                                                print('getting {}'.format(fieldname))
    171172                                                #Get field and tolerance
    172173                                                field=np.array(field_values[k])
     
    183184                                                if archive == None:
    184185                                                        raise NameError("Field name '"+archive_name+'_field'+str(k+1)+"' does not exist in archive file.")
    185                                                 error_diff=np.amax(np.abs(archive-field),axis=0)/ \
    186                                                                    (np.amax(np.abs(archive),axis=0)+float_info.epsilon)
     186                                                error_diff=np.amax(np.abs(archive-field),axis=0)/(np.amax(np.abs(archive),axis=0)+float_info.epsilon)
    187187
    188188                                                #disp test result
    189189                                                if (np.any(error_diff>tolerance) or np.isnan(error_diff)):
    190                                                         print 'ERROR   difference: %-7.2g > %7.2g test id: %i test name: %s field: %s' % \
    191                                                                 (error_diff,tolerance,id,id_string,fieldname)
     190                                                        print('ERROR   difference: {} > {} test id: {} test name: {} field: {}'.format(error_diff,tolerance,id,id_string,fieldname))
    192191                                                else:
    193                                                         print 'SUCCESS difference: %-7.2g < %7.2g test id: %i test name: %s field: %s' % \
    194                                                                 (error_diff,tolerance,id,id_string,fieldname)
     192                                                        print('SUCCESS difference: {} < {} test id: {} test name: {} field: {}'.format(error_diff,tolerance,id,id_string,fieldname))
    195193
    196194                                        except Exception as message:
     
    204202                                                        fid.write('\n------------------------------------------------------------------\n')
    205203                                                        fid.close()
    206                                                         print 'FAILURE difference: N/A test id: %i test name: %s field: %s' % (id,id_string,fieldname)
     204                                                        print('FAILURE difference: N/A test id: {} test name: {} field: {}'.format(id,id_string,fieldname))
    207205                                                else:
    208                                                         print 'FAILURE difference: N/A test id: %i test name: %s field: %s' % (id,id_string,fieldname)
     206                                                        print('FAILURE difference: N/A test id: {} test name: {} field: {}'.format(id,id_string,fieldname))
    209207                                                        raise RuntimeError(message)
    210208
     
    220218                                fid.write('\n------------------------------------------------------------------\n')
    221219                                fid.close()
    222                                 print 'FAILURE difference: N/A test id: %i test name: %s field: %s' % (id,id_string,'N/A')
     220                                print('FAILURE difference: N/A test id: {} test name: {} field: {}'.format(id,id_string,'N/A'))
    223221                        else:
    224                                 print 'FAILURE difference: N/A test id: %i test name: %s field: %s' % (id,id_string,'N/A')
     222                                print('FAILURE difference: N/A test id: {} test name: {} field: {}'.format(id,id_string,'N/A'))
    225223                                raise RuntimeError(message)
    226224
     
    239237                                print "PYTHONSTARTUP error: ",e
    240238                else:
    241                         print "PYTHONSTARTUP file '%s' does not exist." % PYTHONSTARTUP
     239                        print("PYTHONSTARTUP file '{}' does not exist.".format(PYTHONSTARTUP))
    242240
    243241        parser = argparse.ArgumentParser(description='RUNME - test deck for ISSM nightly runs')
  • issm/trunk-jpl/test/NightlyRun/test803.py

    r21408 r21412  
    1717
    1818#Thermal model
    19 pos_surf=np.nonzero(md.mesh.vertexonsurface)[0]
     19pos_surf=np.where(md.mesh.vertexonsurface)[0]
    2020md.thermal.spctemperature[pos_surf]=md.initialization.temperature[pos_surf]
    2121md.thermal.isenthalpy=True
  • issm/trunk-jpl/test/NightlyRun/test806.py

    r21411 r21412  
    3838md.calving.coeff=4.89e13*np.ones((md.mesh.numberofvertices))
    3939md.calving.meltingrate=np.zeros((md.mesh.numberofvertices))
    40 md.levelset.spclevelset=np.np.nan*np.ones((md.mesh.numberofvertices))
     40md.levelset.spclevelset=np.nan*np.ones((md.mesh.numberofvertices))
    4141
    4242md.transient.requested_outputs=['default','StrainRateparallel','StrainRateperpendicular','Calvingratex','Calvingratey','CalvingCalvingrate']
  • issm/trunk-jpl/test/NightlyRun/test807.py

    r21411 r21412  
    3737md.calving.calvingrate=np.zeros((md.mesh.numberofvertices))
    3838md.calving.meltingrate=10000*np.ones((md.mesh.numberofvertices))
    39 md.levelset.spclevelset=np.np.nan*np.ones((md.mesh.numberofvertices))
     39md.levelset.spclevelset=np.nan*np.ones((md.mesh.numberofvertices))
    4040
    4141md=solve(md,'Transient')
Note: See TracChangeset for help on using the changeset viewer.