Workspace¶
-
class
pyhf.pdf.
Workspace
(spec, **config_kwargs)[source]¶ Bases:
object
An object that is built from a JSON spec that follows workspace.json.
Methods
-
__init__
(spec, **config_kwargs)[source]¶ Initialize self. See help(type(self)) for accurate signature.
-
data
(model, with_aux=True)[source]¶ Return the data for the supplied model with or without auxiliary data from the model.
The model is needed as the order of the data depends on the order of the channels in the model.
- Parameters
model – A model object adhering to the schema model.json
with_aux – Whether to include auxiliary data from the model or not
- Returns
A list of numbers
- Return type
data
-
get_measurement
(**config_kwargs)[source]¶ Get (or create) a measurement object using the following logic:
if the poi name is given, create a measurement object for that poi
if the measurement name is given, find the measurement for the given name
if the measurement index is given, return the measurement at that index
if there are measurements but none of the above have been specified, return the 0th measurement
otherwise, raises InvalidMeasurement
- Parameters
poi_name – The name of the parameter of interest to create a new measurement from
measurement_name – The name of the measurement to use
measurement_index – The index of the measurement to use
- Returns
A measurement object adhering to the schema defs.json#/definitions/measurement
- Return type
measurement
-