Skip to content

Commit

Permalink
build
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasheinrich committed Oct 13, 2020
1 parent e23b7d4 commit 4f98bf7
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions src/pyhf/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,6 @@ def sorted(cls, workspace):

return cls(newspec)

<<<<<<< HEAD
@classmethod
def build(cls, model, data, name='measurement'):
"""
Expand All @@ -768,28 +767,3 @@ def build(cls, model, data, name='measurement'):
for k in model.config.channels
]
return cls(workspace)
=======

def build(model, data, name='measurement'):
"""
Build a workspace from model and data.
Args:
model (~pyhf.pdf.Model): A model to store into a workspace
model (tensor): A array holding observations to store into a workspace
Returns:
~pyhf.workspace.Workspace: A new workspace object
"""
workspace = dict(channels=copy.deepcopy(model.spec['channels']))
workspace['version'] = utils.SCHEMA_VERSION
workspace['measurements'] = [
{'name': name, 'config': {'poi': model.config.poi_name, 'parameters': []}}
]
workspace['observations'] = [
{'name': k, 'data': data[model.config.channel_slices[k]]}
for k in model.config.channels
]
return workspace
>>>>>>> 6af2f85ad5d82999c7d78822205d854392633dfe

0 comments on commit 4f98bf7

Please sign in to comment.