Changeset 9404dd3 in sasmodels for sasmodels/compare_many.py


Ignore:
Timestamp:
Dec 4, 2015 12:41:47 PM (8 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
eaca9eb
Parents:
7bb290c
Message:

python 3.x support

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/compare_many.py

    r4b41184 r9404dd3  
    5353            raise 
    5454        except: 
    55             print >>sys.stderr, traceback.format_exc() 
    56             print >>sys.stderr, "when comparing",name,"for seed",seed 
     55            traceback.print_exc() 
     56            print("when comparing %s for %d"%(name, seed)) 
    5757            if hasattr(data, 'qx_data'): 
    5858                result = np.NaN*data.data 
     
    7171    max_diff = [0] 
    7272    for k in range(N): 
    73         print >>sys.stderr, name, k 
     73        print("%s %d"%(name, k)) 
    7474        pars_i, seed = randomize_model(pars) 
    7575        constrain_pars(model_definition, pars_i) 
     
    109109        else: 
    110110            print(("%d,"%seed)+','.join("%g"%v for v in columns)) 
    111     print '"good","%d/%d","max diff",%g'%(num_good, N, max_diff[0]) 
     111    print('"good","%d/%d","max diff",%g'%(num_good, N, max_diff[0])) 
    112112 
    113113 
    114114def print_usage(): 
    115     print "usage: compare_many.py MODEL COUNT (1dNQ|2dNQ) (CUTOFF|mono) (single|double|quad)" 
     115    print("usage: compare_many.py MODEL COUNT (1dNQ|2dNQ) (CUTOFF|mono) (single|double|quad)") 
    116116 
    117117 
     
    155155    model = sys.argv[1] 
    156156    if not (model in MODELS) and (model != "all"): 
    157         print 'Bad model %s.  Use "all" or one of:' 
     157        print('Bad model %s.  Use "all" or one of:') 
    158158        print_models() 
    159159        sys.exit(1) 
Note: See TracChangeset for help on using the changeset viewer.