From ca05bb11b81786aeb4c97b28a33d482a3b0dffd5 Mon Sep 17 00:00:00 2001 From: Matthew Feickert Date: Mon, 26 Oct 2020 01:48:53 -0500 Subject: [PATCH] Use pyhf contrib's download to get pallet Allows for getting everything cleanly from central location of HEPData repo for published analysis --- demo_fit.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/demo_fit.py b/demo_fit.py index fea31e4..7a358e4 100644 --- a/demo_fit.py +++ b/demo_fit.py @@ -4,6 +4,7 @@ NUM_RUNS = 70 import requests from funcx.sdk.client import FuncXClient +from pyhf.contrib.utils import download pyhf_endpoint = 'a727e996-7836-4bec-9fa2-44ebf7ca5302' @@ -40,13 +41,16 @@ def infer_hypotest(w, metadata, doc): infer_func = fxc.register_function(infer_hypotest) -data = requests.get('https://gist.githubusercontent.com/lukasheinrich/75b80a2f8bc49e365bfb96e767c8a726/raw/a0946bc7590c76fec2b70de2f6f46208c0545c8d/BkgOnly.json').json() +# locally get pyhf pallet for analysis +download("https://doi.org/10.17182/hepdata.90607.v3/r3", "1Lbb-pallet") +with open("1Lbb-pallet/BkgOnly.json") as bkgonly_json: + bkgonly_workspace = json.load(bkgonly_json) -prepare_task = fxc.run(data, endpoint_id=pyhf_endpoint, function_id=prepare_func) +prepare_task = fxc.run(bkgonly_workspace, endpoint_id=pyhf_endpoint, function_id=prepare_func) # While this cooks, let's read in the patch set patches = None -with open('patchset.json') as f: +with open('1Lbb-pallet/patchset.json') as f: patches = json.load(f) patch = patches['patches'][0] name = patch['metadata']['name']