Changeset d86f0fc in sasmodels for sasmodels/generate.py


Ignore:
Timestamp:
Mar 26, 2018 1:52:24 PM (6 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
802c412
Parents:
f4ae8c4
Message:

lint reduction

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/generate.py

    ra0243f7 rd86f0fc  
    290290    import loops. 
    291291    """ 
    292     if (info.source and any(lib.startswith('lib/gauss') for lib in info.source)): 
    293         import os.path 
     292    if info.source and any(lib.startswith('lib/gauss') for lib in info.source): 
    294293        from .gengauss import gengauss 
    295         path = os.path.join(MODEL_PATH, "lib", "gauss%d.c"%n) 
    296         if not os.path.exists(path): 
     294        path = joinpath(MODEL_PATH, "lib", "gauss%d.c"%n) 
     295        if not exists(path): 
    297296            gengauss(n, path) 
    298297        info.source = ["lib/gauss%d.c"%n if lib.startswith('lib/gauss') 
    299                         else lib for lib in info.source] 
     298                       else lib for lib in info.source] 
    300299 
    301300def format_units(units): 
     
    321320                     for w, h in zip(column_widths, PARTABLE_HEADERS)] 
    322321 
    323     sep = " ".join("="*w for w in column_widths) 
     322    underbar = " ".join("="*w for w in column_widths) 
    324323    lines = [ 
    325         sep, 
     324        underbar, 
    326325        " ".join("%-*s" % (w, h) 
    327326                 for w, h in zip(column_widths, PARTABLE_HEADERS)), 
    328         sep, 
     327        underbar, 
    329328        ] 
    330329    for p in pars: 
     
    335334            "%*g" % (column_widths[3], p.default), 
    336335            ])) 
    337     lines.append(sep) 
     336    lines.append(underbar) 
    338337    return "\n".join(lines) 
    339338 
     
    613612    """ 
    614613    spaces = " "*depth 
    615     sep = "\n" + spaces 
    616     return spaces + sep.join(s.split("\n")) 
     614    interline_separator = "\n" + spaces 
     615    return spaces + interline_separator.join(s.split("\n")) 
    617616 
    618617 
     
    620619def load_template(filename): 
    621620    # type: (str) -> str 
     621    """ 
     622    Load template file from sasmodels resource directory. 
     623    """ 
    622624    path = joinpath(DATA_PATH, filename) 
    623625    mtime = getmtime(path) 
Note: See TracChangeset for help on using the changeset viewer.