Moved roman_numbers to the top of the module
@@ -20,6 +20,18 @@ import platform
from typing import Union
+# May be extended with higher numbers
+roman_numbers = {
+ 1000: "M",
+ 500: "D",
+ 100: "C",
+ 50: "L",
+ 10: "X",
+ 5: "V",
+ 1: "I",
+}
+
+
class TaskId(collections.namedtuple("TaskId", "name property expected_result runset")):
"""Uniquely identifies a task (name of input file, property, etc.)."""
@@ -303,17 +315,6 @@ def number_to_roman_string(number: Union[int, str]) -> str:
number,
)
- # May be extended with higher numbers
- roman_numbers = {
- 1000: "M",
- 500: "D",
- 100: "C",
- 50: "L",
- 10: "X",
- 5: "V",
- 1: "I",
- }
-
max_number = max(roman_numbers)
# Count specifies how often max_number fits into number
# Number will be the remainder after the divmod (e.g. number < max_number after divmod)
