@@ -160,7 +160,7 @@ def encode_value_in_name(value, name, max_name_len=20):
160
160
if len (encoded_name ) > max_name_len :
161
161
msg = (f"Data information named '{ name } ' is too long (need to be less"
162
162
f" than { max_name_len - (len (str (value )) + 1 )} characters "
163
- f "when storing more than one value for a given data information." )
163
+ "when storing more than one value for a given data information." )
164
164
raise ValueError (msg )
165
165
# Fill to the end with zeros
166
166
return encoded_name .ljust (max_name_len , '\x00 ' ).encode ('latin1' )
@@ -195,8 +195,8 @@ def decode_value_from_name(encoded_name):
195
195
value = int (splits [1 ]) # Decode value.
196
196
elif len (splits ) > 2 :
197
197
# The remaining bytes are not \x00, raising.
198
- msg = (f"Wrong scalar_name or property_name: '{ encoded_name } '."
199
- f" Unused characters should be \\ x00." )
198
+ msg = (f"Wrong scalar_name or property_name: '{ encoded_name } '. "
199
+ " Unused characters should be \\ x00." )
200
200
raise HeaderError (msg )
201
201
202
202
return name , value
@@ -473,8 +473,8 @@ def save(self, fileobj):
473
473
data_for_streamline = first_item .data_for_streamline
474
474
if len (data_for_streamline ) > MAX_NB_NAMED_PROPERTIES_PER_STREAMLINE :
475
475
msg = (f"Can only store { MAX_NB_NAMED_SCALARS_PER_POINT } named "
476
- f "data_per_streamline (also known as 'properties' in the "
477
- f "TRK format)." )
476
+ "data_per_streamline (also known as 'properties' in the "
477
+ "TRK format)." )
478
478
raise ValueError (msg )
479
479
480
480
data_for_streamline_keys = sorted (data_for_streamline .keys ())
@@ -491,8 +491,8 @@ def save(self, fileobj):
491
491
data_for_points = first_item .data_for_points
492
492
if len (data_for_points ) > MAX_NB_NAMED_SCALARS_PER_POINT :
493
493
msg = (f"Can only store { MAX_NB_NAMED_SCALARS_PER_POINT } "
494
- f "named data_per_point (also known as 'scalars' in "
495
- f "the TRK format)." )
494
+ "named data_per_point (also known as 'scalars' in "
495
+ "the TRK format)." )
496
496
raise ValueError (msg )
497
497
498
498
data_for_points_keys = sorted (data_for_points .keys ())
@@ -615,8 +615,8 @@ def _read_header(fileobj):
615
615
# able to determine the axis directions.
616
616
axcodes = aff2axcodes (header [Field .VOXEL_TO_RASMM ])
617
617
if None in axcodes :
618
- msg = (f "The 'vox_to_ras' affine is invalid! Could not"
619
- f " determine the axis directions from it.\n "
618
+ msg = ("The 'vox_to_ras' affine is invalid! Could not"
619
+ " determine the axis directions from it.\n "
620
620
f"{ header [Field .VOXEL_TO_RASMM ]} " )
621
621
raise HeaderError (msg )
622
622
0 commit comments