Skip to content

Commit

Permalink
added atleast2d check to apply_array_pars
Browse files Browse the repository at this point in the history
  • Loading branch information
jtwhite79 committed Sep 23, 2018
1 parent 00ba01b commit c9ef68d
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 407 deletions.
Binary file modified autotest/moouu/.DS_Store
Binary file not shown.
14 changes: 7 additions & 7 deletions autotest/moouu/10par_xsec/10par_xsec.pfm
@@ -1,13 +1,13 @@
PEST++ performance logger started at: 2018-09-19 12:44:10
( time = 2018-09-19 12:44:10, elapsed time = 937us )
PEST++ performance logger started at: 2018-09-19 13:16:19
( time = 2018-09-19 13:16:19, elapsed time = 867us )
starting to process control file
( time = 2018-09-19 12:44:10, elapsed time = 1ms )
( time = 2018-09-19 13:16:19, elapsed time = 1ms )
finished processing control file
( time = 2018-09-19 12:44:10, elapsed time = 3ms )
( time = 2018-09-19 13:16:19, elapsed time = 4ms )
starting to read parameter csv file
( time = 2018-09-19 12:44:10, elapsed time = 1ms )
( time = 2018-09-19 13:16:19, elapsed time = 276us )
finished reading parameter csv file
( time = 2018-09-19 12:44:23, elapsed time = 13sec )
( time = 2018-09-19 13:16:27, elapsed time = 7sec )
starting to read parameter csv file
( time = 2018-09-19 12:44:23, elapsed time = 132us )
( time = 2018-09-19 13:16:27, elapsed time = 59us )
finished reading parameter csv file
329 changes: 37 additions & 292 deletions autotest/moouu/10par_xsec/10par_xsec.rmr

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions autotest/moouu/10par_xsec/_master_stdout.dat

Large diffs are not rendered by default.

