Changeset 7eb2a4d in sasmodels


Ignore:
Timestamp:
Mar 29, 2019 4:52:05 PM (6 months ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
ticket-1257-vesicle-product
Children:
eeb772e
Parents:
93cac17
Message:

simplify logic for orientation parameter checks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/modelinfo.py

    r98c045a r7eb2a4d  
    531531                if p.type != 'orientation': 
    532532                    raise TypeError("psi must be an orientation parameter") 
    533             elif p.type == 'orientation' and strict: 
     533            elif strict and p.type == 'orientation': 
    534534                raise TypeError("only theta, phi and psi can be orientation parameters") 
    535535        if theta >= 0 and phi >= 0: 
     
    540540                raise TypeError("psi must follow phi") 
    541541            # TODO: Why must theta/phi/psi be at the end?  Consistency only? 
    542             if (psi >= 0 and psi != last_par) or (psi < 0 and phi != last_par): 
    543                 if strict: 
    544                     raise TypeError("orientation parameters must appear at the " 
    545                                     "end of the parameter table") 
     542            if strict and phi != last_par and psi != last_par: 
     543                raise TypeError("orientation parameters must appear at the " 
     544                                "end of the parameter table") 
    546545        elif theta >= 0 or phi >= 0 or psi >= 0: 
    547546            raise TypeError("oriented shapes must have both theta and phi and maybe psi") 
Note: See TracChangeset for help on using the changeset viewer.