diff --git a/anesthetic/samples.py b/anesthetic/samples.py index 2c7856e7..96782993 100644 --- a/anesthetic/samples.py +++ b/anesthetic/samples.py @@ -1532,7 +1532,7 @@ def points_to_plot(self, plot_type, label, evolution, beta, base_color): assert len(colors) == len(samples) return samples, colors else: - raise ValueError("Unreachable code") + raise ValueError("plot_type not supported") def merge_nested_samples(runs): diff --git a/tests/example_data/dnest4_no_column_names/README.md b/tests/example_data/dnest4_no_column_names/README.md new file mode 100644 index 00000000..6c12769e --- /dev/null +++ b/tests/example_data/dnest4_no_column_names/README.md @@ -0,0 +1,2 @@ +these results are generated with https://github.com/modsim/DNest4/tree/master/code/Examples/Gaussian. + diff --git a/tests/example_data/dnest4_no_column_names/levels.txt b/tests/example_data/dnest4_no_column_names/levels.txt new file mode 100644 index 00000000..56d2d4eb --- /dev/null +++ b/tests/example_data/dnest4_no_column_names/levels.txt @@ -0,0 +1,11 @@ +# log_X, log_likelihood, tiebreaker, accepts, tries, exceeds, visits +0 -1.79769313486e+308 0 499346 499346 166854 453294 +-0.999571251226 -24.3597681926 0.7551917793 313532 499489 233539 634669 +-1.99937472226 -9.57025215661 0.30892651978 222714 499379 258897 701329 +-2.99655592479 -4.10851011468 0.747675734387 163810 499544 269353 726821 +-3.99052132804 -2.1019896864 0.580542049043 123570 499663 268259 737400 +-4.99971625378 -1.34948959349 0.334456726091 93858 499452 278699 736105 +-5.97598204066 -1.08113616536 0.37597039172 73553 499402 286086 746493 +-6.94210606655 -0.981723001433 0.187966007139 59145 499757 287358 754237 +-7.91306613861 -0.942917930815 0.636052448636 47833 500250 281009 755998 +-8.90450040925 -0.927947382774 0.65807456864 39827 499770 0 0 diff --git a/tests/example_data/dnest4_no_column_names/sample.txt b/tests/example_data/dnest4_no_column_names/sample.txt new file mode 100644 index 00000000..c6c19b59 --- /dev/null +++ b/tests/example_data/dnest4_no_column_names/sample.txt @@ -0,0 +1,501 @@ +# Samples +8.03794 -7.39097 +-0.912144 5.38768 +4.66925 1.31299 +2.37219 7.2351 +-8.55207 6.1829 +-5.09315 5.76313 +-1.64683 0.102338 +6.0112 8.57318 +1.41464 5.29773 +-7.9423 2.2053 +2.71119 2.1424 +2.60122 -5.67186 +-0.987966 -1.72323 +-3.13403 -1.43698 +1.85364 3.69236 +-2.1157 -0.526436 +1.40263 -1.2391 +-1.74545 3.2969 +7.0698 -4.55994 +-1.19373 3.70517 +-2.22755 -2.45388 +-2.2056 7.15416 +-5.58894 0.216229 +1.73818 -5.27126 +1.44644 -0.405415 +3.65389 4.66652 +-2.09614 -0.923006 +0.00746782 1.77172 +-3.2048 -4.46059 +-3.78657 -4.7606 +-4.68305 -2.58252 +0.911312 -0.125518 +-1.73495 0.733095 +0.0724071 -0.0727894 +-0.311725 1.64431 +-0.550049 -0.25155 +4.82072 -8.91082 +-1.73416 1.60688 +-0.913441 0.233414 +1.30074 0.95124 +-1.51261 1.19256 +-0.184535 1.17888 +-0.870689 9.68111 +-0.0409561 -0.376015 +0.444242 0.130658 +0.531607 -0.305932 +-0.6751 0.296506 +0.940503 -0.831824 +0.300654 0.670442 +-1.58131 -6.73887 +-0.52343 -0.0846465 +-0.0441512 -0.56099 +-0.869533 0.289608 +6.10736 -2.635 +0.184704 -0.0220027 +0.0391038 0.139203 +-0.0828206 0.174906 +1.25084 -0.878427 +-0.417159 -0.781976 +-0.232499 -0.0285052 +0.0613684 0.321801 +0.893465 0.990848 +0.0217515 0.0581149 +0.20664 0.345644 +0.136433 0.153445 +0.323769 0.300635 +0.0142056 0.0288957 +2.80084 -2.86125 +1.64245 1.96857 +0.404372 -0.000185558 +-0.0683598 0.0301628 +0.131302 0.0245166 +-1.64853 1.49003 +-0.185954 0.0747238 +1.81075 0.264987 +0.0543962 0.0447508 +-0.0785556 -0.0864432 +0.0594714 -0.109282 +0.0243821 0.0373721 +-0.167722 0.13925 +0.143885 0.125953 +0.165225 0.0806737 +-0.211201 0.184162 +-0.0749809 0.200478 +-0.059028 -0.0747701 +-0.0471153 -0.207288 +0.114622 0.00992726 +-0.180419 0.226334 +0.154585 -0.0621936 +-0.0181339 0.405968 +-0.198278 0.00120902 +0.411796 0.0746577 +-0.15485 -0.234035 +-0.0878203 0.252429 +0.160155 -0.303235 +-0.155426 0.0301761 +0.328359 -0.81662 +-0.0131696 0.171867 +-0.0786487 -0.108208 +-0.415118 0.598318 +0.208398 -0.0126049 +0.762627 0.913426 +0.349983 -0.753459 +-0.0230784 0.0415432 +0.0932482 -0.421742 +-0.0402393 0.181441 +0.208792 0.437349 +-0.495821 -0.122168 +-0.13721 -0.136055 +-0.368105 0.0815949 +0.251496 0.235754 +0.333652 -0.213718 +-0.244392 0.0989661 +0.0257419 -0.00665218 +0.305172 0.163802 +-0.307581 1.50203 +0.0722119 0.0544439 +0.414663 0.310891 +-0.655573 0.456649 +-0.0340741 0.0105878 +0.201916 0.0127907 +-1.17816 1.06551 +0.181519 -0.0915563 +0.880007 0.0204517 +-0.265841 0.172853 +-1.46249 -0.0924284 +0.713514 -0.338247 +-0.0941108 -0.0387444 +-2.08646 -1.10906 +-0.221931 -0.236216 +0.906956 -0.795073 +0.536073 0.0944006 +0.27494 -0.0103615 +-1.02738 -2.11432 +-0.117434 0.179359 +-3.85916 -1.31649 +-0.0236414 -0.102298 +-0.0794356 0.107151 +-0.134688 0.495166 +0.113612 0.160056 +-0.0192828 -0.172059 +0.584027 -0.838366 +-0.95889 0.873347 +-2.08817 -0.590688 +-1.72506 2.21559 +0.194077 -0.190225 +0.0531061 -0.0151408 +0.0145362 -0.195997 +-0.0850781 0.025403 +-0.439441 0.160864 +0.00579554 0.0821378 +-0.19327 2.21563 +-0.284469 -0.882918 +0.263409 -0.0807555 +0.302795 -1.25159 +-0.302185 0.611021 +0.0267082 0.122378 +0.223968 0.319894 +-0.0385921 -0.318653 +1.3647 -0.840047 +0.133923 0.125661 +-0.0248534 -0.0885972 +0.11058 0.335069 +0.259387 0.0671344 +2.75747 2.9312 +0.756501 -3.64119 +-0.075712 0.247553 +0.496973 0.0985056 +-0.363256 2.48079 +-4.49627 -4.87249 +0.494436 1.40064 +-0.0600697 -0.251812 +-0.0296497 0.112911 +-0.285603 2.82018 +-0.386575 0.414226 +0.69675 -1.88073 +-0.276685 -0.540402 +-0.144703 0.147367 +1.52968 1.62579 +0.105533 -0.0615409 +0.188348 -0.00476516 +-0.0252626 0.103882 +-0.597808 -0.627459 +-0.930869 -2.42865 +-2.66388 4.10675 +0.0762657 0.0416691 +0.00888775 0.00472379 +0.0939913 0.0539106 +-0.166039 0.0435287 +0.320158 0.000342884 +2.21697 0.730647 +0.370732 0.277159 +1.32707 -4.80705 +0.365837 -0.135911 +-1.58492 4.8846 +-1.22328 -2.57919 +0.126862 -0.00221921 +-0.238083 0.133255 +-1.79598 3.88943 +-0.0624638 -0.121789 +-0.241188 -1.4591 +0.1692 0.189777 +0.063135 -2.072 +0.559592 3.38038 +0.748949 0.316674 +-0.0337725 -0.128362 +0.235978 -0.145948 +-2.66685 3.43787 +-0.112935 -0.271273 +-0.109228 -0.578612 +2.73105 -0.872041 +-0.442756 0.00459232 +0.770044 -0.973096 +-0.510967 0.433871 +0.0755387 -0.178821 +-6.0471 -2.36745 +-0.0878818 0.0328222 +-0.213359 -2.08098 +5.50861 -6.50998 +0.215291 -0.794202 +0.161985 -0.468996 +-1.32334 -1.37641 +0.962004 2.09874 +-0.0550268 -0.0956795 +0.05554 -0.0851617 +9.96667 -8.10034 +0.478364 3.98805 +-0.0482955 0.211809 +1.97838 -3.00168 +-0.0600626 -0.0157672 +-1.06215 -3.44153 +-1.82365 7.18523 +-5.60635 -3.44062 +0.0810786 -0.10985 +-0.299902 -0.444535 +0.176782 0.0651168 +-3.32255 -4.00147 +0.282267 0.00119473 +0.392705 0.776282 +0.730131 0.0230857 +-1.75728 -1.11044 +-0.0416547 0.017395 +6.37034 -7.24367 +0.0654329 0.0854995 +1.43119 -0.51535 +-0.119246 0.0150497 +6.96687 -8.57767 +0.443444 0.0737704 +2.01559 5.39161 +-0.0523691 -0.0547722 +-0.338157 0.278335 +-0.069592 -0.191419 +0.121522 -0.0566927 +1.68177 -4.34886 +5.72386 -7.75799 +-0.083421 -0.126576 +1.21395 1.84709 +0.193959 0.0686935 +-0.565981 -2.89325 +-0.159025 0.575324 +-0.0951585 0.0134939 +-0.13504 -0.11592 +0.304903 -0.333094 +0.0499899 0.288547 +-0.0406184 0.0878493 +0.028301 0.064352 +0.0319724 0.583167 +-0.166566 0.0330138 +-0.533469 -0.346965 +0.0453271 -0.0298608 +-3.41092 0.0618885 +0.277132 -0.0774003 +2.34867 -0.275611 +0.285389 0.695068 +-1.31621 0.617278 +-0.985036 1.03422 +0.518031 -0.5429 +1.57478 -3.13752 +-7.49018 -6.85626 +9.338 8.33267 +0.0850537 -0.00461704 +1.01462 0.174994 +0.0377684 -0.380715 +0.547711 0.511635 +-0.09153 0.323862 +-4.48814 4.35976 +0.78707 -2.16814 +-0.79552 0.261358 +-0.0743035 0.10192 +-0.408268 -0.555486 +-4.90871 2.28319 +2.32139 -0.601018 +0.0164628 -0.00302241 +0.133384 -2.08091 +-0.0151785 0.10836 +0.0742228 0.025238 +0.135743 0.278023 +0.037886 0.0591829 +-0.570705 -0.275555 +0.799646 0.214671 +1.40979 -0.548834 +-1.05449 0.199902 +0.129292 0.036271 +0.110874 -0.322102 +-0.890455 3.10051 +0.0870546 0.173189 +-1.20673 4.6463 +0.265288 0.376799 +0.527784 -0.143991 +-0.818062 -0.00498385 +0.534174 0.227369 +0.370659 0.34367 +-0.094777 0.0725935 +4.49664 -1.40788 +-0.011936 -0.0841135 +-0.0988636 0.548419 +-0.093384 -0.180969 +1.35125 -4.08132 +0.183985 0.105915 +0.0483288 0.188675 +-0.947887 1.3507 +-0.162837 -1.14195 +-0.37708 -0.187524 +-0.00537339 0.00951453 +0.47108 2.08262 +-2.30354 0.490303 +0.0250569 0.0600914 +-0.0240117 -0.179659 +-0.171628 -0.149332 +6.24798 5.78298 +0.513927 -2.20175 +0.32961 -0.284068 +-0.242566 -0.204439 +7.91516 0.457227 +-5.53762 3.87623 +2.33822 0.519627 +-0.197423 -0.0787608 +-0.0353173 0.0298961 +0.773661 -0.240707 +-0.106404 -0.0722508 +4.23689 -2.98416 +-2.48564 0.459338 +-0.0845158 0.0166896 +1.19059 1.66287 +1.71682 1.16451 +-1.21814 -1.69079 +-0.00668665 -0.0515079 +-6.3226 -0.615926 +0.0445624 -0.568877 +-0.817005 1.03856 +-0.856749 -0.224063 +2.10002 -2.82048 +-0.45063 0.776198 +-0.0206332 -0.268005 +7.38739 7.66345 +-0.0235418 0.000929562 +-0.102955 0.0811018 +-0.122859 0.176116 +2.89471 -2.02694 +2.57005 1.5551 +-1.7104 3.40248 +-0.0101287 -0.0532508 +-5.75848 2.75182 +1.16892 -1.2354 +-1.07776 0.70332 +0.248891 -0.129583 +-0.932476 -0.267011 +3.41738 -0.291878 +-0.18869 0.252372 +0.485805 -0.136165 +0.111996 0.601006 +1.46357 1.02059 +0.0331881 0.180042 +-2.87427 5.28223 +0.289124 0.307465 +-2.85702 6.13929 +-2.49275 -0.28734 +-0.122402 0.228404 +-0.06224 0.058253 +0.0692096 -0.380291 +0.973474 -1.02369 +-0.114509 -0.413532 +-9.26564 5.24183 +0.195998 -0.0658074 +-0.0451743 -0.148958 +0.0441777 -0.0122199 +-1.74693 -3.93208 +3.23835 -1.26037 +1.47057 -0.317245 +-0.00418691 -0.196712 +4.00967 -9.12168 +-3.36359 0.426643 +1.39351 -1.74827 +0.621123 -1.68012 +0.437381 -0.63496 +-0.056216 0.420735 +1.8985 2.89611 +0.315066 -0.682955 +2.03797 0.922526 +-1.65451 -1.82756 +-0.283078 0.0094136 +-9.28835 -2.83392 +2.15781 -1.88389 +-0.176717 -0.10896 +-0.00085444 -0.0945958 +9.04762 -3.3592 +0.0417267 -0.353598 +4.61248 -0.903447 +0.136393 -0.087911 +0.137087 0.0309051 +3.09144 -5.57906 +1.40089 -0.153516 +-0.0779443 -0.0796471 +0.150128 0.156495 +-0.0298208 0.235943 +0.0640115 -0.137946 +-0.0849779 -0.0457488 +-0.223199 0.262587 +1.27893 3.58854 +-8.8042 5.83303 +-0.512432 1.05695 +-0.361949 -0.0387996 +0.448981 0.244442 +0.207987 -2.77718 +0.161838 0.550565 +6.34975 4.97745 +0.853955 3.48226 +-0.84843 -0.603275 +3.94127 -0.850769 +0.0691365 0.367959 +-1.37639 0.0726328 +-2.46245 -4.48683 +-0.451595 -1.38768 +-1.17172 -1.32995 +-2.7399 -2.18482 +-0.12551 0.276762 +0.560175 0.139471 +1.76389 -1.56026 +-0.472426 0.0780278 +-0.287325 0.723597 +0.389163 -0.0865347 +0.0556664 -0.0102737 +4.75288 -5.67401 +0.174981 0.129244 +0.417276 5.87513 +1.73334 0.994502 +0.841767 0.335397 +0.600413 -8.84412 +0.277896 0.973466 +0.205 -0.0786201 +-0.0410302 0.00121347 +0.359201 0.288553 +0.263219 0.169328 +8.75187 -4.88059 +-5.90821 3.40296 +0.662988 0.293481 +0.64869 -0.607988 +0.320494 0.317864 +5.2351 -0.707922 +0.0885918 -0.00246283 +0.106387 0.00103635 +-0.404851 0.0824984 +4.41172 -0.594112 +0.0989245 0.0288895 +6.27996 -1.02297 +-0.859746 0.279207 +-0.40774 -0.789246 +1.56742 -1.7816 +-0.526308 0.121361 +-0.168126 1.34405 +1.15642 -1.18135 +-8.62991 -4.40907 +-0.0921188 0.112798 +0.0829416 -0.201453 +-0.561514 0.0709943 +0.0922257 0.0217377 +0.0661021 0.0275164 +-2.48048 -4.60922 +0.615779 0.8356 +3.5626 5.53445 +-0.578104 -0.643057 +0.0925839 0.450419 +0.895399 -0.529587 +-1.09705 1.74277 +0.211289 -0.173931 +0.0907058 -0.0936857 +-5.36731 9.84087 +-0.0662448 -0.0189288 +-5.29812 -5.46996 +6.05295 -4.68896 +0.0453211 0.103823 +-0.132501 0.122358 +-0.00215165 -0.409102 +-0.0129437 -0.176669 +-2.00071 -0.288041 +0.162822 0.112388 +0.103757 -0.0599962 +1.98943 -1.6846 +0.0678944 -0.264965 +-0.788367 -1.10343 diff --git a/tests/example_data/dnest4_no_column_names/sample_info.txt b/tests/example_data/dnest4_no_column_names/sample_info.txt new file mode 100644 index 00000000..94a75076 --- /dev/null +++ b/tests/example_data/dnest4_no_column_names/sample_info.txt @@ -0,0 +1,501 @@ +# level assignment, log likelihood, tiebreaker, ID. +0 -60.5364140046 0.210245219273 5 +0 -15.8485004786 0.387092274494 9 +0 -12.6818456401 0.932802717954 18 +0 -29.9058961695 0.866019552441 0 +0 -56.601972961 0.486838478054 7 +0 -30.495888839 0.730970690816 17 +1 -2.28019323868 0.449525406556 5 +0 -55.73593085 0.340675525304 0 +1 -15.9525203742 0.152473767535 10 +0 -34.8906780874 0.282971863946 19 +1 -6.88913429724 0.983836703415 18 +1 -20.3870923945 0.0971420621419 14 +2 -2.89173963326 0.987709767869 0 +2 -6.86247841542 0.188368501854 10 +2 -9.45369331357 0.530786643039 5 +3 -3.29559907595 0.923614166867 10 +0 -2.67031249561 0.175710306714 14 +2 -7.87701529052 0.862841619025 2 +0 -36.3065233323 0.688409061617 2 +2 -8.49556037119 0.140403558995 15 +2 -6.41067526418 0.718421630555 6 +0 -28.9422901445 0.23103629447 19 +1 -16.5604669443 0.901205389436 2 +0 -16.3226678638 0.246114968242 11 +4 -2.0472144291 0.763743165289 10 +1 -18.4826071907 0.401975076738 0 +3 -3.5418183396 0.515203540501 5 +3 -2.48847027015 0.141052268902 13 +1 -16.0027526815 0.623384519579 18 +1 -19.4196466313 0.0808917206861 7 +1 -15.219125775 0.173093133642 5 +4 -1.34206095827 0.498097657612 6 +3 -2.69268178555 0.918120644081 17 +5 -0.924209081724 0.484742125348 6 +3 -2.31939521329 0.686457167606 3 +5 -1.1018543166 0.0408796265733 10 +0 -52.2399135665 0.253385302411 4 +3 -3.71362380963 0.43215661909 15 +4 -1.36336713995 0.547047978093 11 +3 -2.21733338111 0.888987953253 17 +2 -2.77403329801 0.606475200586 4 +3 -1.63084990555 0.0496250242949 3 +0 -48.1599690269 0.172493323942 3 +5 -0.990471027235 0.592830129725 5 +6 -1.02614975996 0.226411953619 12 +5 -1.10703866839 0.615950660557 7 +5 -1.19077662062 0.279178693045 1 +4 -1.70717698714 0.991401068939 19 +3 -1.18888097553 0.902772015953 13 +0 -24.8753962522 0.870314729583 9 +6 -1.05951059038 0.789401032678 0 +6 -1.07726782246 0.288436346649 14 +5 -1.33891924876 0.975881017914 0 +1 -23.0404787813 0.947204428292 11 +7 -0.936238324956 0.82271071215 10 +7 -0.92939187115 0.00776400162924 16 +7 -0.937664161791 0.743683062873 10 +4 -2.08705646402 0.988544850409 8 +5 -1.31169228464 0.960407446681 9 +7 -0.946372597338 0.278005022781 15 +6 -0.972599381007 0.841932596549 5 +4 -1.8089680352 0.386053746141 0 +7 -0.920863770825 0.746807298768 8 +6 -1.00002357283 0.963560335902 7 +7 -0.940018122182 0.849842762689 17 +6 -1.01654230526 0.831298240105 7 +8 -0.91945691395 0.202223599834 1 +2 -8.9346549244 0.857759016723 5 +0 -4.20540809542 0.990402273855 18 +6 -1.0006967065 0.148071063143 7 +8 -0.921729965044 0.424587915886 15 +8 -0.927859169055 0.0794411084746 17 +3 -3.38784977107 0.292863404178 1 +8 -0.93901988748 0.131884469381 8 +3 -2.59345764964 0.47096659719 18 +9 -0.921419323118 0.368903230132 6 +9 -0.925760243064 0.257609053596 6 +9 -0.926678248376 0.173393978023 3 +8 -0.919934114581 0.298119948881 0 +8 -0.94269918765 0.942003508827 17 +8 -0.937222048224 0.886673224546 7 +7 -0.935842266131 0.470031973428 4 +7 -0.958199224203 0.0547593558169 11 +8 -0.94184530483 0.11521636352 9 +9 -0.923475972021 0.289212442501 0 +8 -0.941532550691 0.507552989197 11 +9 -0.925556937806 0.072420824569 18 +6 -0.960827523604 0.708252922697 16 +8 -0.932820827886 0.400018904907 4 +6 -1.00150780288 0.375911333029 2 +8 -0.93859630191 0.679839679599 5 +6 -1.00651325025 0.0726270848981 14 +7 -0.958314048989 0.0517820665806 9 +7 -0.954654838992 0.711118351993 6 +6 -0.977738985144 0.938500118373 13 +8 -0.931472473731 0.559923970971 6 +5 -1.30628213627 0.779839899821 16 +8 -0.933794368541 0.633164764797 12 +9 -0.927885861632 0.628475826288 14 +5 -1.18409203385 0.313699315346 1 +8 -0.94073281931 0.95141971842 9 +4 -1.62691176991 0.87835519689 11 +4 -1.26403259608 0.0728816547401 5 +4 -0.920067760547 0.543629609903 4 +6 -1.0122194055 0.174328510579 5 +8 -0.93620860367 0.204912114218 11 +5 -1.03637253467 0.408422157367 3 +6 -1.04932039077 0.737837334416 11 +8 -0.937607323579 0.793827577332 1 +6 -0.990018097426 0.953528734134 18 +7 -0.978353678063 0.880925467325 17 +5 -0.997437912421 0.178811534138 3 +6 -0.95369948994 0.692411785461 0 +9 -0.919291982421 0.206855272037 1 +7 -0.97891924921 0.870556636473 18 +3 -2.09428977973 0.58887325029 14 +7 -0.923027879886 0.740920136745 8 +6 -1.05323788565 0.879652905895 1 +5 -1.23809063351 0.249642782924 14 +9 -0.919575106028 0.0737939822291 17 +7 -0.939405443223 0.686862465161 3 +3 -2.18062203507 0.0625739341722 7 +7 -0.939604473304 0.253195283259 19 +5 -1.30635364827 0.827617887613 8 +7 -0.969213297859 0.451553769714 8 +4 -1.99264448655 0.600153867692 6 +4 -1.23069551205 0.678784532141 16 +8 -0.924117520794 0.324228040905 8 +1 -3.71060543237 0.405409072287 3 +7 -0.971464162809 0.0467360821705 5 +4 -1.64629357872 0.0439507019733 16 +6 -1.06708123936 0.941368664838 12 +7 -0.956788171299 0.00238740392361 16 +3 -3.68187272482 0.237038962858 8 +8 -0.941918751381 0.880818858542 19 +2 -9.23204947297 0.99186863089 7 +9 -0.924450428497 0.974465425891 7 +5 -0.927834178159 0.0595605736154 13 +6 -1.05060352863 0.413218337082 6 +8 -0.938201379742 0.0680630914979 12 +7 -0.933926531721 0.344163062452 18 +3 -1.44091109941 0.670576285353 5 +2 -1.76004060489 0.119875337081 1 +3 -3.273628628 0.47347903625 13 +2 -4.86126475552 0.661174218265 18 +7 -0.955864309839 0.944204125232 16 +9 -0.920463281707 0.675241836142 15 +7 -0.938251690879 0.793454022541 1 +9 -0.922880330453 0.476102834773 17 +5 -1.02843137486 0.969892928544 11 +8 -0.922328639577 0.790312752628 7 +3 -3.39213365949 0.265108404263 0 +5 -1.34917184361 0.586204791358 15 +7 -0.956891434972 0.146126728405 11 +4 -1.74802433988 0.996037090514 15 +5 -1.15126946346 0.66326413222 5 +9 -0.92678341937 0.878023282071 18 +5 -0.995185435665 0.083505874541 10 +7 -0.970453015483 0.0151728985872 4 +3 -2.2029876202 0.921225359387 17 +5 -0.935801522606 0.0500382574156 15 +6 -0.923172109975 0.621592558286 9 +6 -0.981188069857 0.0778616747615 6 +7 -0.954832725319 0.485587758247 6 +2 -9.01671823451 0.625580587904 14 +2 -7.83420407358 0.243096106723 4 +7 -0.952445807176 0.730516788616 15 +6 -1.04728125038 0.603825557166 5 +1 -4.06206907729 0.813499784109 13 +1 -22.8977337272 0.906252502239 10 +4 -2.02207169377 0.800898491572 19 +6 -0.952447247438 0.199109998158 1 +9 -0.925752529179 0.0791230838954 4 +2 -4.93643544743 0.240623705518 8 +5 -1.0794501048 0.86477885376 4 +3 -2.93023676057 0.95153095253 10 +3 -1.10323280056 0.424056898459 12 +6 -0.940266627058 0.988381281783 4 +2 -3.4104847662 0.913260566893 7 +8 -0.926400730308 0.321617645865 10 +5 -0.936687317008 0.0804556123426 8 +4 -0.924653361178 0.876286839364 11 +5 -1.29447826714 0.765838879779 4 +2 -4.30135636782 0.375664858541 1 +1 -12.899762101 0.604496574417 5 +9 -0.922714917982 0.519517447266 6 +7 -0.918989186376 0.0775330938618 18 +9 -0.924808893186 0.281772746817 19 +7 -0.933670404324 0.906814336875 15 +7 -0.97018909137 0.469553383404 10 +3 -3.64334573543 0.527831136443 0 +5 -1.02606835728 0.641411551369 14 +1 -13.3533635314 0.770927236059 14 +5 -0.995092946706 0.191094002066 10 +1 -14.1045619299 0.996490187165 8 +0 -4.99324594682 0.7514862359 16 +8 -0.926987949906 0.387072781836 7 +5 -0.95615891698 0.389378231043 15 +0 -10.0955381671 0.445187972484 19 +6 -0.928305677073 0.0581181177271 11 +4 -2.01251489187 0.910966300648 10 +7 -0.951260481157 0.296698588967 16 +3 -3.06752336493 0.317121093893 6 +2 -6.78900360805 0.965613920679 12 +2 -1.24954180696 0.468941558994 7 +9 -0.927747250433 0.452651491263 19 +7 -0.95743182044 0.307339918773 19 +1 -10.3844596991 0.205147106505 14 +6 -0.96211026891 0.566781648368 17 +5 -1.09229957827 0.704884828329 9 +1 -5.02848355698 0.323280926019 0 +6 -1.0169653427 0.040660470352 1 +4 -1.68888072499 0.167658718378 18 +5 -1.14360416109 0.0949696865144 14 +8 -0.93778007408 0.0938367881808 18 +0 -22.0050518908 0.326118661758 19 +6 -0.923338788202 0.175154542042 11 +2 -3.10693304357 0.303675054776 2 +0 -37.2812246297 0.109389367446 17 +5 -1.25749253808 0.443292338535 10 +6 -1.04203693165 0.945148910421 15 +1 -2.7417981693 0.786852110701 15 +2 -3.5840261206 0.0559601221336 8 +9 -0.925029787644 0.946309921974 4 +8 -0.924107137479 0.0162804874229 12 +0 -83.3939605131 0.0975575426116 8 +0 -8.98564492658 0.205996174836 11 +8 -0.94253623494 0.64278907487 3 +2 -7.38098564459 0.0960616195491 14 +8 -0.920866595231 0.45471844071 3 +2 -7.40507467762 0.48177234875 14 +0 -28.3955368623 0.776564801882 3 +1 -22.553469681 0.260165671878 1 +7 -0.92825889826 0.982976724082 13 +6 -1.06271470462 0.519998750595 3 +8 -0.93668455286 0.112825158487 1 +0 -14.4444857063 0.0218190954502 13 +7 -0.958776681389 0.670200357866 0 +5 -1.29735384937 0.5215772546 8 +5 -1.18575065443 0.00439967254613 15 +3 -3.07948304551 0.549026437937 9 +9 -0.919957385293 0.863609185695 17 +0 -47.4449279377 0.687787977986 13 +9 -0.924734344418 0.225683125763 5 +4 -2.07588603844 0.955008466485 1 +8 -0.92616156314 0.138107386933 0 +0 -61.9757509228 0.40506209939 6 +5 -1.01998106565 0.218442522426 19 +1 -17.4849733523 0.355993225618 8 +9 -0.921809793797 0.748647782903 5 +6 -1.01484892282 0.521635256872 15 +4 -0.939680744854 0.0058103730244 11 +9 -0.92792931238 0.950944703985 7 +1 -11.7894310176 0.257289376027 8 +0 -47.3933810207 0.887368840673 8 +7 -0.930428755061 0.174210185002 11 +3 -3.36165670182 0.118245955632 3 +8 -0.940108036333 0.0397121568979 2 +2 -5.26456221059 0.810568984681 6 +5 -1.09708219018 0.343704746124 19 +9 -0.923557141998 0.138809594467 1 +8 -0.934775135954 0.51899257905 18 +6 -1.02089739378 0.257603141672 3 +7 -0.961817771528 0.0434499375206 13 +9 -0.923622206936 0.374099433154 0 +7 -0.921409595788 0.575529741601 9 +5 -1.08949152267 0.128696322113 9 +8 -0.933355605236 0.054098392764 13 +5 -1.12142551723 0.439160768159 15 +9 -0.920411639518 0.743173092179 2 +2 -6.73803939868 0.704530673798 13 +1 -0.960334877282 0.510380212479 19 +1 -3.71504915762 0.218592386736 1 +5 -1.2012216665 0.810361436972 5 +4 -1.97565756867 0.814420640626 1 +3 -1.93889619261 0.722139185389 16 +5 -1.20048704291 0.457223828093 18 +0 -7.08093739131 0.251746114133 1 +0 -52.4744738106 0.90682742589 3 +0 -79.234749525 0.364514805952 10 +8 -0.922566261275 0.947031078433 4 +2 -1.44898084578 0.0427833778642 2 +4 -0.992123604692 0.557399591384 5 +5 -1.19981753435 0.819459994425 10 +7 -0.975570732039 0.865204905833 12 +1 -20.4944098564 0.125460717215 19 +3 -3.57909428565 0.675595873088 11 +3 -1.26951836636 0.00580669412767 8 +9 -0.926892888932 0.187322935571 4 +4 -1.15656230022 0.943985680049 14 +0 -15.5731468807 0.742344221594 12 +3 -3.79396666721 0.765753327071 16 +8 -0.919078612749 0.92890199637 14 +3 -3.09293305922 0.387300623773 0 +9 -0.924924627856 0.619677325239 7 +9 -0.922011522236 0.101929484715 17 +7 -0.966799859589 0.917737704051 2 +8 -0.921407515548 0.241149973532 9 +5 -1.11975613591 0.510220150669 15 +3 -1.26169739811 0.116139333418 4 +4 -2.06330271598 0.374923559738 8 +4 -1.49489135275 0.998127098587 18 +7 -0.927954538273 0.746694256295 3 +5 -0.976959994005 0.198520754646 3 +2 -6.12197475547 0.124795939158 8 +8 -0.937725046897 0.692424714035 1 +1 -12.4410816626 0.808429829813 14 +6 -1.02511600349 0.539481307705 2 +6 -1.06858350318 0.522840513219 11 +2 -1.25356331755 0.424318472176 13 +4 -1.08745768005 0.0841242692689 17 +5 -1.04668697098 0.170114376094 14 +9 -0.926064779443 0.644087061992 0 +0 -12.0198716251 0.573420332297 2 +9 -0.922547304781 0.525745383988 2 +6 -1.07420748153 0.265894007502 12 +8 -0.939673661888 0.94703571409 5 +0 -10.1604551899 0.931680904412 11 +8 -0.941472688569 0.39739513188 12 +8 -0.937905577639 0.384470974343 18 +3 -2.28037788917 0.687917169214 2 +4 -1.58422106554 0.560007922837 15 +6 -1.0076155734 0.555582322348 0 +8 -0.918998233 0.0846963704552 9 +3 -3.198556555 0.849434256608 2 +3 -3.69229185131 0.233251085004 5 +9 -0.921057943746 0.293138816247 18 +8 -0.935365405636 0.103340190378 10 +7 -0.944816686964 0.940078863195 10 +0 -37.1590284552 0.650610520332 7 +2 -3.47484472315 0.513092752908 13 +6 -1.01360739016 0.682590647508 13 +7 -0.969255311518 0.482738992752 15 +0 -32.3483266567 0.585578044412 17 +1 -23.7641349937 0.754740111687 1 +3 -3.78758421378 0.174072494731 14 +7 -0.941528180454 0.191088470957 1 +8 -0.920009077296 0.104588065799 10 +4 -1.24718385388 0.218903175136 4 +9 -0.927209474728 0.884384242161 16 +0 -14.3471725879 0.414093529629 14 +2 -4.11364020941 0.182236698438 10 +9 -0.922649264445 0.655558334667 16 +3 -3.01026392046 0.836909122328 14 +3 -3.07070734866 0.0603606091385 13 +2 -3.09024671465 0.6261928359 17 +8 -0.920287420944 0.330201332538 10 +0 -21.0962600448 0.356918739848 6 +5 -1.08174184963 0.315942852996 12 +4 -1.79198881794 0.42404244104 11 +5 -1.31104987452 0.178302509076 3 +2 -7.10152214381 0.603806609927 13 +4 -1.32171388897 0.069195624722 17 +7 -0.955064839043 0.789278563833 10 +0 -57.5699463538 0.83664055753 4 +8 -0.919216073379 0.407402407224 14 +8 -0.927527148255 0.710915480821 17 +8 -0.941994086829 0.688709261273 18 +2 -7.16286135704 0.862502853059 4 +1 -5.43066823598 0.419386026792 6 +0 -8.17011871769 0.404435451661 11 +9 -0.920407654028 0.243187396612 13 +1 -21.2852173945 0.599189697053 4 +1 -2.36523535707 0.936109764262 0 +4 -1.74704975057 0.890310843598 11 +6 -0.958307709879 0.494816439471 3 +4 -1.3893420794 0.571687179807 15 +2 -6.80079247627 0.471193713609 9 +7 -0.968586225552 0.0596260380855 9 +6 -1.04621244569 0.731777862911 8 +2 -1.10581440692 0.910822238351 15 +0 -2.51076630658 0.751317276515 18 +8 -0.93569681454 0.33316640922 3 +0 -19.0006407754 0.46434561476 4 +5 -1.0080022918 0.0901594954446 13 +1 -23.8456378861 0.18518044351 7 +3 -4.06711606365 0.207567963842 10 +6 -0.952513998776 0.352486811307 13 +9 -0.92257214966 0.742299469241 4 +6 -0.993644137912 0.27533520015 1 +0 -1.91673299502 0.647618266285 1 +6 -1.01099891261 0.791829685822 15 +0 -57.58339586 0.489000093867 10 +7 -0.940311370546 0.0307431656593 5 +7 -0.931053148862 0.949305001821 1 +9 -0.919989033311 0.0632001923291 2 +1 -10.1754688248 0.850402912681 1 +2 -6.95664755815 0.785419414809 6 +4 -2.05055043046 0.51317646351 15 +8 -0.938295044261 0.0269769614225 15 +0 -50.5601878724 0.409876559753 15 +2 -6.66682122114 0.199226708734 4 +3 -3.41808961635 0.00526699929112 10 +2 -2.52322901749 0.588946640545 5 +5 -1.21617648017 0.347811646958 5 +4 -1.00902774728 0.310773757704 9 +2 -6.91482114808 0.533312029691 7 +5 -1.20178556218 0.311911935654 2 +2 -3.42113243143 0.0434345572763 2 +3 -3.95762415788 0.314364936187 18 +5 -0.959049282832 0.484105322855 0 +0 -48.0712146853 0.0756408064991 14 +2 -5.02153570754 0.746859023975 6 +6 -0.940489011332 0.517568166063 13 +9 -0.923413085499 0.628857827971 19 +0 -47.4907391001 0.444388350783 10 +6 -0.982324896181 0.13692431699 10 +1 -11.9645398337 0.282819528552 13 +7 -0.93210422674 0.151247185861 9 +8 -0.928812535035 0.894719164718 14 +0 -21.2603697556 0.663740268121 16 +4 -1.91196334464 0.126624818272 5 +9 -0.925148019704 0.303812281348 14 +8 -0.942453100508 0.780586553608 5 +5 -0.94721780768 0.0544660385831 3 +8 -0.930501754169 0.1962349783 6 +8 -0.923595631798 0.0139533283098 1 +6 -0.978323377957 0.273008495344 5 +2 -8.17557834966 0.652465272038 1 +0 -56.688004064 0.670183471356 9 +4 -1.60879949543 0.608009566073 1 +5 -0.985194605122 0.131241619882 15 +6 -1.04960624498 0.677551089794 13 +2 -4.79692923455 0.0148256150452 12 +0 -1.08359523637 0.955895595478 11 +0 -33.4661450674 0.0618470495574 12 +2 -7.34661162904 0.97306315789 7 +4 -1.46082536029 0.0195966598073 19 +2 -9.04762749659 0.714426475825 5 +6 -0.989025470758 0.986199446783 12 +4 -1.86880226471 0.68535902533 15 +1 -14.0166082614 0.676768568584 10 +4 -1.98373047537 0.453054441034 3 +3 -2.48978708743 0.241794835371 12 +2 -7.05916988655 0.218945608957 3 +7 -0.965113463257 0.0969709155019 3 +4 -1.08556256338 0.798073860562 8 +3 -3.69180740082 0.0405549830844 3 +5 -1.03357601232 0.376421257636 2 +5 -1.22201260828 0.466489666389 17 +6 -0.998406450759 0.918984023158 2 +9 -0.920540683429 0.426595738738 0 +0 -28.311082654 0.508997936964 12 +8 -0.942599807516 0.249918690732 6 +0 -18.2645456955 0.609928372867 6 +1 -2.91569359098 0.494056770174 11 +4 -1.32946945006 0.176397405082 0 +0 -40.208448133 0.917426648488 1 +4 -1.43136967291 0.665164222905 15 +7 -0.943041560792 0.407723921729 10 +9 -0.919781008463 0.750082322817 17 +6 -1.0250826947 0.307265397162 13 +6 -0.967916605921 0.4477713391 4 +0 -51.1266302493 0.955858722235 18 +1 -24.1624971436 0.102274850603 7 +5 -1.18178062968 0.00283122422647 0 +5 -1.31416268224 0.905097944755 4 +5 -1.02081565304 0.479061872211 7 +0 -14.872636969 0.161465914021 5 +9 -0.922865816623 0.651719331617 12 +9 -0.924598192785 0.287128702239 15 +6 -1.00429375221 0.919681679327 6 +1 -10.8270672877 0.556822550839 3 +8 -0.924248862033 0.0262172328983 11 +1 -21.1611010257 0.855367414703 16 +5 -1.32749842584 0.0311677716933 9 +5 -1.31351869938 0.811839067797 18 +3 -3.73440434317 0.166230796196 7 +4 -1.06480299791 0.916274373825 6 +4 -1.83630633858 0.866367726195 10 +3 -2.28539202 0.54500804813 11 +0 -47.8765928205 0.950999646464 16 +8 -0.929543192596 0.3547225443 2 +8 -0.942669928175 0.224741877416 18 +3 -1.07910783863 0.849940814141 4 +8 -0.923427587125 0.341990075187 13 +9 -0.921501848943 0.484645263551 19 +1 -14.6177755932 0.849846248622 11 +3 -1.45764444225 0.775209362663 15 +0 -22.5800691934 0.17106771151 11 +4 -1.29280125942 0.107427820804 16 +6 -1.02466318502 0.759782679209 19 +2 -1.46003880796 0.932420746737 3 +3 -3.03932830498 0.721832992587 13 +7 -0.956386070304 0.376006006907 8 +9 -0.927440808426 0.542273287161 11 +0 -63.7443297455 0.25835943176 10 +8 -0.921311869512 0.875574340419 5 +0 -29.9141669621 0.704280664723 14 +0 -30.2312108048 0.446712196228 18 +9 -0.92535514665 0.776941872307 2 +8 -0.935202497925 0.601785047755 14 +6 -1.00262291785 0.584741121797 7 +8 -0.934628281049 0.924029733668 9 +3 -2.96183644386 0.406198516834 2 +8 -0.938509658375 0.584607762673 18 +9 -0.926121091179 0.641859840519 13 +1 -4.31679174442 0.482378822315 9 +5 -0.956346666623 0.592314709237 3 +3 -1.83848038451 0.2289037001 11 diff --git a/tests/test_gui.py b/tests/test_gui.py index a83d98a1..7b97b547 100644 --- a/tests/test_gui.py +++ b/tests/test_gui.py @@ -39,6 +39,10 @@ def test_gui(root): old = plotter.evolution() plotter.evolution.slider.set_val(5) assert plotter.evolution() != old + old = plotter.evolution() + plotter.evolution.slider.set_val(5.5) + assert plotter.evolution() != old + old = plotter.evolution() plotter.evolution.slider.set_val(0) assert plotter.evolution() == old plotter.type.buttons.set_active(1) diff --git a/tests/test_reader.py b/tests/test_reader.py index 268d8854..5e27a632 100644 --- a/tests/test_reader.py +++ b/tests/test_reader.py @@ -347,6 +347,37 @@ def test_read_dnest(): assert_array_equal(ns.get_labels(), labels) + + assert isinstance(ns, DiffusiveNestedSamples) + assert ns.samples_at_level(9, label='x1').shape == (45, 1) + assert ns.plot_types() == ('visited points',) + + ns.points_to_plot('visited points', label='x1', evolution=0, beta=1, base_color='C0') + + with pytest.raises(ValueError) as exc_info: + ns.points_to_plot('live', label='x1', evolution=0, beta=1, base_color='C0') + assert str(exc_info.value) == 'plot_type not supported' + with pytest.raises(ValueError) as exc_info: + ns.points_to_plot('posterior', label='x1', evolution=0, beta=1, base_color='C0') + assert str(exc_info.value) == 'plot_type not supported' + ns.plot_2d(['x0', 'x1']) + ns.plot_1d(['x0', 'x1']) + + +def test_read_dnest4_no_column_names(): + np.random.seed(3) + ns = read_dnest4('./tests/example_data/dnest4_no_column_names') + params = ['x0', 'x1', 'logL', 'logL_birth', 'nlive'] + assert_array_equal(ns.drop_labels().columns, params) + labels = [r'$x0$', + r'$x1$', + r'$\ln\mathcal{L}$', + r'$\ln\mathcal{L}_\mathrm{birth}$', + r'$n_\mathrm{live}$'] + + assert_array_equal(ns.get_labels(), labels) + assert isinstance(ns, DiffusiveNestedSamples) + assert ns.samples_at_level(9, label='x1').shape == (45, 1) ns.plot_2d(['x0', 'x1']) ns.plot_1d(['x0', 'x1'])