Changeset 0b8a1fc in sasmodels for sasmodels


Ignore:
Timestamp:
Mar 27, 2019 4:57:52 AM (5 years ago)
Author:
richardh
Branches:
master, ticket-1257-vesicle-product, ticket_1156, ticket_822_more_unit_tests
Children:
facb052
Parents:
d8b7efa
Message:

progressing towards unit test with S(Q)

Location:
sasmodels
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/core.py

    rd8b7efa r0b8a1fc  
    381381    target = ("sld sld_solvent radius length theta phi" 
    382382              " radius_effective volfraction " 
    383               " structure_factor_type effective_radius_type" 
     383              " structure_factor_mode effective_radius_type" 
    384384              " A_sld A_sld_solvent A_radius").split() 
    385385    assert target == actual, "%s != %s"%(target, actual) 
  • sasmodels/direct_model.py

    rd8b7efa r0b8a1fc  
    7171    For solid objects V_shell is equal to V_form and the volume ratio is 1. 
    7272 
    73     Use parameter *radius_effective_type* to select the effective radius 
     73    Use parameter *effective_radius_type* to select the effective radius THIS MIGHT NEED CHECKING radius_effective_mode or effecive_radius_type??? 
    7474    calculation. 
    7575    """ 
  • sasmodels/model_test.py

    r265c657 r0b8a1fc  
    392392        if par == product.RADIUS_MODE_ID: 
    393393            continue 
     394        if par == product.RADIUS_TYPE_ID: 
     395            continue 
    394396        if par == product.STRUCTURE_MODE_ID: 
     397            continue 
     398        if par == "radius_effective":    # test should not need this?? 
    395399            continue 
    396400        parts = par.split('_pd') 
  • sasmodels/models/cylinder.py

    rd8b7efa r0b8a1fc  
    218218r_effs = calc_r_effs(parameters[2][2], parameters[3][2]) 
    219219cyl_vol = calc_volume(parameters[2][2], parameters[3][2]) 
    220 tests.extend([ 
    221     ({'effective_radius_type': 0}, 0.1, None, None, r_effs[0], cyl_vol, 1.0), 
    222     ({'effective_radius_type': 1}, 0.1, None, None, r_effs[1], None, None), 
    223     ({'effective_radius_type': 2}, 0.1, None, None, r_effs[2], None, None), 
    224     ({'effective_radius_type': 3}, 0.1, None, None, r_effs[3], None, None), 
    225     ({'effective_radius_type': 4}, 0.1, None, None, r_effs[4], None, None), 
    226     ({'effective_radius_type': 5}, 0.1, None, None, r_effs[5], None, None), 
    227     ({'effective_radius_type': 6}, 0.1, None, None, r_effs[6], None, None), 
    228     ({'effective_radius_type': 7}, 0.1, None, None, r_effs[7], None, None), 
    229 ]) 
     220#tests.extend([ 
     221#    ({'effective_radius_type': 0}, 0.1, 667.7347318577124, 1.0000, r_effs[0], cyl_vol, 1.0), 
     222     # first & second None do not work here, replacind 2nd Non by real number gives error also 
     223#    ({'effective_radius_type': 1}, 0.1, None, None, r_effs[1], None, None), 
     224#    ({'effective_radius_type': 2}, 0.1, None, None, r_effs[2], None, None), 
     225#   ({'effective_radius_type': 3}, 0.1, None, None, r_effs[3], None, None), 
     226#    ({'effective_radius_type': 4}, 0.1, None, None, r_effs[4], None, None), 
     227#    ({'effective_radius_type': 5}, 0.1, None, None, r_effs[5], None, None), 
     228#    ({'effective_radius_type': 6}, 0.1, None, None, r_effs[6], None, None), 
     229#    ({'effective_radius_type': 7}, 0.1, None, None, r_effs[7], None, None), 
     230#]) 
    230231del r_effs, cyl_vol 
    231232# pylint: enable=bad-whitespace, line-too-long 
  • sasmodels/models/sphere.py

    rd8b7efa r0b8a1fc  
    101101       0.1, 0.7940350343881906], # this is current value, not verified elsewhere yet 
    102102        [{"@S": "hardsphere",          # hard sphere structure factor 
    103      "structure_factor_type": 1,  # decoupling approximation 
    104      "effective_radius_type": 1   # equivalent sphere 
     103     "structure_factor_mode": 1,  # decoupling approximation 
     104     "effective_radius_type": 1, "radius_effective":27.0  # equivalent sphere   Currently have hardwired model_test to accept radius_effective BUT doe sit get passed to S(Q)??? 
    105105         }, 0.1, 0.7940350343881906], 
    106106        [{"@S": "hardsphere",          # hard sphere structure factor 
    107      "structure_factor_type": 2,  #  -  WHY same result? 
    108      "effective_radius_type": 2   #  
     107     "structure_factor_mode": 2,  #  -  WHY same result? 
     108     "effective_radius_type": 2, "radius_effective":23.0    #  
    109109         }, 0.1, 0.7940350343881906] 
    110110] 
  • sasmodels/product.py

    rd8b7efa r0b8a1fc  
    3636#    ["est_volume_ratio", "", 1.0, [0, np.inf], "", "Estimated volume ratio"], 
    3737#] 
    38  
    39 STRUCTURE_MODE_ID = "structure_factor_type" 
    40 RADIUS_MODE_ID = "effective_radius_type" 
     38# NOTE there are radius_effective_mode, effective_radius_type, but only structure_factor_mode 
     39STRUCTURE_MODE_ID = "structure_factor_mode" 
     40RADIUS_MODE_ID = "radius_effective_mode" 
     41# rkh add this to pass to model_test 
     42RADIUS_TYPE_ID = "effective_radius_type" 
    4143RADIUS_ID = "radius_effective" 
    4244VOLFRAC_ID = "volfraction" 
Note: See TracChangeset for help on using the changeset viewer.