Skip to content

Commit

Permalink
Vaggelis comment on checks
Browse files Browse the repository at this point in the history
  • Loading branch information
MargaretDuff committed Oct 17, 2023
1 parent 5a302c8 commit cf1b7f1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Wrappers/Python/cil/optimisation/operators/Operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ def norm(self, **kwargs):
def set_norm(self, norm=None):
'''Sets the norm of the operator to a custom value.
'''
try:
if norm is not None and norm <=0:
raise ValueError("Norm must be a positive real value or None, got {}".format(norm))
except TypeError:
raise TypeError("Norm must be a positive real value or None, got {} of type {}".format(norm, type(norm)))


if norm is not None and isinstance(norm, Number) is False:
raise TypeError("Norm must be a number or None, got {} of type {}".format(norm, type(norm)))
if isinstance(norm, Number) and norm <=0:
raise ValueError("Norm must be a positive real valued number or None, got {}".format(norm))

self._norm = norm

Expand Down

0 comments on commit cf1b7f1

Please sign in to comment.