Changeset 1edf610 in sasmodels
- Timestamp:
- Mar 21, 2016 12:54:55 PM (9 years ago)
- 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:
- a4e2ae5, afda63c
- Parents:
- 839283a
- Location:
- sasmodels
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/compare.py
r303d8d6 r1edf610 452 452 """ 453 453 # initialize the code so time is more accurate 454 value = calculator(**suppress_pd(pars))454 #value = calculator(**suppress_pd(pars)) 455 455 toc = tic() 456 456 for _ in range(max(Nevals, 1)): # make sure there is at least one eval -
sasmodels/core.py
r0880966 r1edf610 225 225 weights = [1.0]*len(values) 226 226 else: 227 wv_pairs = [get_weights(p, pars) for p in kernel.info['parameters']]228 weights, values = [v for v in zip(*wv_pairs)]227 vw_pairs = [get_weights(p, pars) for p in kernel.info['parameters']] 228 values, weights = zip(*vw_pairs) 229 229 230 230 #TODO: This is what we thought to do if max([len(w) for w in weights]) > 1: 231 if max([w for w in weights]) > 1: 231 print("from") 232 import pprint; pprint.pprint(weights) 233 print("to") 234 if max([len(w) for w in weights]) > 1: 232 235 details = generate.poly_details(kernel.info, weights) 233 236 else: -
sasmodels/generate.py
r839283a r1edf610 684 684 685 685 def poly_details(model_info, weights): 686 print("entering poly",weights) 686 687 pars = model_info['parameters'][2:] # skip scale and background 687 688 max_pd = model_info['max_pd'] 688 689 npars = len(pars) # scale and background already removed 689 p = 5*max_pd690 constants_offset = p + 3*npars690 par_offset = 5*max_pd 691 constants_offset = par_offset + 3*npars 691 692 692 693 # Decreasing list of polydispersity lengths … … 707 708 theta_par = -1 708 709 710 print("p","max_pd","constants_offset",par_offset,max_pd,constants_offset,npars) 711 print(idx) 712 print(pd_length[idx]) 713 print(pd_offset[idx]) 714 print(pd_stride) 715 print(pd_isvol[idx]) 716 709 717 details = np.empty(constants_offset + 2, 'int32') 710 718 details[0*max_pd:1*max_pd] = idx # pd_par … … 713 721 details[3*max_pd:4*max_pd] = pd_stride 714 722 details[4*max_pd:5*max_pd] = pd_isvol[idx] 715 details[p +0*npars:p+1*npars] = par_offsets716 details[p +1*npars:p+2*npars] = 0 # no coordination for most717 details[p +2*npars:p+3*npars] = 0 # no fast coord with 0718 coord_offset = p +1*pars723 details[par_offset+0*npars:par_offset+1*npars] = par_offsets 724 details[par_offset+1*npars:par_offset+2*npars] = 0 # no coordination for most 725 details[par_offset+2*npars:par_offset+3*npars] = 0 # no fast coord with 0 726 coord_offset = par_offset+1*pars 719 727 for k,parameter_num in enumerate(idx): 720 728 details[coord_offset+parameter_num] = 2**k 721 729 details[constants_offset] = 1 # fast_coord_count: one fast index 722 730 details[constants_offset+1] = theta_par 731 print ("details",details) 723 732 return details 724 733
Note: See TracChangeset
for help on using the changeset viewer.