@@ -375,7 +375,7 @@ def step_function(
375
375
if fn_kwargs is None :
376
376
fn_kwargs = {}
377
377
if score and not self .op .returns_loss :
378
- raise NotImplementedError ("%s does not have loss" % self . op )
378
+ raise NotImplementedError (f" { self . op } does not have loss" )
379
379
updates = self .updates (
380
380
obj_n_mc = obj_n_mc ,
381
381
tf_n_mc = tf_n_mc ,
@@ -416,7 +416,7 @@ def score_function(
416
416
if fn_kwargs is None :
417
417
fn_kwargs = {}
418
418
if not self .op .returns_loss :
419
- raise NotImplementedError ("%s does not have loss" % self . op )
419
+ raise NotImplementedError (f" { self . op } does not have loss" )
420
420
if more_replacements is None :
421
421
more_replacements = {}
422
422
loss = self (sc_n_mc , more_replacements = more_replacements )
@@ -496,13 +496,13 @@ def apply(self, f): # pragma: no cover
496
496
def __call__ (self , f = None ):
497
497
if self .has_test_function :
498
498
if f is None :
499
- raise ParametrizationError ("Operator %s requires TestFunction" % self )
499
+ raise ParametrizationError (f "Operator { self } requires TestFunction" )
500
500
else :
501
501
if not isinstance (f , TestFunction ):
502
502
f = TestFunction .from_function (f )
503
503
else :
504
504
if f is not None :
505
- warnings .warn ("TestFunction for %s is redundant and removed" % self , stacklevel = 3 )
505
+ warnings .warn (f "TestFunction for { self } is redundant and removed" , stacklevel = 3 )
506
506
else :
507
507
pass
508
508
f = TestFunction ()
@@ -555,7 +555,7 @@ def setup(self, approx):
555
555
@classmethod
556
556
def from_function (cls , f ):
557
557
if not callable (f ):
558
- raise ParametrizationError ("Need callable, got %r" % f )
558
+ raise ParametrizationError (f "Need callable, got { f !r } " )
559
559
obj = TestFunction ()
560
560
obj .__call__ = f
561
561
return obj
@@ -1512,7 +1512,7 @@ def vars_names(vs):
1512
1512
found .name = name + "_vi_random_slice"
1513
1513
break
1514
1514
else :
1515
- raise KeyError ("%r not found" % name )
1515
+ raise KeyError (f" { name !r } not found" )
1516
1516
return found
1517
1517
1518
1518
@node_property
0 commit comments