Changeset 8f04da4 in sasmodels for sasmodels/models/pringle.py


Ignore:
Timestamp:
Aug 2, 2017 2:53:56 AM (7 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
bd21b12
Parents:
1511c37c
Message:

tuned random model generation for more models

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/pringle.py

    r30fbe2e r8f04da4  
    8585    return 0.5 * (ddd) ** (1. / 3.) 
    8686 
    87 demo = dict(background=0.0, 
    88             scale=1.0, 
    89             radius=60.0, 
    90             thickness=10.0, 
    91             alpha=0.001, 
    92             beta=0.02, 
    93             sld=1.0, 
    94             sld_solvent=6.35) 
     87def random(): 
     88    import numpy as np 
     89    alpha, beta = 10**np.random.uniform(-1, 1, size=2) 
     90    radius = 10**np.random.uniform(1, 3) 
     91    thickness = 10**np.random.uniform(0.7, 2) 
     92    pars = dict( 
     93        radius=radius, 
     94        thickness=thickness, 
     95        alpha=alpha, 
     96        beta=beta, 
     97    ) 
     98    return pars 
    9599 
    96100tests = [ 
Note: See TracChangeset for help on using the changeset viewer.