Skip to content

Commit

Permalink
use for checks
Browse files Browse the repository at this point in the history
  • Loading branch information
comane committed Jun 9, 2023
1 parent 7efa7fd commit 88df97f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions validphys2/src/validphys/checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ def check_pdf_is_montecarlo(ns, **kwargs):
raise CheckError(f"Error type of PDF {pdf} must be 'replicas' and not {etype}")


@make_check
@make_argcheck
def check_pdf_is_montecarlo_or_symmhessian(ns, **kwargs):
pdf = ns['pdf']
etype = pdf.error_type
if (etype != 'replicas') and (etype != 'symmhessian'):
raise CheckError(
f"Error type of PDF {pdf} must be either 'replicas' or 'symmhessian' and not {etype}"
)
check(
etype in {'replicas', 'symhessian'},
f"Error type of PDF {pdf} must be either 'replicas' or 'symmhessian' and not {etype}",
)


@make_check
Expand Down

0 comments on commit 88df97f

Please sign in to comment.