diff --git a/Example.py b/Example.py index ba0b2368d..4c4390d35 100755 --- a/Example.py +++ b/Example.py @@ -25,7 +25,9 @@ import os from smodels.statistics.pyhfInterface import setBackend -setBackend("pytorch") # set to one of: numpy (default), pytorch, tensorflow, jax. WARNING: if backend specified is not found, we fall back to numpy! +# set pyhf backend to one of: numpy (default), pytorch, tensorflow, jax. +# WARNING: if backend specified is not found, we fall back to numpy! +setBackend("pytorch") def main(inputFile='./inputFiles/slha/lightEWinos.slha', sigmacut=0.05*fb, database = 'official'): diff --git a/docs/manual/source/RunningSModelS.rst b/docs/manual/source/RunningSModelS.rst index e6291eb60..b6bb9917b 100644 --- a/docs/manual/source/RunningSModelS.rst +++ b/docs/manual/source/RunningSModelS.rst @@ -402,13 +402,13 @@ Below we go step-by-step through this example code: * *Define the pyhfbackend to use*. Specify which `pyhfbackend `_ to use. One of: numpy, pytorch, tensorflow, jax. .. literalinclude:: /examples/Example.py - :lines: 27-28 + :lines: 27-30 * *Set the path to the database URL*. Specify which :ref:`database ` to use. It can be the path to the smodels-database folder, the path to a :ref:`pickle file ` or (starting with v1.1.3) a URL path. .. literalinclude:: /examples/Example.py - :lines: 36-37 + :lines: 38-39 * *Load the BSM particles*. By default SModelS assumes the MSSM particle content. For using SModelS @@ -416,30 +416,30 @@ Below we go step-by-step through this example code: to the path of the model file (see **particles:model** in :ref:`Parameter File `). .. literalinclude:: /examples/Example.py - :lines: 39-41 + :lines: 41-43 * *Load the model and set the path to the input file*. Load BSM and SM particle content; specify the location of the input file (must be an SLHA or LHE file, see :ref:`Basic Input `) and update particles in the model. .. literalinclude:: /examples/Example.py - :lines: 43,46,48-49 + :lines: 45,48,50-51 * *Set main options for* |decomposition|. Specify the values of :ref:`sigmacut ` and :ref:`minmassgap `: .. literalinclude:: /examples/Example.py - :lines: 52-53 + :lines: 54-55 * |Decompose| *model* using the `decomposer.decompose `_ method. The **doCompress** and **doInvisible** options turn the |mass compression| and |invisible compression| on/off. .. literalinclude:: /examples/Example.py - :lines: 57-59 + :lines: 59-61 * *Access basic information* from decomposition, using the `dictionary of SMS `_ (the dictionary has as keys the :ref:`canonical name ` for the topology and as values the list of |SMS topologies| for the corresponding canonical name): .. literalinclude:: /examples/Example.py - :lines: 62-66 + :lines: 64-68 *output:* @@ -449,7 +449,7 @@ Below we go step-by-step through this example code: * *Print information about the SMS topologies* from the decomposition: .. literalinclude:: /examples/Example.py - :lines: 69-75 + :lines: 71-77 *output:* @@ -461,7 +461,7 @@ Below we go step-by-step through this example code: Here, all results are used: .. literalinclude:: /examples/Example.py - :lines: 79 + :lines: 81 Alternatively, the `getExpResults `_ method can take as arguments specific results to be loaded and used. @@ -470,7 +470,7 @@ can take as arguments specific results to be loaded and used. Below we show how to count the number of |ULrs| and |EMrs| loaded: .. literalinclude:: /examples/Example.py - :lines: 85-92 + :lines: 87-94 *output:* @@ -483,13 +483,13 @@ can take as arguments specific results to be loaded and used. `theory prediction objects `_: .. literalinclude:: /examples/Example.py - :lines: 97 + :lines: 99 * *Print the results*. For each |expres|, loop over the corresponding |theory predictions| and print the relevant information: .. literalinclude:: /examples/Example.py - :lines: 98-107 + :lines: 100-109 *output:* @@ -500,7 +500,7 @@ can take as arguments specific results to be loaded and used. be compared to the |theory prediction| to decide whether a model is excluded or not: .. literalinclude:: /examples/Example.py - :lines: 110 + :lines: 112 *output:* @@ -513,7 +513,7 @@ can take as arguments specific results to be loaded and used. Determine the most constraining result: .. literalinclude:: /examples/Example.py - :lines: 113-119 + :lines: 115-121 *output:* @@ -524,7 +524,7 @@ can take as arguments specific results to be loaded and used. determine if the model has been excluded or not by the selected |express|: .. literalinclude:: /examples/Example.py - :lines: 120-129 + :lines: 122-131 *output:* @@ -535,17 +535,17 @@ can take as arguments specific results to be loaded and used. * *Select analyses*. Using the theory predictions, select a (user-defined) subset of analyses to be combined: .. literalinclude:: /examples/Example.py - :lines: 134-142 + :lines: 136-144 * *Combine analyses*. Using the selected analyses, combine them under the assumption they are fully uncorrelated: .. literalinclude:: /examples/Example.py - :lines: 149 + :lines: 151 * *Print the combination*. Print the *r*-values and likelihoods for the combination: .. literalinclude:: /examples/Example.py - :lines: 154-157 + :lines: 156-159 *output:* @@ -556,7 +556,7 @@ can take as arguments specific results to be loaded and used. the :ref:`missing topologies ` and print some basic information: .. literalinclude:: /examples/Example.py - :lines: 162-168 + :lines: 164-170 *output:* diff --git a/docs/manual/source/examples/Example.py b/docs/manual/source/examples/Example.py index ba0b2368d..4c4390d35 100755 --- a/docs/manual/source/examples/Example.py +++ b/docs/manual/source/examples/Example.py @@ -25,7 +25,9 @@ import os from smodels.statistics.pyhfInterface import setBackend -setBackend("pytorch") # set to one of: numpy (default), pytorch, tensorflow, jax. WARNING: if backend specified is not found, we fall back to numpy! +# set pyhf backend to one of: numpy (default), pytorch, tensorflow, jax. +# WARNING: if backend specified is not found, we fall back to numpy! +setBackend("pytorch") def main(inputFile='./inputFiles/slha/lightEWinos.slha', sigmacut=0.05*fb, database = 'official'):