@@ -294,13 +294,7 @@ def __repr__(self):
294294 """
295295 Returns a string representing the :class:`AnalogSignal`.
296296 """
297- return "<%s(%s, [%s, %s], sampling rate: %s)>" % (
298- self .__class__ .__name__ ,
299- super ().__repr__ (),
300- self .t_start ,
301- self .t_stop ,
302- self .sampling_rate ,
303- )
297+ return f"<{ self .__class__ .__name__ } ({ super ().__repr__ ()} , [{ self .t_start } , { self .t_stop } ], sampling rate: { self .sampling_rate } )>"
304298
305299 def __getitem__ (self , i ):
306300 """
@@ -324,7 +318,7 @@ def __getitem__(self, i):
324318 raise NotImplementedError ("Arrays not yet supported" ) # in the general case, would need to return
325319 # IrregularlySampledSignal(Array)
326320 else :
327- raise TypeError ("%s not supported" % type ( j ) )
321+ raise TypeError (f" { type ( j ) } not supported" )
328322 if isinstance (k , (int , np .integer )):
329323 obj = obj .reshape (- 1 , 1 )
330324 elif k is None :
@@ -473,7 +467,7 @@ def _check_consistency(self, other):
473467 if isinstance (other , AnalogSignal ):
474468 for attr in "t_start" , "sampling_rate" :
475469 if getattr (self , attr ) != getattr (other , attr ):
476- raise ValueError ("Inconsistent values of %s" % attr ) # how to handle name and annotations?
470+ raise ValueError (f "Inconsistent values of { attr } " ) # how to handle name and annotations?
477471
478472 def _repr_pretty_ (self , pp , cycle ):
479473 """
0 commit comments