Changeset 2a74b99 in sasmodels


Ignore:
Timestamp:
Feb 20, 2015 9:05:50 AM (9 years ago)
Author:
ajj
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
4c8f9cd
Parents:
2eaae42
Message:

fixing pow/powr/pown issue

Location:
sasmodels
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/convert.py

    r99e6860 r2a74b99  
    5555    """ 
    5656    __import__('sasmodels.models.'+name) 
    57     model = getattr(sasmodels.models, name, None) 
     57    from . import models 
     58    model = getattr(models, name, None) 
    5859    mapping = model.oldpars 
    5960    oldname = model.oldname 
  • sasmodels/generate.py

    r3750279 r2a74b99  
    266266#  define local 
    267267#  define constant const 
     268#  define powr(a,b) pow(a,b) 
     269#  define pown(a,b) pow(a,b) 
    268270#else 
    269271#  ifdef USE_SINCOS 
     
    272274#    define SINCOS(angle,svar,cvar) do {svar=sin(angle);cvar=cos(angle);} while (0) 
    273275#  endif 
    274 #  define pow(a,b) powr(a,b) 
    275276#endif 
    276277 
     
    503504    fn = q_pars['fn'] 
    504505 
    505     if len(pd_pars) > 0: 
    506         # Build polydispersity loops 
    507         depth = 4 
    508         offset = "" 
    509         loop_head = [] 
    510         loop_end = [] 
    511         for name in pd_pars: 
    512             subst = { 'name': name, 'offset': offset } 
    513             loop_head.append(indent(LOOP_OPEN%subst, depth)) 
    514             loop_end.insert(0, (" "*depth) + "}") 
    515             offset += '+N'+name 
    516             depth += 2 
     506 
     507    # Build polydispersity loops 
     508    depth = 4 
     509    offset = "" 
     510    loop_head = [] 
     511    loop_end = [] 
     512    for name in pd_pars: 
     513        subst = { 'name': name, 'offset': offset } 
     514        loop_head.append(indent(LOOP_OPEN%subst, depth)) 
     515        loop_end.insert(0, (" "*depth) + "}") 
     516        offset += '+N'+name 
     517        depth += 2 
    517518 
    518519    # The volume parameters in the inner loop are used to call the volume() 
Note: See TracChangeset for help on using the changeset viewer.