Skip to content

Commit

Permalink
Allow skipping of validation when combining workspaces
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzennio committed Nov 30, 2023
1 parent a1a31f1 commit 38ac6d0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/pyhf/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,9 @@ def rename(self, modifiers=None, samples=None, channels=None, measurements=None)
)

@classmethod
def combine(cls, left, right, join='none', merge_channels=False):
def combine(
cls, left, right, join='none', merge_channels=False, validate: bool = True
):
"""
Return a new workspace specification that is the combination of the two workspaces.
Expand All @@ -733,6 +735,7 @@ def combine(cls, left, right, join='none', merge_channels=False):
right (~pyhf.workspace.Workspace): Another workspace
join (:obj:`str`): How to join the two workspaces. Pick from "none", "outer", "left outer", or "right outer".
merge_channels (:obj:`bool`): Whether or not to merge channels when performing the combine. This is only done with "outer", "left outer", and "right outer" options.
validate (:obj:`bool`): Whether to validate against a JSON schema
Returns:
~pyhf.workspace.Workspace: A new combined workspace object
Expand Down Expand Up @@ -770,7 +773,7 @@ def combine(cls, left, right, join='none', merge_channels=False):
'observations': new_observations,
'version': new_version,
}
return cls(newspec)
return cls(newspec, validate=validate)

@classmethod
def sorted(cls, workspace):
Expand Down

0 comments on commit 38ac6d0

Please sign in to comment.