From f448f886a76178a9c9ce33b208649f47a6a9cd80 Mon Sep 17 00:00:00 2001 From: juacrumar Date: Mon, 15 Apr 2024 17:59:41 +0200 Subject: [PATCH] rebase on top of results-in-pdferr; add exception if from_convolution is ever used --- .../examples/API_extension_Pineappl.ipynb | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/validphys2/examples/API_extension_Pineappl.ipynb b/validphys2/examples/API_extension_Pineappl.ipynb index 1c0311424f..d2be9e3425 100644 --- a/validphys2/examples/API_extension_Pineappl.ipynb +++ b/validphys2/examples/API_extension_Pineappl.ipynb @@ -181,7 +181,6 @@ "def new_results_central_by_theoryid(dataset, pdf, covariance_matrix, sqrt_covmat):\n", " dresult = validphys.results.DataResult(dataset, covariance_matrix, sqrt_covmat)\n", " ####### This is the part that changes wrt validphys\n", - " data_path = Path(f\"results_{dataset.name}_{tid}_{pdf.name}.pkl\")\n", " ret = []\n", " theory_data_per_scale = _pine_predictions(dataset, pdf, central_only=True)\n", " for i, theory_data in enumerate(theory_data_per_scale):\n", @@ -193,7 +192,6 @@ "def new_results(dataset, pdf, covariance_matrix, sqrt_covmat, central_only=False):\n", " dresult = validphys.results.DataResult(dataset, covariance_matrix, sqrt_covmat)\n", " ####### This is the part that changes wrt validphys\n", - " data_path = Path(f\"results_{dataset.name}_{tid}_{pdf.name}.pkl\")\n", " theory_data = _pine_predictions(dataset, pdf, central_only=central_only)[0]\n", " theory_results = validphys.results.ThPredictionsResult(theory_data, pdf.stats_class, pdf=pdf)\n", " #########\n", @@ -204,7 +202,13 @@ "\n", "validphys.results.results = new_results\n", "validphys.results.results_central = new_results_central\n", - "validphys.theorycovariance.construction.results_central_bytheoryids = new_results_central_by_theoryid" + "validphys.theorycovariance.construction.results_central_bytheoryids = new_results_central_by_theoryid\n", + "\n", + "# Make sure that from_convolution is never accessed\n", + "def raise_me(pdf, dataset, **kwargs):\n", + " raise ValueError(\".from_convolution is being used, please report this error!\")\n", + "\n", + "validphys.results.ThPredictionsResult.from_convolution = raise_me" ] }, { @@ -232,7 +236,7 @@ "text": [ "Exp chi2: 0.5382\n", "Exp+th chi2: 0.5037\n", - "Exp+th+pdf chi2: 0.2724\n" + "Exp+th+pdf chi2: 0.425\n" ] } ], @@ -295,6 +299,14 @@ "metadata": {}, "outputs": [], "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "1356c290-b7f0-43c2-a663-659ea6da2df4", + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": {