110 changes: 10 additions & 100 deletions autotest/moouu/10par_xsec/sweep_in.csv
@@ -1,101 +1,11 @@
,stage,k_01,k_02,k_03,k_04,k_05,k_06,k_07,k_08,k_09,k_10
0,0.47324433444513136,8.6233453810068,1.0,1.4065100979456648,1.0,1.0,1.0,5.0,1.9657256148192417,1.0631472670209687,4.755448229702541
1,0.47324433444513136,8.6233453810068,2.150648645138766,4.965420405034154,4.687994301689912,5.0,1.0,4.788409833697976,4.030854155532792,1.0,3.54229364908962
2,0.47324433444513136,8.6233453810068,3.9355327034998444,1.3138575641007115,5.0,5.0,1.860448465034727,3.767342807340987,4.281456941664872,4.633550073167827,2.1498209622021336
3,0.47324433444513136,8.6233453810068,5.0,3.223754311487806,4.121936999631914,1.0,2.9418875706926024,5.0,1.0,2.1354635017947783,1.0
4,0.47324433444513136,8.6233453810068,2.0800822918404345,4.103663550652312,1.0,1.0,1.0,1.902473322372223,1.0,1.0,1.0
5,0.47324433444513136,8.6233453810068,2.741961289511398,1.0,1.0,1.0,1.0,1.7437444648290388,5.0,3.375150937927518,1.8911470970659607
6,0.47324433444513136,8.6233453810068,1.0,1.0,1.0,1.0,1.0,5.0,1.707814491369131,1.0,1.0
7,0.47324433444513136,8.6233453810068,1.379809889209455,1.6104618483986228,4.2,1.0,1.0,1.0,1.9652241800120813,1.0,1.0
8,0.47324433444513136,8.6233453810068,5.0,5.0,2.4734488572085795,1.0,1.0,4.705080511819554,1.0,1.0,2.9083433492274207
9,0.47324433444513136,8.6233453810068,5.0,4.051037110409451,1.0,1.0,1.0,1.5472572573713588,2.0737821388532423,1.4135667336570734,3.205125617347842
10,0.47324433444513136,8.6233453810068,3.3533916890250537,1.0,1.0,1.0,1.0,1.1049864849885445,4.520251344715538,1.4633779217291265,5.0
11,0.47324433444513136,8.6233453810068,1.0,1.0,1.0,1.0,1.2134049950987795,5.0,5.0,1.0,1.0
12,0.47324433444513136,8.6233453810068,1.0,1.0,5.0,2.430486262211751,3.7236580222368585,5.0,1.7680211579556215,2.7056531997329634,1.0
13,0.47324433444513136,8.6233453810068,5.0,5.0,5.0,1.7999999999999998,1.123210027247331,1.1332630319302375,1.7619436301652698,3.8230460502993697,1.2936044275177436
14,0.47324433444513136,8.6233453810068,1.0,2.6657333660584976,2.0756788302153386,1.0,1.0,2.2418055578095446,4.030854155532792,1.0,2.1387181254990786
15,0.47324433444513136,8.6233453810068,1.375258534762157,5.0,4.110099770312852,4.2,1.0,1.0,3.0299032149929213,4.322384641067012,3.051861455502051
16,0.47324433444513136,8.6233453810068,1.0,1.0,1.0,1.0,1.0,5.0,3.706622494996769,3.956299752378401,5.0
17,0.47324433444513136,8.6233453810068,4.273187244929457,3.229347534588796,3.161708552063285,1.0,1.0,1.0,2.954873741811576,1.0,1.919856769761707
18,0.47324433444513136,8.6233453810068,2.0800822918404345,4.103663550652312,1.0,1.0,1.781770451544256,4.509789170289943,1.0,2.7800293827240434,5.0
19,0.47324433444513136,8.6233453810068,3.0321468829441534,5.0,1.9693689713003977,1.0,1.2052424812381206,1.081346196906316,4.7018974519083745,4.1368924326246415,2.121110138935041
20,0.47324433444513136,8.6233453810068,4.31098844570887,2.3102315672398364,1.0,1.0,1.0,4.109675213734244,5.0,1.0,5.0
21,0.47324433444513136,8.6233453810068,1.9287936321863464,1.1762507297680458,1.0,1.0,2.10360299203238,5.0,2.004806440538676,5.0,5.0
22,0.47324433444513136,8.6233453810068,5.0,4.116064720517835,4.047435442749599,1.0,1.0,3.603820388417256,1.707814491369131,1.0,1.0
23,0.47324433444513136,8.6233453810068,4.2,1.0,1.0,1.0,1.0,3.016398825716166,5.0,2.674739415991155,5.0
24,0.47324433444513136,8.6233453810068,4.394809475516995,5.0,1.0,1.0,1.0,1.889226879312675,2.256008050673345,3.788448028299624,5.0
25,0.47324433444513136,8.6233453810068,2.8897271909101137,3.4713225979389932,1.002169930422907,1.0,1.0,5.0,4.520251344715538,3.439651348139033,1.0
26,0.47324433444513136,8.6233453810068,4.351641569891222,5.0,1.2626497575742115,1.0,1.0,5.0,3.527859132102438,1.0,1.0
27,0.47324433444513136,8.6233453810068,1.0,1.0,1.0,1.0,1.0,3.231379105707869,4.5671614293972755,1.0,1.0
28,0.47324433444513136,8.6233453810068,3.0006012079514472,1.2818427306443922,1.0,4.2,1.0,1.0,5.0,2.239175600796769,5.0
29,0.47324433444513136,8.6233453810068,1.0,1.0,1.0,1.0,1.0,5.0,3.2646168423376953,2.0043236855479476,5.0
30,0.47324433444513136,8.6233453810068,1.8284796757301987,3.988193387834534,1.0,1.0235799313501637,1.0,5.0,4.520251344715538,1.412382262923201,5.0
31,0.47324433444513136,8.6233453810068,1.0,1.0,1.0,2.6161442168587823,2.8433195488947374,4.89338957445581,5.0,2.3679229807724207,1.0
32,0.47324433444513136,8.6233453810068,5.0,3.522832800893445,1.0,1.0,1.0,4.950936057030364,1.1512990027393328,2.3038696498587186,5.0
33,0.47324433444513136,8.6233453810068,4.620190110790545,1.0,1.0,1.0393823040017525,1.0,4.779089618508823,1.0211692114271833,2.521349924538519,1.0
34,0.47324433444513136,8.6233453810068,2.7271174617081635,1.339346386744139,1.1907056965630018,1.0,1.0,5.0,3.6423330721826623,1.0,2.547959682647752
35,0.47324433444513136,8.6233453810068,1.0,2.5874370707485324,1.0,1.0,1.0,5.0,1.0,1.0,5.0
36,0.47324433444513136,8.6233453810068,1.0,4.972959098485969,1.0,1.0,1.0,5.0,5.0,1.6482367122112165,2.2470364031631895
37,0.47324433444513136,8.6233453810068,5.0,1.0,1.0,1.0,1.0,2.4232245316067167,1.0294636930093697,1.0,4.523660967032204
38,0.47324433444513136,8.6233453810068,5.0,1.3487508947187137,1.0,1.0,1.0,3.7468249544349326,4.5671614293972755,5.0,5.0
39,0.47324433444513136,8.6233453810068,3.596976577157145,1.791458916041095,1.0,1.0,1.0,1.0,2.4164924307189017,1.0,5.0
40,0.47324433444513136,8.6233453810068,2.460424694533594,3.7735122842467663,3.2742306009105713,1.0,1.6911347916509794,2.560956976656335,2.82225964376865,3.034096483693773,5.0
41,0.47324433444513136,8.6233453810068,5.0,1.0,1.0,1.0,1.0,1.6635361062137388,3.8804869513362505,2.715380461796903,1.0389762299511642
42,0.47324433444513136,8.6233453810068,4.2,1.1965182838874269,1.0,1.0,1.0,4.567944689695332,4.654085126779403,3.4533085507867516,5.0
43,0.47324433444513136,8.6233453810068,3.877581261725716,1.0,1.0,1.1339268874210204,1.0,1.7999999999999998,5.0,3.647993494467344,5.0
44,0.47324433444513136,8.6233453810068,2.0643529654083657,4.841918217388943,4.892507056342605,5.0,1.0,5.0,2.8050544892268943,4.843107231645421,1.0
45,0.47324433444513136,8.6233453810068,1.0,1.3444797690118562,1.0,1.0,1.0,4.238319916875293,5.0,1.0,5.0
46,0.47324433444513136,8.6233453810068,1.0,1.0,1.1907056965630018,2.292915373487026,1.8372614357174328,5.0,5.0,1.0631472670209687,5.0
47,0.47324433444513136,8.6233453810068,1.2761497526302406,2.6657333660584976,1.0,1.0,1.0,4.916222346508221,4.030854155532792,1.0,2.362648734538508
48,0.47324433444513136,8.6233453810068,1.7605050540408014,3.5524684108504303,5.0,5.0,1.0,3.3751569155476657,1.0,1.0,5.0
49,0.47324433444513136,8.6233453810068,5.0,1.0,1.0,1.0,1.0,5.0,4.281456941664872,1.0,2.3337575655461658
50,0.47324433444513136,8.6233453810068,5.0,5.0,1.119015598922876,1.0235799313501637,1.0,1.0,2.849976324403751,3.6180273069600157,5.0
51,0.47324433444513136,8.6233453810068,2.448206359818164,1.0,1.0,1.0,1.0,1.0,4.281456941664872,2.311776896842667,5.0
52,0.47324433444513136,8.6233453810068,5.0,5.0,1.693049538948332,3.569513737788249,1.0,1.0,1.0,1.0,1.1140684285236104
53,0.47324433444513136,8.6233453810068,1.5212854423806048,2.6657333660584976,1.0,1.0,1.0,5.0,5.0,3.9877416908956462,5.0
54,0.47324433444513136,8.6233453810068,5.0,2.8809773822302827,3.252191660848256,1.0,1.0,5.0,1.6928795298300692,1.0,1.0
55,0.47324433444513136,8.6233453810068,1.0,1.0,1.0,1.0,1.0,4.038002247105591,2.954873741811576,4.3724462588333814,2.8498383256504494
56,0.47324433444513136,8.6233453810068,5.0,2.8057636414152944,1.0027124130286338,1.0393823040017525,1.0,4.913644295582474,2.0784340787334017,1.0,1.4800112108182297
57,0.47324433444513136,8.6233453810068,3.5600000000000005,1.0,1.316160662859041,1.0,1.0,1.0,5.0,2.4904860539002867,5.0
58,0.47324433444513136,8.6233453810068,1.0,1.5305895825522033,5.0,2.4032142812086223,3.61251523362078,3.603820388417256,2.694626207639536,1.046727808999596,3.614570813465724
59,0.47324433444513136,8.6233453810068,1.0,4.772797526828357,3.0813050613130204,1.0,1.0,5.0,3.3638989934492605,1.6442832993612098,4.1523084224641496
60,0.47324433444513136,8.6233453810068,1.0,2.8645401996590647,1.0,1.0,1.0140817598074947,1.0604411778521983,4.9449576865580696,2.969590692653184,1.0
61,0.47324433444513136,8.6233453810068,2.4047822397504124,3.4713225979389932,1.0,1.0,1.0,3.8163552655046846,5.0,2.251955231467239,4.3260242848451504
62,0.47324433444513136,8.6233453810068,2.9876578242934504,1.0,1.0,1.0,1.0,4.535182519765949,3.023623052319815,1.0,4.479388407393054
63,0.47324433444513136,8.6233453810068,1.7999999999999998,1.0,1.0,1.0,1.0,2.9075955499453636,3.7729807818637013,1.3015631597605044,5.0
64,0.47324433444513136,8.6233453810068,4.54743547485502,3.1790456917299927,1.0,1.0,1.0,2.7658997581582847,5.0,2.328398349682794,1.1885540706762632
65,0.47324433444513136,8.6233453810068,5.0,1.0,1.1525645572504015,1.0,1.0176021997593683,5.0,5.0,1.0,2.9312543733590193
66,0.47324433444513136,8.6233453810068,4.31098844570887,4.333843411833141,1.0,1.0,1.1641939849904965,2.224468815493693,5.0,2.0058970638884697,1.0
67,0.47324433444513136,8.6233453810068,1.0,2.695218094215774,1.0311680963963838,1.0,1.0,4.2752249745018505,2.82225964376865,5.0,3.0916566507725793
68,0.47324433444513136,8.6233453810068,2.652213973401066,2.436251330682131,1.0027124130286338,1.0,1.0,1.7777384385590893,5.0,4.049564185173791,5.0
69,0.47324433444513136,8.6233453810068,5.0,3.4713225979389932,2.8418110715107243,1.0,1.0,1.0,4.206042244513524,1.0,1.97964253073667
70,0.47324433444513136,8.6233453810068,1.0,1.0,1.0,2.6161442168587823,1.0,1.0,2.1197917609714336,1.0,5.0
71,0.47324433444513136,8.6233453810068,1.0,4.051037110409451,1.0,1.0,1.781770451544256,3.670655728055898,4.191177216536987,2.3888784652703414,5.0
72,0.47324433444513136,8.6233453810068,1.0,1.9409562124565014,1.0027124130286338,1.0,1.0,5.0,2.325057785254214,1.4907346208511498,2.460463310604153
73,0.47324433444513136,8.6233453810068,1.0,2.37081119984264,2.6979551174542227,2.6161442168587823,2.046576794646791,3.2033355951829865,4.762033280852083,2.9923888431202292,4.099631990255867
74,0.47324433444513136,8.6233453810068,2.460424694533594,2.419634279006289,1.0311680963963838,1.0,1.0,1.0,4.607238624747483,2.1923888431202294,4.640666058511737
75,0.47324433444513136,8.6233453810068,2.103847911367564,1.5029030320455121,4.11309831192845,5.0,4.227503437124013,1.7999999999999998,1.0,1.4722819850845752,5.0
76,0.47324433444513136,8.6233453810068,5.0,3.3745315503743023,1.0,3.0576847771613838,1.0,4.401410246940798,5.0,5.0,5.0
77,0.47324433444513136,8.6233453810068,2.5347396186511437,1.0,2.958464279194575,1.0,1.0,3.9789602853189514,1.8956104389309996,1.0,1.0
78,0.47324433444513136,8.6233453810068,5.0,4.2556829142339225,3.6416359060366217,1.0,1.0,1.0,4.890748443041197,1.7898456141121393,1.9890119401656505
79,0.47324433444513136,8.6233453810068,1.4201901107905448,1.0,2.1054355636761457,1.0,1.8372614357174328,4.2,5.0,1.0,5.0
80,0.47324433444513136,8.6233453810068,1.6890115542911304,1.0,1.0,1.0,1.0,1.0,5.0,3.6180735607098526,1.0
81,0.47324433444513136,8.6233453810068,4.168404043232641,5.0,4.110099770312852,4.2,1.6883587720277817,3.6164946921470955,1.0,3.697282900056668,1.582279329574308
82,0.47324433444513136,8.6233453810068,5.0,1.9631882653272044,1.1907056965630018,2.646147821729107,4.365982510133824,3.328424476296207,1.3975146003352439,2.2537889328892606,1.0
83,0.47324433444513136,8.6233453810068,2.48901155429113,4.0891532474237415,1.0,5.0,1.0,2.9621169267469836,5.0,3.365039801902721,5.0
84,0.47324433444513136,8.6233453810068,1.0,1.0,1.0,1.0,1.0,4.844434697827053,5.0,1.2305123874403543,5.0
85,0.47324433444513136,8.6233453810068,5.0,5.0,3.2255569209899964,1.0,1.0,3.201552379514909,5.0,3.893442224053297,1.7018040596402075
86,0.47324433444513136,8.6233453810068,3.136336339443723,3.4713225979389932,2.8418110715107243,1.0,1.0,1.0,5.0,1.4716274577887614,5.0
87,0.47324433444513136,8.6233453810068,2.48901155429113,2.0755838152094848,2.6315372609161294,1.0393823040017525,1.0,5.0,1.0,2.2853586526730214,1.4051164579858053
88,0.47324433444513136,8.6233453810068,2.12647596686361,1.0,1.0,1.0,1.0,5.0,2.6203591127932215,1.7127371224227312,2.3337575655461658
89,0.47324433444513136,8.6233453810068,4.281705753811465,5.0,4.2,1.1339268874210204,4.227503437124013,2.415547774357347,3.683795223933223,1.0806255127643936,5.0
90,0.47324433444513136,8.6233453810068,1.1768444414639372,1.0,1.0,1.0,2.7230959884993657,5.0,4.72844937205317,3.816966141063634,2.004877141844119
91,0.47324433444513136,8.6233453810068,2.6640658334723475,1.4172536859554397,5.0,2.6161442168587823,1.0,2.183601174283835,1.6188910589327679,1.3307458506840026,1.0
92,0.47324433444513136,8.6233453810068,2.1337252537536977,5.0,1.0,1.0,1.0,2.4242625756003413,3.1695640998705485,3.956299752378401,1.6251792525987625
93,0.47324433444513136,8.6233453810068,4.971413140242464,2.695218094215774,1.0311680963963838,1.0,1.0,3.7897907368126322,1.7619436301652698,1.0,2.8812085437797297
94,0.47324433444513136,8.6233453810068,3.576730449659401,5.0,4.333704897694776,5.0,1.0,3.5881368225533583,5.0,1.2619464480969924,5.0
95,0.47324433444513136,8.6233453810068,1.0,1.0,3.0427118056504616,1.0,1.2134049950987795,5.0,1.0,2.355061543019932,3.4498523391732365
96,0.47324433444513136,8.6233453810068,1.0,2.9686807270275013,4.121936999631914,1.0,1.0,5.0,1.0,1.0,1.8533958336847376
97,0.47324433444513136,8.6233453810068,1.0,1.536389115825679,1.0,1.1339268874210204,1.0,1.0,5.0,3.2250367284050543,5.0
98,0.47324433444513136,8.6233453810068,4.600970736685166,1.220467052167588,1.0,1.0,1.0,2.6058305060212668,2.694626207639536,1.1951524514006178,4.122744925449741
99,0.47324433444513136,8.6233453810068,3.509069071554978,1.643714005949212,2.6979551174542227,2.6161442168587823,2.918316300196474,5.0,2.2991278716185466,1.8270289426903292,2.2781707284368427
0,0.47324433444513136,8.6233453810068,4.6106645876156795,4.467535370256737,2.040134229466589,1.0206585562830972,1.0,1.0,5.0,5.0,4.101684160372285
1,0.47324433444513136,8.6233453810068,5.0,5.0,4.595807905259216,1.040348742740424,1.0,4.151466231965229,5.0,5.0,3.159188853221896
2,0.47324433444513136,8.6233453810068,4.6106645876156795,3.5600000000000005,2.040134229466589,1.0206585562830972,1.0138233121192628,1.0,2.566461769008084,5.0,4.101684160372285
3,0.47324433444513136,8.6233453810068,4.6106645876156795,1.7999999999999998,1.0,1.0,1.0138233121192628,1.0,5.0,5.0,4.101684160372285
4,0.47324433444513136,8.6233453810068,4.102911131655528,4.327903935895394,1.0,1.0,1.0052920484103565,2.033629894107391,5.0,5.0,5.0
5,0.47324433444513136,8.6233453810068,2.5176710946755776,1.8561131848215584,1.0,1.0,1.0,2.477766767365413,4.328281250581224,5.0,4.171634983949853
6,0.47324433444513136,8.6233453810068,4.345510091870168,1.0,1.0,1.0,1.010664079636133,1.0,1.931565274782984,5.0,5.0
7,0.47324433444513136,8.6233453810068,4.734845504254489,2.059717037946105,2.040134229466589,1.0,1.0,1.0,2.4868367772319857,5.0,4.101684160372285
8,0.47324433444513136,8.6233453810068,5.0,1.0,1.0,1.0,1.0138233121192628,1.0,4.328281250581224,5.0,5.0
9,0.47324433444513136,8.6233453810068,1.0,4.646340269433267,1.0,1.0,1.0,2.822470272354428,3.6878739526405058,5.0,5.0
6 changes: 3 additions & 3 deletions autotest/moouu_tests.py
Expand Up @@ -161,11 +161,11 @@ def tenpar_dev():


