Skip to content

Commit cc0b39c

Browse files
committed
style: assign f-string to variable before raise (ruff EM102)
1 parent 7801758 commit cc0b39c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

data_compression/coordinate_compression.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@ def decompress(self, num: int) -> int | float | str:
126126
IndexError: compressed coordinate 5 is out of range
127127
"""
128128
if not 0 <= num < len(self.reverse_map):
129-
raise IndexError(f"compressed coordinate {num} is out of range")
129+
msg = f"compressed coordinate {num} is out of range"
130+
raise IndexError(msg)
130131
return self.reverse_map[num]
131132

132133

0 commit comments

Comments
 (0)