Changeset 688


Ignore:
Timestamp:
06/15/13 19:36:31 (3 years ago)
Author:
mmckerns
Message:

merged UQ and OUQ examples into trunk; update use of pm.coords to pm.positions

Files:
2 deleted
2 edited
44 copied
4 moved

Legend:

Unmodified
Added
Removed
  • branches/collapse/TEST_OUQ_surrogate_diam_collapse.py

    r687 r688  
    191191  c = product_measure() 
    192192  c.load(solved,npts) 
    193   print "solved: [wx,x]\n%s" % array(zip(c[0].weights,c[0].coords)) 
    194   print "solved: [wy,y]\n%s" % array(zip(c[1].weights,c[1].coords)) 
    195   print "solved: [wz,z]\n%s" % array(zip(c[2].weights,c[2].coords)) 
     193  print "solved: [wx,x]\n%s" % array(zip(c[0].weights,c[0].positions)) 
     194  print "solved: [wy,y]\n%s" % array(zip(c[1].weights,c[1].positions)) 
     195  print "solved: [wz,z]\n%s" % array(zip(c[2].weights,c[2].positions)) 
    196196 
    197197  print "expect: %s" % str( c.expect(model) ) 
  • mystic/examples_OUQ/TEST4d_OUQ_surrogate_diam.py

    r687 r688  
    241241  c = product_measure() 
    242242  c.load(solved,npts) 
    243   print "solved: [wx,x]\n%s" % array(zip(c[0].weights,c[0].coords)) 
    244   print "solved: [wy,y]\n%s" % array(zip(c[1].weights,c[1].coords)) 
    245   print "solved: [wz,z]\n%s" % array(zip(c[2].weights,c[2].coords)) 
     243  print "solved: [wx,x]\n%s" % array(zip(c[0].weights,c[0].positions)) 
     244  print "solved: [wy,y]\n%s" % array(zip(c[1].weights,c[1].positions)) 
     245  print "solved: [wz,z]\n%s" % array(zip(c[2].weights,c[2].positions)) 
    246246  
    247247  # XXX: 4D-expect 
  • mystic/examples_OUQ/TEST_OUQ_surrogate_diam.py

    r687 r688  
    193193  c = product_measure() 
    194194  c.load(solved,npts) 
    195   print "solved: [wx,x]\n%s" % array(zip(c[0].weights,c[0].coords)) 
    196   print "solved: [wy,y]\n%s" % array(zip(c[1].weights,c[1].coords)) 
    197   print "solved: [wz,z]\n%s" % array(zip(c[2].weights,c[2].coords)) 
     195  print "solved: [wx,x]\n%s" % array(zip(c[0].weights,c[0].positions)) 
     196  print "solved: [wy,y]\n%s" % array(zip(c[1].weights,c[1].positions)) 
     197  print "solved: [wz,z]\n%s" % array(zip(c[2].weights,c[2].positions)) 
    198198 
    199199  print "expect: %s" % str( c.expect(model) ) 
  • mystic/tests/test_dirac_measure.py

    r687 r688  
    2727  coordinates = samplepts(lower_bounds, upper_bounds, npts) 
    2828  D = [i[0] for i in coordinates] 
    29   print "coords: %s" % D 
     29  print "positions: %s" % D 
    3030 
    3131  # calculate sample range 
     
    5151  # ------------------------------------- 
    5252  # get new random distribution 
    53   print "modify coords, maintaining mean and range" 
     53  print "modify positions, maintaining mean and range" 
    5454  coordinates = samplepts(lower_bounds, upper_bounds, npts) 
    5555  D = [i[0] for i in coordinates] 
     
    6060 
    6161  # print results 
    62   print "coords: %s" % D 
     62  print "positions: %s" % D 
    6363  R = spread(D) 
    6464  print "range: %s" % R 
     
    8888  w = norm(weights) 
    8989  print "norm: %s" % w 
    90   print "coords: %s" % DD 
     90  print "positions: %s" % DD 
    9191  R = spread(DD) 
    9292  print "range: %s" % R 
     
    188188  # build a collection 
    189189  c = collection([sx,sy,sz]) 
    190   print "x_coords: %s" % c[0].coords 
    191   print "y_coords: %s" % c[1].coords 
    192   print "z_coords: %s" % c[2].coords 
     190  print "x_positions: %s" % c[0].positions 
     191  print "y_positions: %s" % c[1].positions 
     192  print "z_positions: %s" % c[2].positions 
    193193  print "x_weights: %s" % c[0].weights 
    194194  print "y_weights: %s" % c[1].weights 
     
    198198  print "npts: %s (i.e. %s)" % (c.npts, c.pts) 
    199199  print "weights: %s" % c.weights 
    200   coords = c.coords 
    201   print "coords: %s" % coords 
     200  positions = c.positions 
     201  print "positions: %s" % positions 
    202202 
    203203  print "mass: %s" % c.mass 
     
    207207 #print "delta: %s" % c.delta 
    208208 
    209   # change the coords in the collection 
    210   coords[::3] 
    211   points = [ list(i) for i in coords[::3] ] 
     209  # change the positions in the collection 
     210  positions[::3] 
     211  points = [ list(i) for i in positions[::3] ] 
    212212  for i in range(len(points)): 
    213213    points[i][0] = 0.5 
    214214 
    215   coords[::3] = points 
    216   c.coords = coords 
    217   print "x_coords: %s" % c[0].coords 
    218   print "y_coords: %s" % c[1].coords 
    219   print "z_coords: %s" % c[2].coords 
     215  positions[::3] = points 
     216  c.positions = positions 
     217  print "x_positions: %s" % c[0].positions 
     218  print "y_positions: %s" % c[1].positions 
     219  print "z_positions: %s" % c[2].positions 
    220220  print "expect: %s" % c.expect(f) 
    221221 
     
    252252  assert c.npts == d.npts 
    253253  assert c.weights == d.weights 
    254   assert c.coords == d.coords 
     254  assert c.positions == d.positions 
    255255 
    256256  # flatten() and load(...) 
     
    261261  assert c.npts == e.npts 
    262262  assert c.weights == e.weights 
    263   assert c.coords == e.coords 
     263  assert c.positions == e.positions 
    264264 
    265265  # decompose and compose 
     
    270270  assert c.npts == b.npts 
    271271  assert c.weights == b.weights 
    272   assert c.coords == b.coords 
     272  assert c.positions == b.positions 
    273273  return 
    274274 
Note: See TracChangeset for help on using the changeset viewer.