Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
style: assign f-string to variable before raise (ruff EM102)
  • Loading branch information
AshrafHosam committed Apr 14, 2026
commit cc0b39cc84e9ead073bf37bd5e84657e5b759020
3 changes: 2 additions & 1 deletion data_compression/coordinate_compression.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ def decompress(self, num: int) -> int | float | str:
IndexError: compressed coordinate 5 is out of range
"""
if not 0 <= num < len(self.reverse_map):
raise IndexError(f"compressed coordinate {num} is out of range")
msg = f"compressed coordinate {num} is out of range"
raise IndexError(msg)
return self.reverse_map[num]


Expand Down