dv = pyemu.ParameterEnsemble.from_mixed_draws(pst=pst, how_dict={p: "uniform" for p in dv_names},
num_reals=100,
num_reals=10,
partial=True)

dv.index = ["p_{0}".format(i) for i in range(dv.shape[0])]
ea = EliteDiffEvol(pst, num_slaves=30, port=4005, verbose=True)
ea = EliteDiffEvol(pst, num_slaves=5, port=4005, verbose=True)

ea.initialize(obj_dict,par_ensemble=pe,dv_ensemble=dv,risk=0.5)

Expand All @@ -183,7 +183,7 @@ def tenpar_dev():
axes[1, 0].set_xlim(0, 4)
axes[1, 0].set_ylim(0, 4)

plt.show()
#plt.show()
plt.savefig("iter_{0:03d}.png".format(0))
plt.close("all")
for i in range(30):
Expand Down
2 changes: 1 addition & 1 deletion pyemu/utils/helpers.py
Expand Up @@ -3279,7 +3279,7 @@ def apply_array_pars(arr_par_file="arr_pars.csv"):
lb = list(lb_vals.keys())[0]
org_arr[org_arr < lb] = lb

np.savetxt(model_file,org_arr,fmt="%15.6E",delimiter='')
np.savetxt(model_file,np.atleast_2d(org_arr),fmt="%15.6E",delimiter='')

def apply_list_pars():
""" a function to apply boundary condition multiplier parameters. Used to implement
Expand Down

0 comments on commit c9ef68d

Please sign in to comment.