Changes in / [c9801b8:12076cf] in sasmodels


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/generate.py

    rae7b97b r51bfbeb  
    503503    fn = q_pars['fn'] 
    504504 
    505     # Build polydispersity loops 
    506     depth = 4 
    507     offset = "" 
    508     loop_head = [] 
    509     loop_end = [] 
    510     for name in pd_pars: 
    511         subst = { 'name': name, 'offset': offset } 
    512         loop_head.append(indent(LOOP_OPEN%subst, depth)) 
    513         loop_end.insert(0, (" "*depth) + "}") 
    514         offset += '+N'+name 
    515         depth += 2 
     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 
    516517 
    517518    # The volume parameters in the inner loop are used to call the volume() 
Note: See TracChangeset for help on using the changeset viewer.