From b5ab199f928ee17a0518d10785144d38479f9ced Mon Sep 17 00:00:00 2001 From: juacrumar Date: Mon, 15 Nov 2021 11:43:45 +0100 Subject: [PATCH 1/4] add a regresion thprediction test for a hessian PDF --- validphys2/src/validphys/tests/conftest.py | 14 +++++++++++ .../regressions/test_thprediction_results.csv | 3 +++ .../test_thprediction_results_hessian.csv | 3 +++ .../src/validphys/tests/test_regressions.py | 24 +++++++++++++++++++ 4 files changed, 44 insertions(+) create mode 100644 validphys2/src/validphys/tests/regressions/test_thprediction_results.csv create mode 100644 validphys2/src/validphys/tests/regressions/test_thprediction_results_hessian.csv diff --git a/validphys2/src/validphys/tests/conftest.py b/validphys2/src/validphys/tests/conftest.py index cf2c153fa1..63770612bd 100644 --- a/validphys2/src/validphys/tests/conftest.py +++ b/validphys2/src/validphys/tests/conftest.py @@ -66,6 +66,13 @@ def data_internal_cuts_config(data_config): config_dict.update(use_cuts='internal') return config_dict +@pytest.fixture(scope='module') +def single_data_internal_cuts_config(data_internal_cuts_config): + config_dict = dict(data_internal_cuts_config) + config_dict.pop("dataset_inputs") + config_dict.update(dataset_input=DATA[0]) + return config_dict + @pytest.fixture(scope='module') def data_witht0_config(): config_dict = dict( @@ -152,3 +159,10 @@ def hessian_data_internal_cuts_config(data_internal_cuts_config): new_config = dict(data_internal_cuts_config) new_config["pdf"] = HESSIAN_PDF return new_config + +@pytest.fixture(scope='module') +def hessian_single_data_internal_cuts_config(single_data_internal_cuts_config): + """Same as data config but with hessian PDF""" + new_config = dict(single_data_internal_cuts_config) + new_config["pdf"] = HESSIAN_PDF + return new_config diff --git a/validphys2/src/validphys/tests/regressions/test_thprediction_results.csv b/validphys2/src/validphys/tests/regressions/test_thprediction_results.csv new file mode 100644 index 0000000000..ea51ba1de4 --- /dev/null +++ b/validphys2/src/validphys/tests/regressions/test_thprediction_results.csv @@ -0,0 +1,3 @@ + 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 +0 0.3552117943763733 0.36789944767951965 0.36790141463279724 0.37267741560935974 0.3738352656364441 0.3738477826118469 0.368956983089447 0.37043607234954834 0.3711569607257843 0.3666095733642578 0.367704302072525 0.36836308240890503 0.36314621567726135 0.36330240964889526 0.36288878321647644 0.353524386882782 0.3527098596096039 0.3519518971443176 0.3517233729362488 0.3366711437702179 0.3345445692539215 0.3311925530433655 0.331525981426239 0.3117638826370239 0.30510565638542175 0.3037455677986145 0.2573825716972351 0.25573989748954773 0.37259605526924133 0.3726899027824402 0.37587711215019226 0.37812119722366333 0.3784932792186737 0.37176159024238586 0.37606269121170044 0.37883487343788147 0.3806123435497284 0.38052549958229065 0.3671613037586212 0.3705226480960846 0.37287604808807373 0.3747601807117462 0.3757287561893463 0.36744293570518494 0.3690122663974762 0.37025776505470276 0.3711031675338745 0.37081870436668396 0.3632119297981262 0.363742470741272 0.3637655973434448 0.3635607063770294 0.3623272180557251 0.35354122519493103 0.3517196774482727 0.35175850987434387 0.3511461317539215 0.3505251407623291 0.3488006293773651 0.3352634906768799 0.3323695659637451 0.3296094238758087 0.3282954692840576 0.32501181960105896 0.3094976544380188 0.3022909462451935 0.2997799813747406 0.29593950510025024 0.2911166548728943 0.26420098543167114 0.24940820038318634 0.24292244017124176 0.23748834431171417 0.159316286444664 0.1461881846189499 0.3771058917045593 0.38309478759765625 0.39133206009864807 0.3952886164188385 0.39831963181495667 0.3884022533893585 0.3951019048690796 0.3990063965320587 0.39881956577301025 0.37527137994766235 0.3822689950466156 0.38795006275177 0.39346542954444885 0.396557092666626 0.39662978053092957 0.3786911070346832 0.3827684819698334 0.3868564963340759 0.39069247245788574 0.3928397297859192 0.3927120268344879 0.37507832050323486 0.3780592381954193 0.38087260723114014 0.38300999999046326 0.3839799463748932 0.3827150762081146 0.3721292018890381 0.37398308515548706 0.3752273619174957 0.3760697841644287 0.375394731760025 0.365077942609787 0.3650404214859009 0.3650830388069153 0.3646349012851715 0.36341533064842224 0.36054757237434387 0.35299310088157654 0.3515250086784363 0.34945034980773926 0.34835729002952576 0.34625279903411865 0.3435204327106476 0.3308887481689453 0.3258650302886963 0.3224591016769409 0.31937161087989807 0.314965158700943 0.29630035161972046 0.292711079120636 0.28698766231536865 0.28100746870040894 0.2763378620147705 0.24436494708061218 0.2341831922531128 0.2270982414484024 0.21935884654521942 0.15003065764904022 0.1306365728378296 0.1233493834733963 0.3914680778980255 0.3956078588962555 0.4023468792438507 0.40531134605407715 0.4077366590499878 0.4011569619178772 0.4099288284778595 0.41589847207069397 0.41731205582618713 0.4168106019496918 0.3925975561141968 0.40085166692733765 0.40883705019950867 0.41556915640830994 0.416147917509079 0.4126019775867462 0.3916209042072296 0.39695826172828674 0.4035800099372864 0.4080353081226349 0.40888693928718567 0.40560367703437805 0.3905435800552368 0.39286255836486816 0.39694252610206604 0.39998772740364075 0.4003906548023224 0.3967117965221405 0.38426005840301514 0.3850317895412445 0.38752511143684387 0.38896143436431885 0.3878083825111389 0.3767269253730774 0.37799620628356934 0.37877628207206726 0.37828388810157776 0.37581318616867065 0.3658371865749359 0.36645886301994324 0.3652689754962921 0.3639148771762848 0.36149829626083374 0.34930285811424255 0.34706515073776245 0.3450043797492981 0.34200072288513184 0.3385894000530243 0.3235433101654053 0.3199431300163269 0.31619101762771606 0.31247416138648987 0.3079622983932495 0.29687586426734924 0.28769585490226746 0.2824299931526184 0.27677762508392334 0.2720159590244293 0.26591956615448 0.2469484955072403 0.22880302369594574 0.22217845916748047 0.21592706441879272 0.20726709067821503 0.15883482992649078 0.13078218698501587 0.12241589277982712 0.11169078201055527 +1 0.0034057728480547667 0.0034565727692097425 0.003148130839690566 0.002972088987007737 0.0027645917143672705 0.0025941296480596066 0.0037308454047888517 0.0033280453644692898 0.0029894893523305655 0.0041872067376971245 0.0036759930662810802 0.003261325415223837 0.0034475834108889103 0.003078252775594592 0.0027549099177122116 0.004111022688448429 0.0036288287956267595 0.0031422381289303303 0.002655594376847148 0.003944032825529575 0.0033962815068662167 0.0028453893028199673 0.0024931614752858877 0.0021649072878062725 0.0020746977534145117 0.0017220894806087017 0.002879419596865773 0.002484554424881935 0.003434942802414298 0.0031852901447564363 0.0034879243467003107 0.0031857299618422985 0.002922946587204933 0.003283943049609661 0.002990243723616004 0.002779746428132057 0.002585142385214567 0.0023965854197740555 0.00438464991748333 0.003777713282033801 0.003359298687428236 0.0029872599989175797 0.0026327536907047033 0.004184555262327194 0.0036818122025579214 0.0032254536636173725 0.0027884948067367077 0.0025360817089676857 0.003362359246239066 0.0030563536565750837 0.002729743719100952 0.0024424695875495672 0.0022313527297228575 0.004769927356392145 0.0042913914658129215 0.0037166778929531574 0.003184567205607891 0.002643611980602145 0.0023049621377140284 0.003798414021730423 0.0032677841372787952 0.002749386476352811 0.0023600903805345297 0.0020005537662655115 0.002282080939039588 0.0022155328188091516 0.0018577603623270988 0.001640703179873526 0.0015070458175614476 0.0028951121494174004 0.0024030348286032677 0.0020290547981858253 0.0017464914126321673 0.0013681247364729643 0.001232636976055801 0.005236274097114801 0.004873471334576607 0.004601756110787392 0.004240089096128941 0.0038504640106111765 0.003514457494020462 0.0033083148300647736 0.003090003738179803 0.0028390486259013414 0.0039760759100317955 0.0035409964621067047 0.0032395964954048395 0.0029475747141987085 0.0027140332385897636 0.002540596527978778 0.0030098722781986 0.002821766072884202 0.0026072682812809944 0.002439674222841859 0.002310327719897032 0.0021900851279497147 0.003334310371428728 0.0029691869858652353 0.002640479477122426 0.0023908272851258516 0.0022043047938495874 0.0020605844911187887 0.0032184929586946964 0.0028043834026902914 0.002506538527086377 0.0022786948829889297 0.002103489125147462 0.002727566286921501 0.002454987494274974 0.002251188736408949 0.002077704994007945 0.0019447640515863895 0.0018321778625249863 0.002968096872791648 0.0026421670336276293 0.0022884043864905834 0.0019872949924319983 0.001778074773028493 0.001634285319596529 0.002395152347162366 0.0020014254841953516 0.0017243600450456142 0.0015442284056916833 0.0014207478379830718 0.0016031641280278563 0.001448870520107448 0.0013499791966751218 0.0012766867876052856 0.001230631023645401 0.0017514871433377266 0.0014881291426718235 0.0013111353619024158 0.0011871196329593658 0.0011010424932464957 0.0010081417858600616 0.0009427779586985707 0.005487227346748114 0.004792842082679272 0.004839753732085228 0.004473244305700064 0.004220102448016405 0.004629521630704403 0.004301422741264105 0.003979190718382597 0.0036797677166759968 0.003375240135937929 0.003536438336595893 0.003325375961139798 0.0031279567629098892 0.0029356172308325768 0.0027679279446601868 0.0025757024995982647 0.003251207061111927 0.002972051501274109 0.002737200353294611 0.0025628891307860613 0.0024204649962484837 0.0022888262756168842 0.002640628954395652 0.002447573933750391 0.00232112524099648 0.0022094878368079662 0.0021090495865792036 0.0020126085728406906 0.002526021795347333 0.0023981048725545406 0.0022027932573109865 0.002052024705335498 0.0019546502735465765 0.002486488549038768 0.0022809964139014482 0.002103895414620638 0.0019832300022244453 0.0018948095384985209 0.0022419665474444628 0.002097882330417633 0.0019485943485051394 0.0018431330099701881 0.001762252883054316 0.0019773179665207863 0.0017673256807029247 0.001632641302421689 0.001547886524349451 0.0014923075214028358 0.0017312156269326806 0.0015423191944137216 0.0014274102868512273 0.0013647652231156826 0.0013224880676716566 0.0013572542229667306 0.0013351731467992067 0.0012680906802415848 0.0012232566950842738 0.0011879632947966456 0.0011638551950454712 0.0015061864396557212 0.001311728497967124 0.0011927267769351602 0.0011150999926030636 0.001050922553986311 0.001011354848742485 0.0009589289547875524 0.0009089406812563539 0.0008529396145604551 diff --git a/validphys2/src/validphys/tests/regressions/test_thprediction_results_hessian.csv b/validphys2/src/validphys/tests/regressions/test_thprediction_results_hessian.csv new file mode 100644 index 0000000000..cdf17b2d22 --- /dev/null +++ b/validphys2/src/validphys/tests/regressions/test_thprediction_results_hessian.csv @@ -0,0 +1,3 @@ + 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 +0 0.3551247715950012 0.36793744564056396 0.3679732382297516 0.372900128364563 0.3740617632865906 0.3740816116333008 0.36948102712631226 0.37093228101730347 0.3716210126876831 0.3672262728214264 0.36827772855758667 0.3688943088054657 0.3636918365955353 0.3638039827346802 0.36334413290023804 0.35381942987442017 0.3529765009880066 0.3521915078163147 0.3519474267959595 0.33678197860717773 0.3346463739871979 0.3312804102897644 0.3316158056259155 0.3117385506629944 0.3050839304924011 0.30375078320503235 0.2573547959327698 0.2557307183742523 0.3725574016571045 0.37267017364501953 0.3759211599826813 0.3781964182853699 0.3786020278930664 0.3719789981842041 0.37628811597824097 0.3790684938430786 0.38084977865219116 0.3807733952999115 0.3677360415458679 0.3710554242134094 0.3733777403831482 0.3752295970916748 0.37616121768951416 0.3680614233016968 0.36958712339401245 0.370786190032959 0.37157750129699707 0.37125492095947266 0.36374637484550476 0.3642405867576599 0.36421698331832886 0.3639638125896454 0.3626866340637207 0.3538358807563782 0.35198140144348145 0.35200798511505127 0.3513711988925934 0.35072827339172363 0.3489786684513092 0.335365891456604 0.3324604630470276 0.3296915590763092 0.32837504148483276 0.3250836730003357 0.30946218967437744 0.30226224660873413 0.29977643489837646 0.29595309495925903 0.2911425828933716 0.26416826248168945 0.2494056522846222 0.24293914437294006 0.23751986026763916 0.15943756699562073 0.14628595113754272 0.37723612785339355 0.3831649124622345 0.391370952129364 0.39532431960105896 0.39836010336875916 0.38840770721435547 0.3951369822025299 0.399061381816864 0.3988926410675049 0.3752785921096802 0.3823241591453552 0.3880339562892914 0.3935800790786743 0.396699994802475 0.3968006372451782 0.3789193630218506 0.38300174474716187 0.38710281252861023 0.39094293117523193 0.3930932879447937 0.3929688334465027 0.3755740523338318 0.37852609157562256 0.3813062906265259 0.3834114670753479 0.384351909160614 0.38305923342704773 0.3726573586463928 0.3744601607322693 0.37565892934799194 0.3764583468437195 0.37574201822280884 0.36553066968917847 0.3654463589191437 0.3654482364654541 0.36495840549468994 0.3637010455131531 0.36079683899879456 0.35323211550712585 0.351734459400177 0.3496283292770386 0.34851571917533875 0.34638965129852295 0.3436371684074402 0.33097732067108154 0.32593974471092224 0.3225266933441162 0.3194335103034973 0.3150196671485901 0.2963176965713501 0.2927418649196625 0.28702878952026367 0.281055748462677 0.27639085054397583 0.24439649283885956 0.2342296987771988 0.2271539866924286 0.21942077577114105 0.1501108705997467 0.13069351017475128 0.12339167296886444 0.39179733395576477 0.3958095908164978 0.40250498056411743 0.40544217824935913 0.4078224003314972 0.4012301564216614 0.4100129008293152 0.4159759283065796 0.41738367080688477 0.41688719391822815 0.3926161527633667 0.4009019136428833 0.4089164435863495 0.41567263007164 0.4162614047527313 0.41273021697998047 0.39169782400131226 0.39708104729652405 0.4037318229675293 0.4082092046737671 0.40907996892929077 0.40581923723220825 0.39077386260032654 0.3931180238723755 0.3972010314464569 0.4002474248409271 0.4006504416465759 0.3969709873199463 0.38466668128967285 0.3854341506958008 0.38789603114128113 0.38930177688598633 0.3881259560585022 0.3771553039550781 0.3783850073814392 0.3791230320930481 0.37859565019607544 0.37609562277793884 0.36620062589645386 0.36678847670555115 0.3655555248260498 0.3641665577888489 0.3617209494113922 0.34946584701538086 0.34720373153686523 0.3451244831085205 0.34210479259490967 0.338680624961853 0.3236132562160492 0.32000645995140076 0.3162476420402527 0.3125266432762146 0.30801066756248474 0.2969154715538025 0.2877383530139923 0.2824788987636566 0.27683186531066895 0.272072970867157 0.2659792900085449 0.24699527025222778 0.2288595736026764 0.22224161028862 0.2159935086965561 0.20733413100242615 0.15890325605869293 0.13082921504974365 0.12245069444179535 0.11171326041221619 +1 0.0032838040497153997 0.002962725004181266 0.002766004763543606 0.0026378293987363577 0.0025150999426841736 0.002411339432001114 0.003134119091555476 0.0028340097051113844 0.002594809513539076 0.0033154867123812437 0.0029427504632622004 0.0026491074822843075 0.0027755056507885456 0.002513607731088996 0.002289528027176857 0.003349230857565999 0.0030011546332389116 0.002659938298165798 0.0023238391149789095 0.003306320868432522 0.0029095252975821495 0.002517675282433629 0.002255708910524845 0.00209492864087224 0.001928719226270914 0.0017106352606788278 0.002160897245630622 0.0019090550485998392 0.0033083923626691103 0.0030629155226051807 0.0029949068557471037 0.0028012997936457396 0.0026263841427862644 0.0028152267914265394 0.002646507928147912 0.00252393982373178 0.0024043694138526917 0.0022831005044281483 0.003614236367866397 0.0031629058066755533 0.0028581866063177586 0.002589976415038109 0.0023375831078737974 0.0033123341854661703 0.0029498334042727947 0.0026253240648657084 0.002322312444448471 0.002148374682292342 0.002724856836721301 0.0025049031246453524 0.0022778157144784927 0.002080988371744752 0.001943611423484981 0.0038631493225693703 0.003478014376014471 0.0030650263652205467 0.0026920505333691835 0.0023203627206385136 0.0020919600501656532 0.0032105378340929747 0.0028316504321992397 0.0024568643420934677 0.0021719131618738174 0.0019145694095641375 0.002119354670867324 0.0019736927933990955 0.0017416541231796145 0.001581789692863822 0.0014689886011183262 0.0021853751968592405 0.001846226747147739 0.0016031863633543253 0.001422436791472137 0.000985745107755065 0.000895761651918292 0.004781998228281736 0.004437706898897886 0.004097001627087593 0.0038439477793872356 0.0035540531389415264 0.003367089666426182 0.0031937607564032078 0.003005840815603733 0.002770761027932167 0.0033105495385825634 0.0030300654470920563 0.0028487949166446924 0.0026658540591597557 0.002509019337594509 0.0023806393146514893 0.0026571855414658785 0.0025478380266577005 0.0024209064431488514 0.002313485136255622 0.0022249084431678057 0.002138042589649558 0.002853807294741273 0.002588106319308281 0.002355925738811493 0.0021837404929101467 0.0020542480051517487 0.00195020018145442 0.002628025598824024 0.002342730527743697 0.0021423054859042168 0.00199486268684268 0.001882757875137031 0.0022764005698263645 0.002093690913170576 0.001959220040589571 0.0018481388688087463 0.0017643949249759316 0.0016942735528573394 0.0025410414673388004 0.0023196313995867968 0.0020825748797506094 0.0018794903298839927 0.0017353784060105681 0.0016305727185681462 0.0021899074781686068 0.0019151507876813412 0.0017127736937254667 0.0015720176743343472 0.0014653508551418781 0.001565190264955163 0.0014490591129288077 0.0013557756319642067 0.0012833813671022654 0.0012372786877676845 0.0014419719809666276 0.0012663677334785461 0.0011498373933136463 0.0010639552492648363 0.0008421519887633622 0.0007716768304817379 0.0007345393532887101 0.005441389046609402 0.004740547854453325 0.004448269493877888 0.004237915389239788 0.0039886971935629845 0.0041014389134943485 0.003882011631503701 0.003670194884762168 0.0034360734280198812 0.0031910736579447985 0.0033857915550470352 0.003202954074367881 0.0030313029419630766 0.0028638977091759443 0.0027166963554918766 0.0025353352539241314 0.0028845651540905237 0.0026787384413182735 0.0025273566134274006 0.0024080444127321243 0.0023006971459835768 0.002193665597587824 0.0024376478977501392 0.002321086125448346 0.0022354163229465485 0.002154658082872629 0.0020779743790626526 0.002001690911129117 0.002312262775376439 0.002193648600950837 0.0020617134869098663 0.0019612452015280724 0.0018878444097936153 0.0021345990244299173 0.0020015002228319645 0.0018907022895291448 0.0018158621387556195 0.0017596466932445765 0.0019541827496141195 0.0018611258128657937 0.001769180642440915 0.001703804126009345 0.0016523328376933932 0.0018723199609667063 0.0017278424929827452 0.0016291494248434901 0.0015603762585669756 0.0015101386234164238 0.0017169385682791471 0.0015703882090747356 0.001470917253755033 0.0014063466805964708 0.0013564915861934423 0.0014261079486459494 0.00135170912835747 0.0012853981461375952 0.0012351649347692728 0.0011967477621510625 0.001163434935733676 0.0013069832930341363 0.0011547000613063574 0.0010741495061665773 0.0010180611861869693 0.0009650606662034988 0.0008255896391347051 0.0007541881059296429 0.0007211813936010003 0.0006797917885705829 diff --git a/validphys2/src/validphys/tests/test_regressions.py b/validphys2/src/validphys/tests/test_regressions.py index eb543fc936..7e575dde6f 100644 --- a/validphys2/src/validphys/tests/test_regressions.py +++ b/validphys2/src/validphys/tests/test_regressions.py @@ -7,6 +7,7 @@ import pathlib import logging import functools +import copy import numpy as np import scipy.linalg as la @@ -102,6 +103,22 @@ def test_predictions(data_internal_cuts_config): th = res_tab.iloc[:, 2:].values return pd.DataFrame(th, columns=map(str, range(th.shape[1])), dtype='float64') +@make_table_comp(sane_load) +def test_thprediction_results(single_data_internal_cuts_config): + pdf = API.pdf(**single_data_internal_cuts_config) + dataset = API.dataset(**single_data_internal_cuts_config) + res = results.ThPredictionsResult.from_convolution(pdf, dataset) + tp = np.stack([res.central_value, res.std_error]) + return pd.DataFrame(tp, columns=map(str, range(tp.shape[1])), dtype='float64') + +@make_table_comp(sane_load) +def test_thprediction_results_hessian(hessian_single_data_internal_cuts_config): + pdf = API.pdf(**hessian_single_data_internal_cuts_config) + dataset = API.dataset(**hessian_single_data_internal_cuts_config) + res = results.ThPredictionsResult.from_convolution(pdf, dataset) + tp = np.stack([res.central_value, res.std_error]) + return pd.DataFrame(tp, columns=map(str, range(tp.shape[1])), dtype='float64') + @make_table_comp(sane_load) def test_dataset_t0_predictions(data_witht0_internal_cuts_config): # TODO: As in `test_predictions` @@ -127,6 +144,13 @@ def test_datasetchi2(data_singleexp_witht0_config): chi2s = API.groups_datasets_chi2_data(**data_singleexp_witht0_config) return results.fits_datasets_chi2_table(['test'], [exps], [chi2s]) +@make_table_comp(load_fits_chi2_table) +def test_datasetchi2(data_singleexp_witht0_config): + # This is a bit hacky but avoids requiring a fit + exps = API.groups_data(**data_singleexp_witht0_config) + chi2s = API.groups_datasets_chi2_data(**data_singleexp_witht0_config) + return results.fits_datasets_chi2_table(['test'], [exps], [chi2s]) + @make_table_comp(sane_load) def test_art_rep_generation(data_config): config = dict(data_config) From 902c07b8ca830efa2e7aef2e6d431e56a5326ea0 Mon Sep 17 00:00:00 2001 From: juacrumar Date: Mon, 15 Nov 2021 11:46:32 +0100 Subject: [PATCH 2/4] add comments --- validphys2/src/validphys/tests/conftest.py | 3 ++- validphys2/src/validphys/tests/test_regressions.py | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/validphys2/src/validphys/tests/conftest.py b/validphys2/src/validphys/tests/conftest.py index 63770612bd..d47f5a10ad 100644 --- a/validphys2/src/validphys/tests/conftest.py +++ b/validphys2/src/validphys/tests/conftest.py @@ -68,6 +68,7 @@ def data_internal_cuts_config(data_config): @pytest.fixture(scope='module') def single_data_internal_cuts_config(data_internal_cuts_config): + """Like data_internal_cuts_config but for a single dataset""" config_dict = dict(data_internal_cuts_config) config_dict.pop("dataset_inputs") config_dict.update(dataset_input=DATA[0]) @@ -162,7 +163,7 @@ def hessian_data_internal_cuts_config(data_internal_cuts_config): @pytest.fixture(scope='module') def hessian_single_data_internal_cuts_config(single_data_internal_cuts_config): - """Same as data config but with hessian PDF""" + """Same as single data config but with hessian PDF""" new_config = dict(single_data_internal_cuts_config) new_config["pdf"] = HESSIAN_PDF return new_config diff --git a/validphys2/src/validphys/tests/test_regressions.py b/validphys2/src/validphys/tests/test_regressions.py index 7e575dde6f..2edcbca315 100644 --- a/validphys2/src/validphys/tests/test_regressions.py +++ b/validphys2/src/validphys/tests/test_regressions.py @@ -105,6 +105,7 @@ def test_predictions(data_internal_cuts_config): @make_table_comp(sane_load) def test_thprediction_results(single_data_internal_cuts_config): + """Test the central prediction and the resulting std deviation for a MC PDF""" pdf = API.pdf(**single_data_internal_cuts_config) dataset = API.dataset(**single_data_internal_cuts_config) res = results.ThPredictionsResult.from_convolution(pdf, dataset) @@ -113,6 +114,7 @@ def test_thprediction_results(single_data_internal_cuts_config): @make_table_comp(sane_load) def test_thprediction_results_hessian(hessian_single_data_internal_cuts_config): + """Test the central prediction and the resulting std deviation for a hessian PDF""" pdf = API.pdf(**hessian_single_data_internal_cuts_config) dataset = API.dataset(**hessian_single_data_internal_cuts_config) res = results.ThPredictionsResult.from_convolution(pdf, dataset) From 861b7b5d230f5d53da6320326d115c0b39760522 Mon Sep 17 00:00:00 2001 From: juacrumar Date: Mon, 15 Nov 2021 11:51:42 +0100 Subject: [PATCH 3/4] transpose for nicer diff --- .../regressions/test_thprediction_results.csv | 208 +++++++++++++++++- .../test_thprediction_results_hessian.csv | 208 +++++++++++++++++- .../src/validphys/tests/test_regressions.py | 4 +- 3 files changed, 412 insertions(+), 8 deletions(-) diff --git a/validphys2/src/validphys/tests/regressions/test_thprediction_results.csv b/validphys2/src/validphys/tests/regressions/test_thprediction_results.csv index ea51ba1de4..075157d717 100644 --- a/validphys2/src/validphys/tests/regressions/test_thprediction_results.csv +++ b/validphys2/src/validphys/tests/regressions/test_thprediction_results.csv @@ -1,3 +1,205 @@ - 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 -0 0.3552117943763733 0.36789944767951965 0.36790141463279724 0.37267741560935974 0.3738352656364441 0.3738477826118469 0.368956983089447 0.37043607234954834 0.3711569607257843 0.3666095733642578 0.367704302072525 0.36836308240890503 0.36314621567726135 0.36330240964889526 0.36288878321647644 0.353524386882782 0.3527098596096039 0.3519518971443176 0.3517233729362488 0.3366711437702179 0.3345445692539215 0.3311925530433655 0.331525981426239 0.3117638826370239 0.30510565638542175 0.3037455677986145 0.2573825716972351 0.25573989748954773 0.37259605526924133 0.3726899027824402 0.37587711215019226 0.37812119722366333 0.3784932792186737 0.37176159024238586 0.37606269121170044 0.37883487343788147 0.3806123435497284 0.38052549958229065 0.3671613037586212 0.3705226480960846 0.37287604808807373 0.3747601807117462 0.3757287561893463 0.36744293570518494 0.3690122663974762 0.37025776505470276 0.3711031675338745 0.37081870436668396 0.3632119297981262 0.363742470741272 0.3637655973434448 0.3635607063770294 0.3623272180557251 0.35354122519493103 0.3517196774482727 0.35175850987434387 0.3511461317539215 0.3505251407623291 0.3488006293773651 0.3352634906768799 0.3323695659637451 0.3296094238758087 0.3282954692840576 0.32501181960105896 0.3094976544380188 0.3022909462451935 0.2997799813747406 0.29593950510025024 0.2911166548728943 0.26420098543167114 0.24940820038318634 0.24292244017124176 0.23748834431171417 0.159316286444664 0.1461881846189499 0.3771058917045593 0.38309478759765625 0.39133206009864807 0.3952886164188385 0.39831963181495667 0.3884022533893585 0.3951019048690796 0.3990063965320587 0.39881956577301025 0.37527137994766235 0.3822689950466156 0.38795006275177 0.39346542954444885 0.396557092666626 0.39662978053092957 0.3786911070346832 0.3827684819698334 0.3868564963340759 0.39069247245788574 0.3928397297859192 0.3927120268344879 0.37507832050323486 0.3780592381954193 0.38087260723114014 0.38300999999046326 0.3839799463748932 0.3827150762081146 0.3721292018890381 0.37398308515548706 0.3752273619174957 0.3760697841644287 0.375394731760025 0.365077942609787 0.3650404214859009 0.3650830388069153 0.3646349012851715 0.36341533064842224 0.36054757237434387 0.35299310088157654 0.3515250086784363 0.34945034980773926 0.34835729002952576 0.34625279903411865 0.3435204327106476 0.3308887481689453 0.3258650302886963 0.3224591016769409 0.31937161087989807 0.314965158700943 0.29630035161972046 0.292711079120636 0.28698766231536865 0.28100746870040894 0.2763378620147705 0.24436494708061218 0.2341831922531128 0.2270982414484024 0.21935884654521942 0.15003065764904022 0.1306365728378296 0.1233493834733963 0.3914680778980255 0.3956078588962555 0.4023468792438507 0.40531134605407715 0.4077366590499878 0.4011569619178772 0.4099288284778595 0.41589847207069397 0.41731205582618713 0.4168106019496918 0.3925975561141968 0.40085166692733765 0.40883705019950867 0.41556915640830994 0.416147917509079 0.4126019775867462 0.3916209042072296 0.39695826172828674 0.4035800099372864 0.4080353081226349 0.40888693928718567 0.40560367703437805 0.3905435800552368 0.39286255836486816 0.39694252610206604 0.39998772740364075 0.4003906548023224 0.3967117965221405 0.38426005840301514 0.3850317895412445 0.38752511143684387 0.38896143436431885 0.3878083825111389 0.3767269253730774 0.37799620628356934 0.37877628207206726 0.37828388810157776 0.37581318616867065 0.3658371865749359 0.36645886301994324 0.3652689754962921 0.3639148771762848 0.36149829626083374 0.34930285811424255 0.34706515073776245 0.3450043797492981 0.34200072288513184 0.3385894000530243 0.3235433101654053 0.3199431300163269 0.31619101762771606 0.31247416138648987 0.3079622983932495 0.29687586426734924 0.28769585490226746 0.2824299931526184 0.27677762508392334 0.2720159590244293 0.26591956615448 0.2469484955072403 0.22880302369594574 0.22217845916748047 0.21592706441879272 0.20726709067821503 0.15883482992649078 0.13078218698501587 0.12241589277982712 0.11169078201055527 -1 0.0034057728480547667 0.0034565727692097425 0.003148130839690566 0.002972088987007737 0.0027645917143672705 0.0025941296480596066 0.0037308454047888517 0.0033280453644692898 0.0029894893523305655 0.0041872067376971245 0.0036759930662810802 0.003261325415223837 0.0034475834108889103 0.003078252775594592 0.0027549099177122116 0.004111022688448429 0.0036288287956267595 0.0031422381289303303 0.002655594376847148 0.003944032825529575 0.0033962815068662167 0.0028453893028199673 0.0024931614752858877 0.0021649072878062725 0.0020746977534145117 0.0017220894806087017 0.002879419596865773 0.002484554424881935 0.003434942802414298 0.0031852901447564363 0.0034879243467003107 0.0031857299618422985 0.002922946587204933 0.003283943049609661 0.002990243723616004 0.002779746428132057 0.002585142385214567 0.0023965854197740555 0.00438464991748333 0.003777713282033801 0.003359298687428236 0.0029872599989175797 0.0026327536907047033 0.004184555262327194 0.0036818122025579214 0.0032254536636173725 0.0027884948067367077 0.0025360817089676857 0.003362359246239066 0.0030563536565750837 0.002729743719100952 0.0024424695875495672 0.0022313527297228575 0.004769927356392145 0.0042913914658129215 0.0037166778929531574 0.003184567205607891 0.002643611980602145 0.0023049621377140284 0.003798414021730423 0.0032677841372787952 0.002749386476352811 0.0023600903805345297 0.0020005537662655115 0.002282080939039588 0.0022155328188091516 0.0018577603623270988 0.001640703179873526 0.0015070458175614476 0.0028951121494174004 0.0024030348286032677 0.0020290547981858253 0.0017464914126321673 0.0013681247364729643 0.001232636976055801 0.005236274097114801 0.004873471334576607 0.004601756110787392 0.004240089096128941 0.0038504640106111765 0.003514457494020462 0.0033083148300647736 0.003090003738179803 0.0028390486259013414 0.0039760759100317955 0.0035409964621067047 0.0032395964954048395 0.0029475747141987085 0.0027140332385897636 0.002540596527978778 0.0030098722781986 0.002821766072884202 0.0026072682812809944 0.002439674222841859 0.002310327719897032 0.0021900851279497147 0.003334310371428728 0.0029691869858652353 0.002640479477122426 0.0023908272851258516 0.0022043047938495874 0.0020605844911187887 0.0032184929586946964 0.0028043834026902914 0.002506538527086377 0.0022786948829889297 0.002103489125147462 0.002727566286921501 0.002454987494274974 0.002251188736408949 0.002077704994007945 0.0019447640515863895 0.0018321778625249863 0.002968096872791648 0.0026421670336276293 0.0022884043864905834 0.0019872949924319983 0.001778074773028493 0.001634285319596529 0.002395152347162366 0.0020014254841953516 0.0017243600450456142 0.0015442284056916833 0.0014207478379830718 0.0016031641280278563 0.001448870520107448 0.0013499791966751218 0.0012766867876052856 0.001230631023645401 0.0017514871433377266 0.0014881291426718235 0.0013111353619024158 0.0011871196329593658 0.0011010424932464957 0.0010081417858600616 0.0009427779586985707 0.005487227346748114 0.004792842082679272 0.004839753732085228 0.004473244305700064 0.004220102448016405 0.004629521630704403 0.004301422741264105 0.003979190718382597 0.0036797677166759968 0.003375240135937929 0.003536438336595893 0.003325375961139798 0.0031279567629098892 0.0029356172308325768 0.0027679279446601868 0.0025757024995982647 0.003251207061111927 0.002972051501274109 0.002737200353294611 0.0025628891307860613 0.0024204649962484837 0.0022888262756168842 0.002640628954395652 0.002447573933750391 0.00232112524099648 0.0022094878368079662 0.0021090495865792036 0.0020126085728406906 0.002526021795347333 0.0023981048725545406 0.0022027932573109865 0.002052024705335498 0.0019546502735465765 0.002486488549038768 0.0022809964139014482 0.002103895414620638 0.0019832300022244453 0.0018948095384985209 0.0022419665474444628 0.002097882330417633 0.0019485943485051394 0.0018431330099701881 0.001762252883054316 0.0019773179665207863 0.0017673256807029247 0.001632641302421689 0.001547886524349451 0.0014923075214028358 0.0017312156269326806 0.0015423191944137216 0.0014274102868512273 0.0013647652231156826 0.0013224880676716566 0.0013572542229667306 0.0013351731467992067 0.0012680906802415848 0.0012232566950842738 0.0011879632947966456 0.0011638551950454712 0.0015061864396557212 0.001311728497967124 0.0011927267769351602 0.0011150999926030636 0.001050922553986311 0.001011354848742485 0.0009589289547875524 0.0009089406812563539 0.0008529396145604551 + 0 1 +0 0.3552117943763733 0.0034057728480547667 +1 0.36789944767951965 0.0034565727692097425 +2 0.36790141463279724 0.003148130839690566 +3 0.37267741560935974 0.002972088987007737 +4 0.3738352656364441 0.0027645917143672705 +5 0.3738477826118469 0.0025941296480596066 +6 0.368956983089447 0.0037308454047888517 +7 0.37043607234954834 0.0033280453644692898 +8 0.3711569607257843 0.0029894893523305655 +9 0.3666095733642578 0.0041872067376971245 +10 0.367704302072525 0.0036759930662810802 +11 0.36836308240890503 0.003261325415223837 +12 0.36314621567726135 0.0034475834108889103 +13 0.36330240964889526 0.003078252775594592 +14 0.36288878321647644 0.0027549099177122116 +15 0.353524386882782 0.004111022688448429 +16 0.3527098596096039 0.0036288287956267595 +17 0.3519518971443176 0.0031422381289303303 +18 0.3517233729362488 0.002655594376847148 +19 0.3366711437702179 0.003944032825529575 +20 0.3345445692539215 0.0033962815068662167 +21 0.3311925530433655 0.0028453893028199673 +22 0.331525981426239 0.0024931614752858877 +23 0.3117638826370239 0.0021649072878062725 +24 0.30510565638542175 0.0020746977534145117 +25 0.3037455677986145 0.0017220894806087017 +26 0.2573825716972351 0.002879419596865773 +27 0.25573989748954773 0.002484554424881935 +28 0.37259605526924133 0.003434942802414298 +29 0.3726899027824402 0.0031852901447564363 +30 0.37587711215019226 0.0034879243467003107 +31 0.37812119722366333 0.0031857299618422985 +32 0.3784932792186737 0.002922946587204933 +33 0.37176159024238586 0.003283943049609661 +34 0.37606269121170044 0.002990243723616004 +35 0.37883487343788147 0.002779746428132057 +36 0.3806123435497284 0.002585142385214567 +37 0.38052549958229065 0.0023965854197740555 +38 0.3671613037586212 0.00438464991748333 +39 0.3705226480960846 0.003777713282033801 +40 0.37287604808807373 0.003359298687428236 +41 0.3747601807117462 0.0029872599989175797 +42 0.3757287561893463 0.0026327536907047033 +43 0.36744293570518494 0.004184555262327194 +44 0.3690122663974762 0.0036818122025579214 +45 0.37025776505470276 0.0032254536636173725 +46 0.3711031675338745 0.0027884948067367077 +47 0.37081870436668396 0.0025360817089676857 +48 0.3632119297981262 0.003362359246239066 +49 0.363742470741272 0.0030563536565750837 +50 0.3637655973434448 0.002729743719100952 +51 0.3635607063770294 0.0024424695875495672 +52 0.3623272180557251 0.0022313527297228575 +53 0.35354122519493103 0.004769927356392145 +54 0.3517196774482727 0.0042913914658129215 +55 0.35175850987434387 0.0037166778929531574 +56 0.3511461317539215 0.003184567205607891 +57 0.3505251407623291 0.002643611980602145 +58 0.3488006293773651 0.0023049621377140284 +59 0.3352634906768799 0.003798414021730423 +60 0.3323695659637451 0.0032677841372787952 +61 0.3296094238758087 0.002749386476352811 +62 0.3282954692840576 0.0023600903805345297 +63 0.32501181960105896 0.0020005537662655115 +64 0.3094976544380188 0.002282080939039588 +65 0.3022909462451935 0.0022155328188091516 +66 0.2997799813747406 0.0018577603623270988 +67 0.29593950510025024 0.001640703179873526 +68 0.2911166548728943 0.0015070458175614476 +69 0.26420098543167114 0.0028951121494174004 +70 0.24940820038318634 0.0024030348286032677 +71 0.24292244017124176 0.0020290547981858253 +72 0.23748834431171417 0.0017464914126321673 +73 0.159316286444664 0.0013681247364729643 +74 0.1461881846189499 0.001232636976055801 +75 0.3771058917045593 0.005236274097114801 +76 0.38309478759765625 0.004873471334576607 +77 0.39133206009864807 0.004601756110787392 +78 0.3952886164188385 0.004240089096128941 +79 0.39831963181495667 0.0038504640106111765 +80 0.3884022533893585 0.003514457494020462 +81 0.3951019048690796 0.0033083148300647736 +82 0.3990063965320587 0.003090003738179803 +83 0.39881956577301025 0.0028390486259013414 +84 0.37527137994766235 0.0039760759100317955 +85 0.3822689950466156 0.0035409964621067047 +86 0.38795006275177 0.0032395964954048395 +87 0.39346542954444885 0.0029475747141987085 +88 0.396557092666626 0.0027140332385897636 +89 0.39662978053092957 0.002540596527978778 +90 0.3786911070346832 0.0030098722781986 +91 0.3827684819698334 0.002821766072884202 +92 0.3868564963340759 0.0026072682812809944 +93 0.39069247245788574 0.002439674222841859 +94 0.3928397297859192 0.002310327719897032 +95 0.3927120268344879 0.0021900851279497147 +96 0.37507832050323486 0.003334310371428728 +97 0.3780592381954193 0.0029691869858652353 +98 0.38087260723114014 0.002640479477122426 +99 0.38300999999046326 0.0023908272851258516 +100 0.3839799463748932 0.0022043047938495874 +101 0.3827150762081146 0.0020605844911187887 +102 0.3721292018890381 0.0032184929586946964 +103 0.37398308515548706 0.0028043834026902914 +104 0.3752273619174957 0.002506538527086377 +105 0.3760697841644287 0.0022786948829889297 +106 0.375394731760025 0.002103489125147462 +107 0.365077942609787 0.002727566286921501 +108 0.3650404214859009 0.002454987494274974 +109 0.3650830388069153 0.002251188736408949 +110 0.3646349012851715 0.002077704994007945 +111 0.36341533064842224 0.0019447640515863895 +112 0.36054757237434387 0.0018321778625249863 +113 0.35299310088157654 0.002968096872791648 +114 0.3515250086784363 0.0026421670336276293 +115 0.34945034980773926 0.0022884043864905834 +116 0.34835729002952576 0.0019872949924319983 +117 0.34625279903411865 0.001778074773028493 +118 0.3435204327106476 0.001634285319596529 +119 0.3308887481689453 0.002395152347162366 +120 0.3258650302886963 0.0020014254841953516 +121 0.3224591016769409 0.0017243600450456142 +122 0.31937161087989807 0.0015442284056916833 +123 0.314965158700943 0.0014207478379830718 +124 0.29630035161972046 0.0016031641280278563 +125 0.292711079120636 0.001448870520107448 +126 0.28698766231536865 0.0013499791966751218 +127 0.28100746870040894 0.0012766867876052856 +128 0.2763378620147705 0.001230631023645401 +129 0.24436494708061218 0.0017514871433377266 +130 0.2341831922531128 0.0014881291426718235 +131 0.2270982414484024 0.0013111353619024158 +132 0.21935884654521942 0.0011871196329593658 +133 0.15003065764904022 0.0011010424932464957 +134 0.1306365728378296 0.0010081417858600616 +135 0.1233493834733963 0.0009427779586985707 +136 0.3914680778980255 0.005487227346748114 +137 0.3956078588962555 0.004792842082679272 +138 0.4023468792438507 0.004839753732085228 +139 0.40531134605407715 0.004473244305700064 +140 0.4077366590499878 0.004220102448016405 +141 0.4011569619178772 0.004629521630704403 +142 0.4099288284778595 0.004301422741264105 +143 0.41589847207069397 0.003979190718382597 +144 0.41731205582618713 0.0036797677166759968 +145 0.4168106019496918 0.003375240135937929 +146 0.3925975561141968 0.003536438336595893 +147 0.40085166692733765 0.003325375961139798 +148 0.40883705019950867 0.0031279567629098892 +149 0.41556915640830994 0.0029356172308325768 +150 0.416147917509079 0.0027679279446601868 +151 0.4126019775867462 0.0025757024995982647 +152 0.3916209042072296 0.003251207061111927 +153 0.39695826172828674 0.002972051501274109 +154 0.4035800099372864 0.002737200353294611 +155 0.4080353081226349 0.0025628891307860613 +156 0.40888693928718567 0.0024204649962484837 +157 0.40560367703437805 0.0022888262756168842 +158 0.3905435800552368 0.002640628954395652 +159 0.39286255836486816 0.002447573933750391 +160 0.39694252610206604 0.00232112524099648 +161 0.39998772740364075 0.0022094878368079662 +162 0.4003906548023224 0.0021090495865792036 +163 0.3967117965221405 0.0020126085728406906 +164 0.38426005840301514 0.002526021795347333 +165 0.3850317895412445 0.0023981048725545406 +166 0.38752511143684387 0.0022027932573109865 +167 0.38896143436431885 0.002052024705335498 +168 0.3878083825111389 0.0019546502735465765 +169 0.3767269253730774 0.002486488549038768 +170 0.37799620628356934 0.0022809964139014482 +171 0.37877628207206726 0.002103895414620638 +172 0.37828388810157776 0.0019832300022244453 +173 0.37581318616867065 0.0018948095384985209 +174 0.3658371865749359 0.0022419665474444628 +175 0.36645886301994324 0.002097882330417633 +176 0.3652689754962921 0.0019485943485051394 +177 0.3639148771762848 0.0018431330099701881 +178 0.36149829626083374 0.001762252883054316 +179 0.34930285811424255 0.0019773179665207863 +180 0.34706515073776245 0.0017673256807029247 +181 0.3450043797492981 0.001632641302421689 +182 0.34200072288513184 0.001547886524349451 +183 0.3385894000530243 0.0014923075214028358 +184 0.3235433101654053 0.0017312156269326806 +185 0.3199431300163269 0.0015423191944137216 +186 0.31619101762771606 0.0014274102868512273 +187 0.31247416138648987 0.0013647652231156826 +188 0.3079622983932495 0.0013224880676716566 +189 0.29687586426734924 0.0013572542229667306 +190 0.28769585490226746 0.0013351731467992067 +191 0.2824299931526184 0.0012680906802415848 +192 0.27677762508392334 0.0012232566950842738 +193 0.2720159590244293 0.0011879632947966456 +194 0.26591956615448 0.0011638551950454712 +195 0.2469484955072403 0.0015061864396557212 +196 0.22880302369594574 0.001311728497967124 +197 0.22217845916748047 0.0011927267769351602 +198 0.21592706441879272 0.0011150999926030636 +199 0.20726709067821503 0.001050922553986311 +200 0.15883482992649078 0.001011354848742485 +201 0.13078218698501587 0.0009589289547875524 +202 0.12241589277982712 0.0009089406812563539 +203 0.11169078201055527 0.0008529396145604551 diff --git a/validphys2/src/validphys/tests/regressions/test_thprediction_results_hessian.csv b/validphys2/src/validphys/tests/regressions/test_thprediction_results_hessian.csv index cdf17b2d22..a40bc449a3 100644 --- a/validphys2/src/validphys/tests/regressions/test_thprediction_results_hessian.csv +++ b/validphys2/src/validphys/tests/regressions/test_thprediction_results_hessian.csv @@ -1,3 +1,205 @@ - 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 -0 0.3551247715950012 0.36793744564056396 0.3679732382297516 0.372900128364563 0.3740617632865906 0.3740816116333008 0.36948102712631226 0.37093228101730347 0.3716210126876831 0.3672262728214264 0.36827772855758667 0.3688943088054657 0.3636918365955353 0.3638039827346802 0.36334413290023804 0.35381942987442017 0.3529765009880066 0.3521915078163147 0.3519474267959595 0.33678197860717773 0.3346463739871979 0.3312804102897644 0.3316158056259155 0.3117385506629944 0.3050839304924011 0.30375078320503235 0.2573547959327698 0.2557307183742523 0.3725574016571045 0.37267017364501953 0.3759211599826813 0.3781964182853699 0.3786020278930664 0.3719789981842041 0.37628811597824097 0.3790684938430786 0.38084977865219116 0.3807733952999115 0.3677360415458679 0.3710554242134094 0.3733777403831482 0.3752295970916748 0.37616121768951416 0.3680614233016968 0.36958712339401245 0.370786190032959 0.37157750129699707 0.37125492095947266 0.36374637484550476 0.3642405867576599 0.36421698331832886 0.3639638125896454 0.3626866340637207 0.3538358807563782 0.35198140144348145 0.35200798511505127 0.3513711988925934 0.35072827339172363 0.3489786684513092 0.335365891456604 0.3324604630470276 0.3296915590763092 0.32837504148483276 0.3250836730003357 0.30946218967437744 0.30226224660873413 0.29977643489837646 0.29595309495925903 0.2911425828933716 0.26416826248168945 0.2494056522846222 0.24293914437294006 0.23751986026763916 0.15943756699562073 0.14628595113754272 0.37723612785339355 0.3831649124622345 0.391370952129364 0.39532431960105896 0.39836010336875916 0.38840770721435547 0.3951369822025299 0.399061381816864 0.3988926410675049 0.3752785921096802 0.3823241591453552 0.3880339562892914 0.3935800790786743 0.396699994802475 0.3968006372451782 0.3789193630218506 0.38300174474716187 0.38710281252861023 0.39094293117523193 0.3930932879447937 0.3929688334465027 0.3755740523338318 0.37852609157562256 0.3813062906265259 0.3834114670753479 0.384351909160614 0.38305923342704773 0.3726573586463928 0.3744601607322693 0.37565892934799194 0.3764583468437195 0.37574201822280884 0.36553066968917847 0.3654463589191437 0.3654482364654541 0.36495840549468994 0.3637010455131531 0.36079683899879456 0.35323211550712585 0.351734459400177 0.3496283292770386 0.34851571917533875 0.34638965129852295 0.3436371684074402 0.33097732067108154 0.32593974471092224 0.3225266933441162 0.3194335103034973 0.3150196671485901 0.2963176965713501 0.2927418649196625 0.28702878952026367 0.281055748462677 0.27639085054397583 0.24439649283885956 0.2342296987771988 0.2271539866924286 0.21942077577114105 0.1501108705997467 0.13069351017475128 0.12339167296886444 0.39179733395576477 0.3958095908164978 0.40250498056411743 0.40544217824935913 0.4078224003314972 0.4012301564216614 0.4100129008293152 0.4159759283065796 0.41738367080688477 0.41688719391822815 0.3926161527633667 0.4009019136428833 0.4089164435863495 0.41567263007164 0.4162614047527313 0.41273021697998047 0.39169782400131226 0.39708104729652405 0.4037318229675293 0.4082092046737671 0.40907996892929077 0.40581923723220825 0.39077386260032654 0.3931180238723755 0.3972010314464569 0.4002474248409271 0.4006504416465759 0.3969709873199463 0.38466668128967285 0.3854341506958008 0.38789603114128113 0.38930177688598633 0.3881259560585022 0.3771553039550781 0.3783850073814392 0.3791230320930481 0.37859565019607544 0.37609562277793884 0.36620062589645386 0.36678847670555115 0.3655555248260498 0.3641665577888489 0.3617209494113922 0.34946584701538086 0.34720373153686523 0.3451244831085205 0.34210479259490967 0.338680624961853 0.3236132562160492 0.32000645995140076 0.3162476420402527 0.3125266432762146 0.30801066756248474 0.2969154715538025 0.2877383530139923 0.2824788987636566 0.27683186531066895 0.272072970867157 0.2659792900085449 0.24699527025222778 0.2288595736026764 0.22224161028862 0.2159935086965561 0.20733413100242615 0.15890325605869293 0.13082921504974365 0.12245069444179535 0.11171326041221619 -1 0.0032838040497153997 0.002962725004181266 0.002766004763543606 0.0026378293987363577 0.0025150999426841736 0.002411339432001114 0.003134119091555476 0.0028340097051113844 0.002594809513539076 0.0033154867123812437 0.0029427504632622004 0.0026491074822843075 0.0027755056507885456 0.002513607731088996 0.002289528027176857 0.003349230857565999 0.0030011546332389116 0.002659938298165798 0.0023238391149789095 0.003306320868432522 0.0029095252975821495 0.002517675282433629 0.002255708910524845 0.00209492864087224 0.001928719226270914 0.0017106352606788278 0.002160897245630622 0.0019090550485998392 0.0033083923626691103 0.0030629155226051807 0.0029949068557471037 0.0028012997936457396 0.0026263841427862644 0.0028152267914265394 0.002646507928147912 0.00252393982373178 0.0024043694138526917 0.0022831005044281483 0.003614236367866397 0.0031629058066755533 0.0028581866063177586 0.002589976415038109 0.0023375831078737974 0.0033123341854661703 0.0029498334042727947 0.0026253240648657084 0.002322312444448471 0.002148374682292342 0.002724856836721301 0.0025049031246453524 0.0022778157144784927 0.002080988371744752 0.001943611423484981 0.0038631493225693703 0.003478014376014471 0.0030650263652205467 0.0026920505333691835 0.0023203627206385136 0.0020919600501656532 0.0032105378340929747 0.0028316504321992397 0.0024568643420934677 0.0021719131618738174 0.0019145694095641375 0.002119354670867324 0.0019736927933990955 0.0017416541231796145 0.001581789692863822 0.0014689886011183262 0.0021853751968592405 0.001846226747147739 0.0016031863633543253 0.001422436791472137 0.000985745107755065 0.000895761651918292 0.004781998228281736 0.004437706898897886 0.004097001627087593 0.0038439477793872356 0.0035540531389415264 0.003367089666426182 0.0031937607564032078 0.003005840815603733 0.002770761027932167 0.0033105495385825634 0.0030300654470920563 0.0028487949166446924 0.0026658540591597557 0.002509019337594509 0.0023806393146514893 0.0026571855414658785 0.0025478380266577005 0.0024209064431488514 0.002313485136255622 0.0022249084431678057 0.002138042589649558 0.002853807294741273 0.002588106319308281 0.002355925738811493 0.0021837404929101467 0.0020542480051517487 0.00195020018145442 0.002628025598824024 0.002342730527743697 0.0021423054859042168 0.00199486268684268 0.001882757875137031 0.0022764005698263645 0.002093690913170576 0.001959220040589571 0.0018481388688087463 0.0017643949249759316 0.0016942735528573394 0.0025410414673388004 0.0023196313995867968 0.0020825748797506094 0.0018794903298839927 0.0017353784060105681 0.0016305727185681462 0.0021899074781686068 0.0019151507876813412 0.0017127736937254667 0.0015720176743343472 0.0014653508551418781 0.001565190264955163 0.0014490591129288077 0.0013557756319642067 0.0012833813671022654 0.0012372786877676845 0.0014419719809666276 0.0012663677334785461 0.0011498373933136463 0.0010639552492648363 0.0008421519887633622 0.0007716768304817379 0.0007345393532887101 0.005441389046609402 0.004740547854453325 0.004448269493877888 0.004237915389239788 0.0039886971935629845 0.0041014389134943485 0.003882011631503701 0.003670194884762168 0.0034360734280198812 0.0031910736579447985 0.0033857915550470352 0.003202954074367881 0.0030313029419630766 0.0028638977091759443 0.0027166963554918766 0.0025353352539241314 0.0028845651540905237 0.0026787384413182735 0.0025273566134274006 0.0024080444127321243 0.0023006971459835768 0.002193665597587824 0.0024376478977501392 0.002321086125448346 0.0022354163229465485 0.002154658082872629 0.0020779743790626526 0.002001690911129117 0.002312262775376439 0.002193648600950837 0.0020617134869098663 0.0019612452015280724 0.0018878444097936153 0.0021345990244299173 0.0020015002228319645 0.0018907022895291448 0.0018158621387556195 0.0017596466932445765 0.0019541827496141195 0.0018611258128657937 0.001769180642440915 0.001703804126009345 0.0016523328376933932 0.0018723199609667063 0.0017278424929827452 0.0016291494248434901 0.0015603762585669756 0.0015101386234164238 0.0017169385682791471 0.0015703882090747356 0.001470917253755033 0.0014063466805964708 0.0013564915861934423 0.0014261079486459494 0.00135170912835747 0.0012853981461375952 0.0012351649347692728 0.0011967477621510625 0.001163434935733676 0.0013069832930341363 0.0011547000613063574 0.0010741495061665773 0.0010180611861869693 0.0009650606662034988 0.0008255896391347051 0.0007541881059296429 0.0007211813936010003 0.0006797917885705829 + 0 1 +0 0.3551247715950012 0.0032838040497153997 +1 0.36793744564056396 0.002962725004181266 +2 0.3679732382297516 0.002766004763543606 +3 0.372900128364563 0.0026378293987363577 +4 0.3740617632865906 0.0025150999426841736 +5 0.3740816116333008 0.002411339432001114 +6 0.36948102712631226 0.003134119091555476 +7 0.37093228101730347 0.0028340097051113844 +8 0.3716210126876831 0.002594809513539076 +9 0.3672262728214264 0.0033154867123812437 +10 0.36827772855758667 0.0029427504632622004 +11 0.3688943088054657 0.0026491074822843075 +12 0.3636918365955353 0.0027755056507885456 +13 0.3638039827346802 0.002513607731088996 +14 0.36334413290023804 0.002289528027176857 +15 0.35381942987442017 0.003349230857565999 +16 0.3529765009880066 0.0030011546332389116 +17 0.3521915078163147 0.002659938298165798 +18 0.3519474267959595 0.0023238391149789095 +19 0.33678197860717773 0.003306320868432522 +20 0.3346463739871979 0.0029095252975821495 +21 0.3312804102897644 0.002517675282433629 +22 0.3316158056259155 0.002255708910524845 +23 0.3117385506629944 0.00209492864087224 +24 0.3050839304924011 0.001928719226270914 +25 0.30375078320503235 0.0017106352606788278 +26 0.2573547959327698 0.002160897245630622 +27 0.2557307183742523 0.0019090550485998392 +28 0.3725574016571045 0.0033083923626691103 +29 0.37267017364501953 0.0030629155226051807 +30 0.3759211599826813 0.0029949068557471037 +31 0.3781964182853699 0.0028012997936457396 +32 0.3786020278930664 0.0026263841427862644 +33 0.3719789981842041 0.0028152267914265394 +34 0.37628811597824097 0.002646507928147912 +35 0.3790684938430786 0.00252393982373178 +36 0.38084977865219116 0.0024043694138526917 +37 0.3807733952999115 0.0022831005044281483 +38 0.3677360415458679 0.003614236367866397 +39 0.3710554242134094 0.0031629058066755533 +40 0.3733777403831482 0.0028581866063177586 +41 0.3752295970916748 0.002589976415038109 +42 0.37616121768951416 0.0023375831078737974 +43 0.3680614233016968 0.0033123341854661703 +44 0.36958712339401245 0.0029498334042727947 +45 0.370786190032959 0.0026253240648657084 +46 0.37157750129699707 0.002322312444448471 +47 0.37125492095947266 0.002148374682292342 +48 0.36374637484550476 0.002724856836721301 +49 0.3642405867576599 0.0025049031246453524 +50 0.36421698331832886 0.0022778157144784927 +51 0.3639638125896454 0.002080988371744752 +52 0.3626866340637207 0.001943611423484981 +53 0.3538358807563782 0.0038631493225693703 +54 0.35198140144348145 0.003478014376014471 +55 0.35200798511505127 0.0030650263652205467 +56 0.3513711988925934 0.0026920505333691835 +57 0.35072827339172363 0.0023203627206385136 +58 0.3489786684513092 0.0020919600501656532 +59 0.335365891456604 0.0032105378340929747 +60 0.3324604630470276 0.0028316504321992397 +61 0.3296915590763092 0.0024568643420934677 +62 0.32837504148483276 0.0021719131618738174 +63 0.3250836730003357 0.0019145694095641375 +64 0.30946218967437744 0.002119354670867324 +65 0.30226224660873413 0.0019736927933990955 +66 0.29977643489837646 0.0017416541231796145 +67 0.29595309495925903 0.001581789692863822 +68 0.2911425828933716 0.0014689886011183262 +69 0.26416826248168945 0.0021853751968592405 +70 0.2494056522846222 0.001846226747147739 +71 0.24293914437294006 0.0016031863633543253 +72 0.23751986026763916 0.001422436791472137 +73 0.15943756699562073 0.000985745107755065 +74 0.14628595113754272 0.000895761651918292 +75 0.37723612785339355 0.004781998228281736 +76 0.3831649124622345 0.004437706898897886 +77 0.391370952129364 0.004097001627087593 +78 0.39532431960105896 0.0038439477793872356 +79 0.39836010336875916 0.0035540531389415264 +80 0.38840770721435547 0.003367089666426182 +81 0.3951369822025299 0.0031937607564032078 +82 0.399061381816864 0.003005840815603733 +83 0.3988926410675049 0.002770761027932167 +84 0.3752785921096802 0.0033105495385825634 +85 0.3823241591453552 0.0030300654470920563 +86 0.3880339562892914 0.0028487949166446924 +87 0.3935800790786743 0.0026658540591597557 +88 0.396699994802475 0.002509019337594509 +89 0.3968006372451782 0.0023806393146514893 +90 0.3789193630218506 0.0026571855414658785 +91 0.38300174474716187 0.0025478380266577005 +92 0.38710281252861023 0.0024209064431488514 +93 0.39094293117523193 0.002313485136255622 +94 0.3930932879447937 0.0022249084431678057 +95 0.3929688334465027 0.002138042589649558 +96 0.3755740523338318 0.002853807294741273 +97 0.37852609157562256 0.002588106319308281 +98 0.3813062906265259 0.002355925738811493 +99 0.3834114670753479 0.0021837404929101467 +100 0.384351909160614 0.0020542480051517487 +101 0.38305923342704773 0.00195020018145442 +102 0.3726573586463928 0.002628025598824024 +103 0.3744601607322693 0.002342730527743697 +104 0.37565892934799194 0.0021423054859042168 +105 0.3764583468437195 0.00199486268684268 +106 0.37574201822280884 0.001882757875137031 +107 0.36553066968917847 0.0022764005698263645 +108 0.3654463589191437 0.002093690913170576 +109 0.3654482364654541 0.001959220040589571 +110 0.36495840549468994 0.0018481388688087463 +111 0.3637010455131531 0.0017643949249759316 +112 0.36079683899879456 0.0016942735528573394 +113 0.35323211550712585 0.0025410414673388004 +114 0.351734459400177 0.0023196313995867968 +115 0.3496283292770386 0.0020825748797506094 +116 0.34851571917533875 0.0018794903298839927 +117 0.34638965129852295 0.0017353784060105681 +118 0.3436371684074402 0.0016305727185681462 +119 0.33097732067108154 0.0021899074781686068 +120 0.32593974471092224 0.0019151507876813412 +121 0.3225266933441162 0.0017127736937254667 +122 0.3194335103034973 0.0015720176743343472 +123 0.3150196671485901 0.0014653508551418781 +124 0.2963176965713501 0.001565190264955163 +125 0.2927418649196625 0.0014490591129288077 +126 0.28702878952026367 0.0013557756319642067 +127 0.281055748462677 0.0012833813671022654 +128 0.27639085054397583 0.0012372786877676845 +129 0.24439649283885956 0.0014419719809666276 +130 0.2342296987771988 0.0012663677334785461 +131 0.2271539866924286 0.0011498373933136463 +132 0.21942077577114105 0.0010639552492648363 +133 0.1501108705997467 0.0008421519887633622 +134 0.13069351017475128 0.0007716768304817379 +135 0.12339167296886444 0.0007345393532887101 +136 0.39179733395576477 0.005441389046609402 +137 0.3958095908164978 0.004740547854453325 +138 0.40250498056411743 0.004448269493877888 +139 0.40544217824935913 0.004237915389239788 +140 0.4078224003314972 0.0039886971935629845 +141 0.4012301564216614 0.0041014389134943485 +142 0.4100129008293152 0.003882011631503701 +143 0.4159759283065796 0.003670194884762168 +144 0.41738367080688477 0.0034360734280198812 +145 0.41688719391822815 0.0031910736579447985 +146 0.3926161527633667 0.0033857915550470352 +147 0.4009019136428833 0.003202954074367881 +148 0.4089164435863495 0.0030313029419630766 +149 0.41567263007164 0.0028638977091759443 +150 0.4162614047527313 0.0027166963554918766 +151 0.41273021697998047 0.0025353352539241314 +152 0.39169782400131226 0.0028845651540905237 +153 0.39708104729652405 0.0026787384413182735 +154 0.4037318229675293 0.0025273566134274006 +155 0.4082092046737671 0.0024080444127321243 +156 0.40907996892929077 0.0023006971459835768 +157 0.40581923723220825 0.002193665597587824 +158 0.39077386260032654 0.0024376478977501392 +159 0.3931180238723755 0.002321086125448346 +160 0.3972010314464569 0.0022354163229465485 +161 0.4002474248409271 0.002154658082872629 +162 0.4006504416465759 0.0020779743790626526 +163 0.3969709873199463 0.002001690911129117 +164 0.38466668128967285 0.002312262775376439 +165 0.3854341506958008 0.002193648600950837 +166 0.38789603114128113 0.0020617134869098663 +167 0.38930177688598633 0.0019612452015280724 +168 0.3881259560585022 0.0018878444097936153 +169 0.3771553039550781 0.0021345990244299173 +170 0.3783850073814392 0.0020015002228319645 +171 0.3791230320930481 0.0018907022895291448 +172 0.37859565019607544 0.0018158621387556195 +173 0.37609562277793884 0.0017596466932445765 +174 0.36620062589645386 0.0019541827496141195 +175 0.36678847670555115 0.0018611258128657937 +176 0.3655555248260498 0.001769180642440915 +177 0.3641665577888489 0.001703804126009345 +178 0.3617209494113922 0.0016523328376933932 +179 0.34946584701538086 0.0018723199609667063 +180 0.34720373153686523 0.0017278424929827452 +181 0.3451244831085205 0.0016291494248434901 +182 0.34210479259490967 0.0015603762585669756 +183 0.338680624961853 0.0015101386234164238 +184 0.3236132562160492 0.0017169385682791471 +185 0.32000645995140076 0.0015703882090747356 +186 0.3162476420402527 0.001470917253755033 +187 0.3125266432762146 0.0014063466805964708 +188 0.30801066756248474 0.0013564915861934423 +189 0.2969154715538025 0.0014261079486459494 +190 0.2877383530139923 0.00135170912835747 +191 0.2824788987636566 0.0012853981461375952 +192 0.27683186531066895 0.0012351649347692728 +193 0.272072970867157 0.0011967477621510625 +194 0.2659792900085449 0.001163434935733676 +195 0.24699527025222778 0.0013069832930341363 +196 0.2288595736026764 0.0011547000613063574 +197 0.22224161028862 0.0010741495061665773 +198 0.2159935086965561 0.0010180611861869693 +199 0.20733413100242615 0.0009650606662034988 +200 0.15890325605869293 0.0008255896391347051 +201 0.13082921504974365 0.0007541881059296429 +202 0.12245069444179535 0.0007211813936010003 +203 0.11171326041221619 0.0006797917885705829 diff --git a/validphys2/src/validphys/tests/test_regressions.py b/validphys2/src/validphys/tests/test_regressions.py index 2edcbca315..3a2b9e4dee 100644 --- a/validphys2/src/validphys/tests/test_regressions.py +++ b/validphys2/src/validphys/tests/test_regressions.py @@ -109,7 +109,7 @@ def test_thprediction_results(single_data_internal_cuts_config): pdf = API.pdf(**single_data_internal_cuts_config) dataset = API.dataset(**single_data_internal_cuts_config) res = results.ThPredictionsResult.from_convolution(pdf, dataset) - tp = np.stack([res.central_value, res.std_error]) + tp = np.stack([res.central_value, res.std_error]).T return pd.DataFrame(tp, columns=map(str, range(tp.shape[1])), dtype='float64') @make_table_comp(sane_load) @@ -118,7 +118,7 @@ def test_thprediction_results_hessian(hessian_single_data_internal_cuts_config): pdf = API.pdf(**hessian_single_data_internal_cuts_config) dataset = API.dataset(**hessian_single_data_internal_cuts_config) res = results.ThPredictionsResult.from_convolution(pdf, dataset) - tp = np.stack([res.central_value, res.std_error]) + tp = np.stack([res.central_value, res.std_error]).T return pd.DataFrame(tp, columns=map(str, range(tp.shape[1])), dtype='float64') @make_table_comp(sane_load) From 06c9191ce1a987efb9cee45295feceb126f25bf0 Mon Sep 17 00:00:00 2001 From: juacrumar Date: Thu, 18 Nov 2021 11:58:18 +0100 Subject: [PATCH 4/4] remove duplicate --- validphys2/src/validphys/tests/test_regressions.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/validphys2/src/validphys/tests/test_regressions.py b/validphys2/src/validphys/tests/test_regressions.py index 3a2b9e4dee..380b02ac45 100644 --- a/validphys2/src/validphys/tests/test_regressions.py +++ b/validphys2/src/validphys/tests/test_regressions.py @@ -7,7 +7,6 @@ import pathlib import logging import functools -import copy import numpy as np import scipy.linalg as la @@ -146,13 +145,6 @@ def test_datasetchi2(data_singleexp_witht0_config): chi2s = API.groups_datasets_chi2_data(**data_singleexp_witht0_config) return results.fits_datasets_chi2_table(['test'], [exps], [chi2s]) -@make_table_comp(load_fits_chi2_table) -def test_datasetchi2(data_singleexp_witht0_config): - # This is a bit hacky but avoids requiring a fit - exps = API.groups_data(**data_singleexp_witht0_config) - chi2s = API.groups_datasets_chi2_data(**data_singleexp_witht0_config) - return results.fits_datasets_chi2_table(['test'], [exps], [chi2s]) - @make_table_comp(sane_load) def test_art_rep_generation(data_config): config = dict(data_config)