Changeset d86f0fc in sasmodels for sasmodels/generate.py
- Timestamp:
- Mar 26, 2018 1:52:24 PM (6 years ago)
- 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
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/generate.py
ra0243f7 rd86f0fc 290 290 import loops. 291 291 """ 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): 294 293 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): 297 296 gengauss(n, path) 298 297 info.source = ["lib/gauss%d.c"%n if lib.startswith('lib/gauss') 299 298 else lib for lib in info.source] 300 299 301 300 def format_units(units): … … 321 320 for w, h in zip(column_widths, PARTABLE_HEADERS)] 322 321 323 sep= " ".join("="*w for w in column_widths)322 underbar = " ".join("="*w for w in column_widths) 324 323 lines = [ 325 sep,324 underbar, 326 325 " ".join("%-*s" % (w, h) 327 326 for w, h in zip(column_widths, PARTABLE_HEADERS)), 328 sep,327 underbar, 329 328 ] 330 329 for p in pars: … … 335 334 "%*g" % (column_widths[3], p.default), 336 335 ])) 337 lines.append( sep)336 lines.append(underbar) 338 337 return "\n".join(lines) 339 338 … … 613 612 """ 614 613 spaces = " "*depth 615 sep= "\n" + spaces616 return spaces + sep.join(s.split("\n"))614 interline_separator = "\n" + spaces 615 return spaces + interline_separator.join(s.split("\n")) 617 616 618 617 … … 620 619 def load_template(filename): 621 620 # type: (str) -> str 621 """ 622 Load template file from sasmodels resource directory. 623 """ 622 624 path = joinpath(DATA_PATH, filename) 623 625 mtime = getmtime(path)
Note: See TracChangeset
for help on using the changeset viewer.