{"action":"created","issue":{"url":"https://api.github.com/repos/brinckmann/montepython_public/issues/35","repository_url":"https://api.github.com/repos/brinckmann/montepython_public","labels_url":"https://api.github.com/repos/brinckmann/montepython_public/issues/35/labels{/name}","comments_url":"https://api.github.com/repos/brinckmann/montepython_public/issues/35/comments","events_url":"https://api.github.com/repos/brinckmann/montepython_public/issues/35/events","html_url":"https://github.com/brinckmann/montepython_public/issues/35","id":396261178,"node_id":"MDU6SXNzdWUzOTYyNjExNzg=","number":35,"title":"Error in analyzing the output of CosmoHammer","user":{"login":"cosmosapjw","id":43878740,"node_id":"MDQ6VXNlcjQzODc4NzQw","avatar_url":"https://avatars2.githubusercontent.com/u/43878740?v=4","gravatar_id":"","url":"https://api.github.com/users/cosmosapjw","html_url":"https://github.com/cosmosapjw","followers_url":"https://api.github.com/users/cosmosapjw/followers","following_url":"https://api.github.com/users/cosmosapjw/following{/other_user}","gists_url":"https://api.github.com/users/cosmosapjw/gists{/gist_id}","starred_url":"https://api.github.com/users/cosmosapjw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cosmosapjw/subscriptions","organizations_url":"https://api.github.com/users/cosmosapjw/orgs","repos_url":"https://api.github.com/users/cosmosapjw/repos","events_url":"https://api.github.com/users/cosmosapjw/events{/privacy}","received_events_url":"https://api.github.com/users/cosmosapjw/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2019-01-06T14:06:21Z","updated_at":"2019-02-08T02:34:13Z","closed_at":null,"author_association":"NONE","body":"Hello, I'm analyzing the output of CosmoHammer for my modified gravity model. There is nothing wrong with CLASS with my modification and I didn't touch anything in Monte Python except for cosmo_hammer.py. (as explained in https://github.com/baudren/montepython_public/issues/105) And I just added some new parameters for my model. First I typed\r\n\r\n`python montepython/MontePython.py run -N 1000000 -p input/asdf.param -o chains/asdf --method CH`\r\n\r\nand I got\r\n\r\n```\r\n/!\\ Appending to an existing folder: using the log.param instead of\r\n     input/asdf.param\r\nRunning Monte Python v3.0.1\r\n\r\nwith CLASS v2.7.0\r\n\r\nTesting likelihoods for:\r\n -> Planck_highl, Planck_lowl\r\n\r\n----\r\nclik version 723c1a4b0580\r\n  smica\r\nChecking likelihood '/home/cosmos/plc-2.0/plc_2.0/hi_l/plik/plik_dx11dr2_HM_v18_TT.clik' on test data. got -380.979 expected -380.979 (diff -8.6809e-09)\r\n----\r\n----\r\nclik version 723c1a4b0580\r\n  gibbs_gauss 1478fb2d-28fa-49ac-a8ae-677dbdc3600a\r\nChecking likelihood '/home/cosmos/plc-2.0/plc_2.0/low_l/commander/commander_rc2_v1.1_l2_29_B.clik' on test data. got -7.32304 expected -7.32304 (diff -2.52096e-10)\r\n----\r\nSampler: <class 'cosmoHammer.MpiCosmoHammerSampler.MpiCosmoHammerSampler'>\r\nconfiguration: \r\n  Params: [0.00000e+00 0.00000e+00 2.22530e+00 1.19190e-01 1.04180e+00 3.07530e+00\r\n 9.62290e-01 9.46300e-02 6.10000e+01 1.30000e-01 6.86000e+00 2.22900e+02\r\n 3.80000e+01 3.52000e+01 1.02600e+02 0.00000e+00 6.75000e+00 9.41000e+00\r\n 1.92800e+01 8.17000e+01 9.98590e+02 9.95890e+02 1.00028e+02]\r\n  Burnin iterations: 10\r\n  Samples iterations: 30\r\n  Walkers ratio: 50\r\n  Reusing burn in: False\r\n  init pos generator: SampleBallPositionGenerator\r\n  stop criteria: IterationStopCriteriaStrategy\r\n  storage util: SampleFileUtil\r\nlikelihoodComputationChain: \r\nCore Modules: \r\n  Data\r\n  Class\r\n  function\r\nLikelihood Modules: \r\n  Planck_highl\r\n  Planck_lowl\r\n\r\nstart burn in\r\nMPI Process rank 0 starts sampling\r\n /!\\ invalid value encountered in subtract\r\n /!\\ invalid value encountered in greater\r\nIteration finished:10\r\nstoring random state\r\nburn in sampling done! Took: 2937.0032s\r\nMean acceptance fraction for burn in:0.0474\r\nReseting emcee sampler\r\nstart sampling after burn in\r\nMPI Process rank 0 starts sampling\r\nIteration finished:10\r\nIteration finished:20\r\nIteration finished:30\r\nsampling done! Took: 16738.5529s\r\nMean acceptance fraction:0.0808\r\n```\r\nand I typed\r\n\r\n`python montepython/MontePython.py info chains/asdf/CH/`\r\n\r\nfinally I got\r\n\r\n```\r\nRunning Monte Python v3.0.1\r\n\r\n /!\\ The content of the CH subfolder has been translated for Monte Python.\r\n     Please run an analysis of the entire folder now.\r\n```\r\nbut when I tried to analyze the final output\r\n\r\n`python montepython/MontePython.py info chains/asdf/`\r\n\r\nI got this error:\r\n\r\n```\r\nRunning Monte Python v3.0.1\r\n\r\n--> Scanning file chains/asdf/chain_CH__sampling.txt           : Removed everything: chain not converged\r\n                               chain_CH__sampling-error_log.txt : Removed 0 non-markovian points, 0 points of burn-in, keep 23741 steps\r\n--> Computing mean values\r\nTraceback (most recent call last):\r\n  File \"montepython/MontePython.py\", line 40, in <module>\r\n    sys.exit(run())\r\n  File \"/home/cosmos/montepython_public/montepython/run.py\", line 31, in run\r\n    custom_command)\r\n  File \"/home/cosmos/montepython_public/montepython/run.py\", line 188, in safe_initialisation\r\n    cosmo, data, command_line, success = initialise(custom_command)\r\n  File \"/home/cosmos/montepython_public/montepython/initialise.py\", line 58, in initialise\r\n    analyze(command_line)\r\n  File \"/home/cosmos/montepython_public/montepython/analyze.py\", line 92, in analyze\r\n    convergence(info)\r\n  File \"/home/cosmos/montepython_public/montepython/analyze.py\", line 291, in convergence\r\n    compute_mean(mean, spam, total)\r\n  File \"/home/cosmos/montepython_public/montepython/analyze.py\", line 1873, in compute_mean\r\n    submean = np.sum(spam[j][:, 0]*spam[j][:, i+2])\r\nIndexError: index 23 is out of bounds for axis 1 with size 23\r\n\r\n\r\n```\r\n\r\nIt seems that there is some problem with the translation process for Monte Python, but I'm newer to Monte Python so I don't know how to address it. Could you please help me?\r\n\r\n~~~~~~~~~~\r\n\r\nhere's a file \"asdf.log\" generated by Monte Python from CH file:\r\n\r\n```\r\nchain_CH__sampling.txt\t  Number of steps:10759\t Steps accepted:10759\t acc = 1\tmin(-loglike) = 398.43\r\nchain_CH__sampling-error_log.txt\t  Number of steps:-63\t Steps accepted:23741\t acc = -3.8e+02\tmin(-loglike) = -0.38\r\n\r\n```\r\nand \"asdf.log\" from CH folder\r\n\r\n```\r\n2019-01-06 10:50:46,854 INFO:Using CosmoHammer 0.6.1\r\n2019-01-06 10:50:46,854 INFO:Using emcee 2.2.1\r\n2019-01-06 10:50:46,855 INFO:Sampler: <class 'cosmoHammer.MpiCosmoHammerSampler.MpiCosmoHammerSampler'>\r\nconfiguration: \r\n  Params: [0.00000e+00 0.00000e+00 2.22530e+00 1.19190e-01 1.04180e+00 3.07530e+00\r\n 9.62290e-01 9.46300e-02 6.10000e+01 1.30000e-01 6.86000e+00 2.22900e+02\r\n 3.80000e+01 3.52000e+01 1.02600e+02 0.00000e+00 6.75000e+00 9.41000e+00\r\n 1.92800e+01 8.17000e+01 9.98590e+02 9.95890e+02 1.00028e+02]\r\n  Burnin iterations: 10\r\n  Samples iterations: 30\r\n  Walkers ratio: 50\r\n  Reusing burn in: False\r\n  init pos generator: SampleBallPositionGenerator\r\n  stop criteria: IterationStopCriteriaStrategy\r\n  storage util: SampleFileUtil\r\nlikelihoodComputationChain: \r\nCore Modules: \r\n  Data\r\n  Class\r\n  function\r\nLikelihood Modules: \r\n  Planck_highl\r\n  Planck_lowl\r\n\r\n2019-01-06 10:50:46,855 INFO:start burn in\r\n2019-01-06 10:50:46,889 INFO:MPI Process rank 0 starts sampling\r\n2019-01-06 11:39:43,858 INFO:Iteration finished:10\r\n2019-01-06 11:39:43,858 INFO:storing random state\r\n2019-01-06 11:39:43,859 INFO:burn in sampling done! Took: 2937.0032s\r\n2019-01-06 11:39:43,859 INFO:Mean acceptance fraction for burn in:0.0474\r\n2019-01-06 11:39:43,859 INFO:Reseting emcee sampler\r\n2019-01-06 11:39:43,859 INFO:start sampling after burn in\r\n2019-01-06 11:39:43,860 INFO:MPI Process rank 0 starts sampling\r\n2019-01-06 12:50:08,875 INFO:Iteration finished:10\r\n2019-01-06 14:20:01,112 INFO:Iteration finished:20\r\n2019-01-06 16:18:42,412 INFO:Iteration finished:30\r\n2019-01-06 16:18:42,412 INFO:sampling done! Took: 16738.5529s\r\n2019-01-06 16:18:42,412 INFO:Mean acceptance fraction:0.0808\r\n```\r\n\r\na few lines from \"asdf.out\" from CH folder\r\n\r\n```\r\n0.003846995504693862 -0.12502459553350692 2.2472903505163804 0.12384922398831993 1.0413070098001689 3.077978890000854 0.9650343111894872 0.10786681707903199 47.850073044578934 0.0977692201556215 7.801337795954111 223.70354878867923 36.94067386094072 25.08068105946423 108.80792223427453 1.653024298105409 6.864260841475928 10.340016984444906 19.73630764706021 91.23851821916166 997.4299237678556 996.3437130622725 100.04671829088544 nan nan nan nan nan nan\r\n0.0037502633072408966 0.002374425341948726 2.2144240443299323 0.12026574523180777 1.0419245247212885 3.0714038249265174 0.9604753127145113 0.09067403660244437 67.06954239430483 -0.06643676684710167 5.781769815937481 218.72767402147934 32.24634270962544 46.89209986015958 104.68412499011586 -5.104588019739823 8.947236806690537 8.569814832412398 21.736981910986774 71.21979513590352 997.5526806918932 999.0325990082719 100.2331687374733 nan nan nan nan nan nan\r\n0.007911644401904304 0.05376092715398769 2.2280456819592835 0.11711287516240178 1.0420832306015195 3.075734604467507 0.9670323081366486 0.09183857193790462 57.340733839015805 0.20183573353761264 5.561554818257315 211.5546764011501 33.711024397981966 36.01769865564616 111.34014449580111 2.6007899483778614 4.631616429170401 7.971067945851494 18.184706302522045 90.90070459350987 999.108612128633 996.1374430702206 100.18300000857732 2.16657918545e-09 68.41507 0.7007370261761605 0.2478014184984166 0.8147221776015532 11.152557373046875\r\n0.0004886302944677685 -0.15350088209094193 2.2450364189046255 0.11609997253881224 1.0415313006197 3.0780513017013913 0.9707277754634048 0.0915613595326492 74.87468946031495 0.48537905150752575 5.896722621922505 169.76150769398998 49.22059760748415 39.36313408112218 91.36316687762344 5.418971426928258 11.125531652627771 9.866897236637664 16.60680450970747 65.61944183411443 998.5932225607319 997.7284201072526 100.27465610650705 nan nan nan nan nan nan\r\n0.004840730144504865 -0.005499302920426844 2.207122730218392 0.115292252031806 1.0418926791593273 3.0756205481815475 0.9829321112890094 0.10951997689484101 70.16929948218126 0.3356244118400147 4.839288627956549 215.17789887946407 32.105442856743224 48.7147187658239 90.86318796323576 -9.459849891462653 8.1640039092423 9.332818120871984 16.962020678056746 90.7160059159369 997.9317869711858 995.7718029701946 100.41086525687074 nan nan nan nan nan nan\r\n0.007873866966741165 0.11912113391300592 2.240708610096269 0.11743539880747099 1.041545069366967 3.0733947450257366 0.9659298606547433 0.09774459678180293 55.87765956552554 0.26652260367263075 4.558017462066843 207.17051589908192 39.5082690652956 44.24527327752238 88.26090476961922 -9.02445026174145 6.410133386015022 9.159864960334358 16.021892028204913 77.91974663097531 998.2226435051368 994.714078564709 100.09079586035725 nan nan nan nan nan nan\r\n-0.020126562855181204 -0.10889409545086058 2.248130665439115 0.12145905662517498 1.0418063781235145 3.0742580972695968 0.9580713015123139 0.06252730051138866 65.38991939811847 0.20358287804530373 6.347775986956104 224.61868802962906 23.76244578073289 39.809070148689074 98.23658800298267 -5.611291611749822 6.887317117812717 9.702317835892357 23.254487311433355 84.42114480452626 998.9126225298736 997.195775199958 99.5216969371078 nan nan nan nan nan nan\r\n-0.012444730998238188 0.061917315729992574 2.185352901902555 0.1173685169542292 1.0420755971662183 3.080471989726493 0.9592826920096886 0.07265599652971648 52.31859362096024 0.5593464762543845 4.098223270067347 203.28991486433193 21.497023937314435 36.672605612033166 102.06662052532097 -1.544833080528576 7.207222878080215 7.413069046030926 19.647068377245546 88.795211423061 998.8820925321946 995.5732890547073 99.59078136911464 nan nan nan nan nan nan\r\n0.005100385378252516 -0.17463815313663636 2.2379218069040974 0.11712913516257391 1.0421913887923493 3.076440387425912 0.9687657951020978 0.11135277020384374 55.317302848784124 0.7165724065041246 7.025599734260181 229.92074540266327 27.412944323075557 46.21670770535092 114.34263030780473 3.0519453624367805 8.158124847796008 13.623341920239412 23.747111887567012 97.408060532173 999.1290542073439 995.3748038324145 100.10734906290101 nan nan nan nan nan nan\r\n0.004790910646166329 -0.0612736832398382 2.243452956281451 0.11879876946789596 1.0417182804696 3.073774280616307 0.9550936470960631 0.08051719128565347 57.521079844316475 -0.22983871250032478 7.909806056582105 225.2448722731597 33.71008888030493 46.012027313067165 105.2745911648193 -1.9464789003279166 8.445014677412207 8.870532823807855 20.482991063351115 88.9585954597101 996.8394145519231 996.620580408743 100.15567461212146 nan nan nan nan nan nan\r\n-0.024136309585230817 -0.00028583000427685176 2.233566238802488 0.11766283467746749 1.0416134534592416 3.0751171853458494 0.9706061258449273 0.06642667479520047 61.960604190763995 0.05783045216242434 5.747287203177584 256.87683834157303 38.65835718405072 28.585134872491555 112.47200004409224 6.406620367154805 5.598504289544604 6.170323165729334 19.48682293215828 85.58514838169134 999.5829010454643 993.8432600509541 100.14833929965675 nan nan nan nan nan nan\r\n0.003815812565937198 0.009656257724668826 2.215810139435711 0.11702818636686624 1.041271319612017 3.0752315475329173 0.9602753576175292 0.09697978089932666 49.780545534507816 0.0590678120134801 7.885414260764911 267.9149835321906 38.07546258364491 28.465078830587647 101.15587919658162 0.04698176737235604 6.866325327252815 10.702195235714006 20.403714121976382 88.50890131468717 998.8488271457175 996.5274491871428 100.13871009795193 2.16548954687e-09 68.06308 0.6980806602971381 0.2477489889030199 0.8119210943165301 11.628448486328125\r\n```\r\n\r\nand \"chain_CH_sampling.txt\"\r\n\r\n```\r\n1.000000000000000000e+00 1.128373664323362618e+03 7.911644401904303903e-03 5.376092715398769067e-02 2.228045681959283542e+00 1.171128751624017778e-01 1.042083230601519528e+00 3.075734604467506905e+00 9.670323081366486440e-01 9.183857193790462281e-02 5.734073383901580456e+01 2.018357335376126382e-01 5.561554818257315347e+00 2.115546764011500898e+02 3.371102439798196571e+01 3.601769865564615714e+01 1.113401444958011126e+02 2.600789948377861371e+00 4.631616429170400728e+00 7.971067945851493697e+00 1.818470630252204501e+01 9.090070459350987164e+01 9.991086121286330126e+02 9.961374430702205700e+02 1.001830000085773236e+02 2.166579185450000074e-09 6.841507000000000005e+01 7.007370261761605157e-01 2.478014184984166091e-01 8.147221776015531880e-01 1.115255737304687500e+01\r\n1.000000000000000000e+00 1.741987486276706932e+03 3.815812565937198170e-03 9.656257724668826370e-03 2.215810139435710813e+00 1.170281863668662381e-01 1.041271319612016910e+00 3.075231547532917276e+00 9.602753576175292460e-01 9.697978089932665635e-02 4.978054553450781583e+01 5.906781201348010324e-02 7.885414260764910921e+00 2.679149835321906039e+02 3.807546258364490654e+01 2.846507883058764676e+01 1.011558791965816226e+02 4.698176737235604250e-02 6.866325327252814859e+00 1.070219523571400622e+01 2.040371412197638179e+01 8.850890131468716504e+01 9.988488271457174505e+02 9.965274491871427927e+02 1.001387100979519289e+02 2.165489546869999843e-09 6.806307999999999936e+01 6.980806602971381114e-01 2.477489889030199122e-01 8.119210943165301453e-01 1.162844848632812500e+01\r\n1.000000000000000000e+00 1.313163112403977721e+03 7.118635042115737874e-03 1.225288720076803534e-01 2.176968423103039729e+00 1.209586924391146540e-01 1.041624503120577083e+00 3.076864051924229404e+00 9.677031156263335987e-01 9.337927720397463938e-02 6.606523480309849106e+01 5.492406028225535475e-02 7.563747471626623309e+00 2.254236044718325616e+02 2.905275564040569236e+01 2.127322663238310696e+01 1.145726772748897417e+02 6.938723289933784955e+00 8.792232078826419439e+00 1.136112207643819794e+01 2.317358218741506093e+01 6.888182119098600253e+01 9.999540639437149139e+02 9.984927668594947363e+02 1.002819651594155772e+02 2.169027605220000147e-09 6.642723000000000866e+01 6.750000545611600788e-01 2.475812921151235024e-01 8.301517812284142650e-01 1.155123901367187500e+01\r\n1.000000000000000000e+00 1.935167940573800252e+03 3.608993642508027261e-03 4.040579054579648832e-03 2.263780913914335002e+00 1.219054157984217762e-01 1.041672102799462207e+00 3.075568770204970548e+00 9.554840860765438926e-01 9.726029141872373496e-02 5.734529638547730457e+01 3.325415630187206206e-04 9.807925907894631479e+00 2.172276141534553631e+02 3.242391221834510873e+01 2.886204484009736149e+01 9.979613978429344456e+01 1.558084544967772711e-01 6.179074194029840150e+00 9.903037366660448981e+00 2.377631144755649473e+01 8.772584902356464909e+01 9.979025885416606343e+02 9.944325301410162865e+02 1.000472652290881257e+02 2.166219922179999811e-09 6.689997999999999934e+01 6.755220857044407223e-01 2.479533117059298242e-01 8.255504930576388345e-01 1.161827087402343750e+01\r\n1.000000000000000000e+00 1.780481408755079201e+03 1.541905384037550990e-03 1.344484229445355034e-02 2.231326501523757777e+00 1.195806135545675608e-01 1.041839599475115508e+00 3.075618093721053103e+00 9.660970670735866683e-01 9.715425152946721710e-02 6.013838579822511576e+01 9.036379048022616378e-02 5.678815877730265527e+00 2.062385337651708141e+02 3.694636365662616839e+01 3.095491840856214338e+01 9.734748697610889678e+01 1.424537720949293096e+00 7.201873804060451967e+00 1.058831974839807089e+01 2.020824471577329362e+01 7.873392736392692370e+01 9.984761574672527331e+02 9.966897799179618005e+02 1.001830955362016482e+02 2.166326770399999923e-09 6.747535999999999490e+01 6.868513067300012764e-01 2.478154433642033583e-01 8.225809942482822379e-01 1.165792846679687500e+01\r\n1.000000000000000000e+00 1.784817760038293954e+03 1.331989287368809307e-03 1.029311285609337406e-01 2.238523852814596982e+00 1.231702565533328020e-01 1.041708338952253454e+00 3.075964504433204905e+00 9.558879489241002281e-01 9.510461303001702116e-02 6.151040243116791828e+01 2.445276281834893872e-01 7.909615170747614776e+00 2.391541925393127315e+02 4.437892934548575141e+01 3.956719301070978645e+01 1.021670681716439617e+02 2.514407880452402821e-01 4.540489552153061936e+00 9.822354385119060893e+00 1.962374608280030230e+01 8.023471735594586107e+01 9.988320987787633385e+02 9.959012347147789797e+02 1.000447980099193614e+02 2.167077339189999997e-09 6.624706000000000472e+01 6.667880143001850834e-01 2.478461577681812245e-01 8.309306197888737255e-01 1.154983520507812500e+01\r\n```"},"comment":{"url":"https://api.github.com/repos/brinckmann/montepython_public/issues/comments/461670468","html_url":"https://github.com/brinckmann/montepython_public/issues/35#issuecomment-461670468","issue_url":"https://api.github.com/repos/brinckmann/montepython_public/issues/35","id":461670468,"node_id":"MDEyOklzc3VlQ29tbWVudDQ2MTY3MDQ2OA==","user":{"login":"cosmosapjw","id":43878740,"node_id":"MDQ6VXNlcjQzODc4NzQw","avatar_url":"https://avatars2.githubusercontent.com/u/43878740?v=4","gravatar_id":"","url":"https://api.github.com/users/cosmosapjw","html_url":"https://github.com/cosmosapjw","followers_url":"https://api.github.com/users/cosmosapjw/followers","following_url":"https://api.github.com/users/cosmosapjw/following{/other_user}","gists_url":"https://api.github.com/users/cosmosapjw/gists{/gist_id}","starred_url":"https://api.github.com/users/cosmosapjw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cosmosapjw/subscriptions","organizations_url":"https://api.github.com/users/cosmosapjw/orgs","repos_url":"https://api.github.com/users/cosmosapjw/repos","events_url":"https://api.github.com/users/cosmosapjw/events{/privacy}","received_events_url":"https://api.github.com/users/cosmosapjw/received_events","type":"User","site_admin":false},"created_at":"2019-02-08T02:34:13Z","updated_at":"2019-02-08T02:34:13Z","author_association":"NONE","body":"Good news. I managed to find the reason and fixed it. I think the problem was that montepython should have read the first column of CH output as string(maybe?) but not a float type. (So 1.00...000e+00 was wrong output. In MH output file the number # has no decimal point) So I changed the code a little bit:\r\n\r\nIn cosmohammer.py --->\r\n\r\n`def from_CH_output_to_chains(folder):\r\n    \"\"\"\r\n    Translate the output of the Cosmo Hammer into Monte Python chains\r\n\r\n    This function will be called by the module :mod:`analyze`.\r\n    \"\"\"\r\n    chainsClean, lklClean = [], []  # Arrays to store the valid steps.\r\n    error = []  # Array to store the step did not could not be computed.\r\n\r\n    chain_name = [a for a in folder.split(os.path.sep) if a][-2]\r\n    base_name = os.path.join(folder, chain_name)\r\n    # Recover the points in parameter space\r\n    with open(base_name+'.out', 'r') as param_values_file:\r\n        chains = np.loadtxt(param_values_file)\r\n    # Recover the associated likelihood (it is the -log likelihood)\r\n    with open(base_name+'prob.out', 'r') as lkl_values_file:\r\n        lkl = np.loadtxt(lkl_values_file)\r\n\r\n    # Glue them together, with an additional column of ones, for the\r\n    # multiplicity. This does not mean that the acceptance rate is one, but\r\n    # points where the code stayed are duplicated in the file.\r\n\r\n    # First, separe errors from accepted points:\r\n    for x, p in zip(chains, lkl):\r\n        if p != -np.inf:\r\n            chainsClean.append(x)\r\n            lklClean.append([-p])  # MP stores -loglkl in its files.\r\n        else:\r\n            error.append([val for val in x if not np.isnan(val)])  # Remove nan's\r\n\r\n    ## Create the array of ones\r\n    ones = np.array([[\"1\"] for _ in range(len(lklClean))])\r\n\r\n\r\n    ## Concatenate everything and save to file\r\n    finalprep = np.concatenate((lklClean, chainsClean), axis=1)\r\n    prep = finalprep.astype(np.str)\r\n    final = np.hstack([ones,prep])\r\n\r\n    output_folder = os.path.join(folder, '..')\r\n    output_chain_path = os.path.join(output_folder, name_chain)\r\n    output_error_chain_path = os.path.join(output_folder, name_error_chain)\r\n    np.savetxt(output_chain_path, final, fmt=\"%s\")\r\n    np.savetxt(output_error_chain_path, error)\r\n\r\n`"}}
{"actor":{"display_login":"cosmosapjw"}}