Changeset 058460c in sasmodels


Ignore:
Timestamp:
Sep 14, 2017 11:34:36 AM (7 years ago)
Author:
lewis
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
c11d09f, b866abf, 3a45c2c
Parents:
dd4f5ed
Message:

Better error message for invalid P(Q)*S(Q) models

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/product.py

    r0edb6c1 r058460c  
    4545    # structure factor calculator.  Structure factors should not 
    4646    # have any magnetic parameters 
     47    if not len(s_info.parameters.kernel_parameters) >= 2: 
     48        raise TypeError("S needs {} and {} as its first parameters".format(ER_ID, VF_ID)) 
    4749    if not s_info.parameters.kernel_parameters[0].id == ER_ID: 
    48         raise TypeError("S needs %s as first parameter"%ER_ID) 
     50        raise TypeError("S needs {} as first parameter".format(ER_ID)) 
    4951    if not s_info.parameters.kernel_parameters[1].id == VF_ID: 
    50         raise TypeError("S needs %s as second parameter"%VF_ID) 
     52        raise TypeError("S needs {} as second parameter".format(VF_ID)) 
    5153    if not s_info.parameters.magnetism_index == []: 
    5254        raise TypeError("S should not have SLD parameters") 
Note: See TracChangeset for help on using the changeset viewer.