Skip to content

Commit

Permalink
add parameter check at class instantiation
Browse files Browse the repository at this point in the history
  • Loading branch information
ikrommyd committed Mar 30, 2024
1 parent e60939d commit 9c4aa7a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions zfit_physics/models/pdf_tsallis.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,13 @@ def __init__(
the PDF for better identification.
Has no programmatical functional purpose as identification. |@docend:pdf.init.name|
"""
if run.executing_eagerly():
if n <= 2:
msg = "n > 2 is required"
raise ValueError(msg)
elif run.numeric_checks:
tf.debugging.assert_greater(n, znp.asarray(2.0), message="n > 2 is required")

params = {"m": m, "t": t, "n": n}
super().__init__(obs=obs, params=params, name=name, extended=extended, norm=norm)

Expand Down

0 comments on commit 9c4aa7a

Please sign in to comment.