@@ -290,14 +290,14 @@ def validate_coordinate_transformations(
290290 ct_count = len (coordinate_transformations )
291291 if ct_count != nlevels :
292292 raise ValueError (
293- "coordinate_transformations count: %s must match datasets %s "
294- % ( ct_count , nlevels )
293+ f "coordinate_transformations count: { ct_count } must match "
294+ f"datasets { nlevels } "
295295 )
296296 for transformations in coordinate_transformations :
297297 assert isinstance (transformations , list )
298298 types = [t .get ("type" , None ) for t in transformations ]
299299 if any (t is None for t in types ):
300- raise ValueError ("Missing type in: %s" % transformations )
300+ raise ValueError (f "Missing type in: { transformations } " )
301301 # validate scales...
302302 if sum (t == "scale" for t in types ) != 1 :
303303 raise ValueError (
@@ -308,12 +308,12 @@ def validate_coordinate_transformations(
308308 raise ValueError ("First coordinate_transformations must be 'scale'" )
309309 first = transformations [0 ]
310310 if "scale" not in transformations [0 ]:
311- raise ValueError ("Missing scale argument in: %s" % first )
311+ raise ValueError (f "Missing scale argument in: { first } " )
312312 scale = first ["scale" ]
313313 if len (scale ) != ndim :
314314 raise ValueError (
315- "'scale' list %s must match number of image dimensions: %s "
316- % ( scale , ndim )
315+ f "'scale' list { scale } must match "
316+ f"number of image dimensions: { ndim } "
317317 )
318318 for value in scale :
319319 if not isinstance (value , (float , int )):
@@ -329,12 +329,12 @@ def validate_coordinate_transformations(
329329 elif sum (translation_types ) == 1 :
330330 transformation = transformations [types .index ("translation" )]
331331 if "translation" not in transformation :
332- raise ValueError ("Missing scale argument in: %s" % first )
332+ raise ValueError (f "Missing scale argument in: { first } " )
333333 translation = transformation ["translation" ]
334334 if len (translation ) != ndim :
335335 raise ValueError (
336- "'translation' list %s must match image dimensions count: %s "
337- % ( translation , ndim )
336+ f "'translation' list { translation } must match "
337+ f"image dimensions count: { ndim } "
338338 )
339339 for value in translation :
340340 if not isinstance (value , (float , int )):
0 commit comments