Changeset bb4b509 in sasmodels for sasmodels/generate.py


Ignore:
Timestamp:
May 16, 2017 12:14:04 PM (7 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:
452b168
Parents:
ba62072
Message:

check parameter names as part of test; PEP8 cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/generate.py

    rc4e3215 rbb4b509  
    492492 
    493493def test_tag_float(): 
    494  
    495     cases=""" 
     494    """check that floating point constants are properly identified and tagged with 'f'""" 
     495 
     496    cases = """ 
    496497ZP  : 0. 
    497498ZPF : 0.0,0.01,0.1 
     
    519520""" 
    520521 
    521     output=""" 
     522    output = """ 
    522523ZP  : 0.f 
    523524ZPF : 0.0f,0.01f,0.1f 
     
    611612    # type: (str, List[Parameter]) -> List[str] 
    612613    """ 
    613     Return a list of *prefix.parameter* from parameter items. 
     614    Return a list of *prefix+parameter* from parameter items. 
     615 
     616    *prefix* should be "v." if v is a struct. 
    614617    """ 
    615618    return [p.as_call_reference(prefix) for p in pars] 
     
    733736        call_iqxy = "#define CALL_IQ(_q,_i,_v) Iq(%s)" % (",".join(pars_sqrt)) 
    734737 
    735     magpars = [k-2 for k,p in enumerate(partable.call_parameters) 
     738    magpars = [k-2 for k, p in enumerate(partable.call_parameters) 
    736739               if p.type == 'sld'] 
    737740 
     
    742745    source.append("#define NUM_MAGNETIC %d" % partable.nmagnetic) 
    743746    source.append("#define MAGNETIC_PARS %s"%",".join(str(k) for k in magpars)) 
    744     for k,v in enumerate(magpars[:3]): 
     747    for k, v in enumerate(magpars[:3]): 
    745748        source.append("#define MAGNETIC_PAR%d %d"%(k+1, v)) 
    746749 
     
    779782        "#undef CALL_IQ", 
    780783        "#undef KERNEL_NAME", 
    781          ] 
     784    ] 
    782785 
    783786    imagnetic = [ 
     
    872875 
    873876# TODO: need a single source for rst_prolog; it is also in doc/rst_prolog 
    874 RST_PROLOG = """\ 
     877RST_PROLOG = r"""\ 
    875878.. |Ang| unicode:: U+212B 
    876879.. |Ang^-1| replace:: |Ang|\ :sup:`-1` 
Note: See TracChangeset for help on using the changeset viewer.