Changeset 5024a56 in sasmodels


Ignore:
Timestamp:
Oct 30, 2018 6:37:19 PM (13 days ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
beta_approx, py3, ticket-1015-gpu-mem-error, ticket-1157, ticket-608-user-defined-weights, ticket_1156
Children:
99658f6
Parents:
23df833
Message:

Make sure that the label radius_effective_mode is used throughout

Location:
sasmodels
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/direct_model.py

    r23df833 r5024a56  
    3232from .details import make_kernel_args, dispersion_mesh 
    3333from .modelinfo import DEFAULT_BACKGROUND 
     34from .product import RADIUS_MODE_ID 
    3435 
    3536# pylint: disable=unused-import 
     
    7071 
    7172    For solid objects V_shell is equal to V_form and the volume ratio is 1. 
    72     """ 
    73     R_eff_type = int(pars.pop('radius_effective_type', 1.0)) 
     73 
     74    Use parameter *radius_effective_mode* to select the effective radius 
     75    calculation. 
     76    """ 
     77    R_eff_type = int(pars.pop(RADIUS_MODE_ID, 1.0)) 
    7478    mesh = get_mesh(calculator.info, pars, dim=calculator.dim, mono=mono) 
    7579    #print("pars", list(zip(*mesh))[0]) 
  • sasmodels/model_test.py

    raa8c6e0 r5024a56  
    386386    for par in sorted(pars.keys()): 
    387387        # special handling of R_eff mode, which is not a usual parameter 
    388         if par == 'radius_effective_type': 
     388        if par == product.RADIUS_MODE_ID: 
    389389            continue 
    390390        parts = par.split('_pd') 
  • sasmodels/models/cylinder.py

    r304c775 r5024a56  
    185185radius, length = parameters[2][2], parameters[3][2] 
    186186tests.extend([ 
    187     ({'radius_effective_type': 0}, 0.1, None, None, 0., pi*radius**2*length, 1.0), 
    188     ({'radius_effective_type': 1}, 0.1, None, None, (0.75*radius**2*length)**(1./3.), None, None), 
    189     ({'radius_effective_type': 2}, 0.1, None, None, radius, None, None), 
    190     ({'radius_effective_type': 3}, 0.1, None, None, length/2., None, None), 
    191     ({'radius_effective_type': 4}, 0.1, None, None, min(radius, length/2.), None, None), 
    192     ({'radius_effective_type': 5}, 0.1, None, None, max(radius, length/2.), None, None), 
    193     ({'radius_effective_type': 6}, 0.1, None, None, np.sqrt(4*radius**2 + length**2)/2., None, None), 
     187    ({'radius_effective_mode': 0}, 0.1, None, None, 0., pi*radius**2*length, 1.0), 
     188    ({'radius_effective_mode': 1}, 0.1, None, None, (0.75*radius**2*length)**(1./3.), None, None), 
     189    ({'radius_effective_mode': 2}, 0.1, None, None, radius, None, None), 
     190    ({'radius_effective_mode': 3}, 0.1, None, None, length/2., None, None), 
     191    ({'radius_effective_mode': 4}, 0.1, None, None, min(radius, length/2.), None, None), 
     192    ({'radius_effective_mode': 5}, 0.1, None, None, max(radius, length/2.), None, None), 
     193    ({'radius_effective_mode': 6}, 0.1, None, None, np.sqrt(4*radius**2 + length**2)/2., None, None), 
    194194]) 
    195195del radius, length 
  • sasmodels/product.py

    r39a06c9 r5024a56  
    3737#] 
    3838 
     39STRUCTURE_MODE_ID = "structure_factor_mode" 
     40RADIUS_MODE_ID = "radius_effective_mode" 
    3941RADIUS_ID = "radius_effective" 
    4042VOLFRAC_ID = "volfraction" 
     
    4345    if p_info.have_Fq: 
    4446        par = parse_parameter( 
    45                 "structure_factor_mode", 
     47                STRUCTURE_MODE_ID, 
    4648                "", 
    4749                0, 
     
    5254    if p_info.effective_radius_type is not None: 
    5355        par = parse_parameter( 
    54                 "radius_effective_mode", 
     56                RADIUS_MODE_ID, 
    5557                "", 
    5658                0, 
  • sasmodels/sasview_model.py

    raa8c6e0 r5024a56  
    859859    P = _make_standard_model('cylinder')() 
    860860    model = MultiplicationModel(P, S) 
    861     model.setParam('radius_effective_mode', 1.0) 
     861    model.setParam(product.RADIUS_MODE_ID, 1.0) 
    862862    value = model.evalDistribution([0.1, 0.1]) 
    863863    if np.isnan(value): 
Note: See TracChangeset for help on using the changeset viewer.