Changeset 7dde87f in sasmodels for sasmodels/generate.py


Ignore:
Timestamp:
Dec 4, 2017 6:19:00 AM (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:
d0dc9a3
Parents:
a261a83 (diff), 0f113fb (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'ticket-786' into generic_integration_loop

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/generate.py

    r2d81cfe ra261a83  
    270270""" 
    271271 
     272 
     273def set_integration_size(info, n): 
     274    # type: (ModelInfo, int) -> None 
     275    """ 
     276    Update the model definition, replacing the gaussian integration with 
     277    a gaussian integration of a different size. 
     278 
     279    Note: this really ought to be a method in modelinfo, but that leads to 
     280    import loops. 
     281    """ 
     282    if (info.source and any(lib.startswith('lib/gauss') for lib in info.source)): 
     283        import os.path 
     284        from .gengauss import gengauss 
     285        path = os.path.join(MODEL_PATH, "lib", "gauss%d.c"%n) 
     286        if not os.path.exists(path): 
     287            gengauss(n, path) 
     288        info.source = ["lib/gauss%d.c"%n if lib.startswith('lib/gauss') 
     289                        else lib for lib in info.source] 
    272290 
    273291def format_units(units): 
Note: See TracChangeset for help on using the changeset viewer.