Changeset 95498a3 in sasmodels


Ignore:
Timestamp:
Jan 26, 2018 7:05:04 PM (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:
ecf895e
Parents:
49284e1
Message:

allow composite models whose parts are oriented

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.