Changes in / [a69d8cd:ecb485c] in sasmodels


Ignore:
Location:
sasmodels
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/mixture.py

    r7fec3b7 recf895e  
    9494            # If model is a sum model, each constituent model gets its own scale parameter 
    9595            scale_prefix = prefix 
    96             if prefix == '' and hasattr(part,"operation") and part.operation == '*': 
     96            if prefix == '' and getattr(part, "operation", '') == '*': 
    9797                # `part` is a composition product model. Find the prefixes of 
    98                 # it's parameters to form a new prefix for the scale, eg: 
    99                 # a model with A*B*C will have ABC_scale 
     98                # it's parameters to form a new prefix for the scale. 
     99                # For example, a model with A*B*C will have ABC_scale. 
    100100                sub_prefixes = [] 
    101101                for param in part.parameters.kernel_parameters: 
  • sasmodels/modelinfo.py

    r108e70e r95498a3  
    6969        processed.append(parse_parameter(*p)) 
    7070    partable = ParameterTable(processed) 
     71    partable.check_angles() 
    7172    return partable 
    7273 
     
    421422        # type: (List[Parameter]) -> None 
    422423        self.kernel_parameters = parameters 
    423         self._check_angles() 
    424424        self._set_vector_lengths() 
    425425 
     
    471471        self.pd_2d = set(p.name for p in self.call_parameters if p.polydisperse) 
    472472 
    473     def _check_angles(self): 
     473    def check_angles(self): 
     474        """ 
     475        Check that orientation angles are theta, phi and possibly psi. 
     476        """ 
    474477        theta = phi = psi = -1 
    475478        for k, p in enumerate(self.kernel_parameters): 
     
    494497            if psi >= 0 and psi != phi+1: 
    495498                raise TypeError("psi must follow phi") 
    496             #if (psi >= 0 and psi != last_par) or (psi < 0 and phi != last_par): 
    497             #    raise TypeError("orientation parameters must appear at the " 
    498             #                    "end of the parameter table") 
     499            if (psi >= 0 and psi != last_par) or (psi < 0 and phi != last_par): 
     500                raise TypeError("orientation parameters must appear at the " 
     501                                "end of the parameter table") 
    499502        elif theta >= 0 or phi >= 0 or psi >= 0: 
    500503            raise TypeError("oriented shapes must have both theta and phi and maybe psi") 
Note: See TracChangeset for help on using the changeset viewer.