Changeset 0880966 in sasmodels for sasmodels/generate.py


Ignore:
Timestamp:
Mar 21, 2016 12:34:51 PM (8 years ago)
Author:
wojciech
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
839283a
Parents:
9f4409a
Message:

Mono and poly reading fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/generate.py

    ra6f9577 r0880966  
    693693    # Note: the reversing view, x[::-1], does not require a copy 
    694694    pd_length = np.array([len(w) for w in weights]) 
     695    print (pd_length) 
    695696    pd_offset = np.cumsum(np.hstack((0, pd_length))) 
    696697    pd_isvol = np.array([p.type=='volume' for p in pars]) 
    697698    idx = np.argsort(pd_length)[::-1][:max_pd] 
    698     pd_stride = np.cumprod(np.hstack((1, np.maximum(pd_length[idx][:-1],1)))) 
    699     par_offsets = np.cumsum(np.hstack((2, np.maximum(pd_length, 1))))[:-1] 
    700     theta_par = model_info['theta_par'] 
    701     if theta_par >= 0 and pd_length[theta_par] <= 1: 
    702         theta_par = -1 
     699    print (idx) 
     700    pd_stride = np.cumprod(np.hstack((1, pd_length[idx][:-1]))) 
     701    par_offsets = np.cumsum(np.hstack((2, pd_length)))[:-1] 
     702 
     703    theta_par = -1 
     704    if 'theta_par' in model_info: 
     705        theta_par = model_info['theta_par'] 
     706        if theta_par >= 0 and pd_length[theta_par] <= 1: 
     707            theta_par = -1 
    703708 
    704709    details = np.empty(constants_offset + 3, 'int32') 
Note: See TracChangeset for help on using the changeset viewer.