Changeset 8c65a33 in sasmodels


Ignore:
Timestamp:
Nov 9, 2016 11:06:42 AM (8 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
88fafac
Parents:
23ae1d6
Message:

change model-model comparison to use , because : is the windows drive separator, and models may be specified with the full path

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/compare.py

    r85fe7f8 r8c65a33  
    6060sasmodels rewrite. 
    6161 
    62 model is the name of the model to compare (see below). 
     62model or model1,model2 are the names of the models to compare (see below). 
    6363N1 is the number of times to run sasmodels (default=1). 
    6464N2 is the number times to run sasview (default=1). 
     
    9292    -sasview sets the sasview calculation engine 
    9393 
    94 The default is -single -sasview.  Note that the interpretation of quad 
     94The default is -single -double.  Note that the interpretation of quad 
    9595precision depends on architecture, and may vary from 64-bit to 128-bit, 
    9696with 80-bit floats being common (1e-19 precision). 
    9797 
    9898Key=value pairs allow you to set specific values for the model parameters. 
     99Key=value1,value2 to compare different values of the same parameter. 
     100value can be an expression including other parameters 
    99101""" 
    100102 
     
    885887    return isfloat or INTEGER_RE.match(str) 
    886888 
     889# For distinguishing pairs of models for comparison 
     890# key-value pair separator = 
     891# shell characters  | & ; <> $ % ' " \ # ` 
     892# model and parameter names _ 
     893# parameter expressions - + * / . ( ) 
     894# path characters including tilde expansion and windows drive ~ / : 
     895# not sure about brackets [] {} 
     896# maybe one of the following @ ? ^ ! , 
     897MODEL_SPLIT = ',' 
    887898def parse_opts(argv): 
    888899    # type: (List[str]) -> Dict[str, Any] 
     
    987998    # pylint: enable=bad-whitespace 
    988999 
    989     if ':' in name: 
    990         name, name2 = name.split(':',2) 
     1000    if MODEL_SPLIT in name: 
     1001        name, name2 = name.split(MODEL_SPLIT, 2) 
    9911002    else: 
    9921003        name2 = name 
     
    10361047            print("%r invalid; parameters are: %s"%(k, ", ".join(sorted(s)))) 
    10371048            return None 
    1038         v1, v2 = v.split(':',2) if ':' in v else (v,v) 
     1049        v1, v2 = v.split(MODEL_SPLIT, 2) if MODEL_SPLIT in v else (v,v) 
    10391050        if v1 and k in pars: 
    10401051            presets[k] = float(v1) if isnumber(v1) else v1 
Note: See TracChangeset for help on using the changeset viewer.