Skip to content

Commit 7db5a17

Browse files
removed rns_delta and updated test cases
1 parent c73ea6d commit 7db5a17

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

kerngen/high_parser/options_handler.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,9 @@ def __init__(self, int_min: int, int_max: int, default: int | None):
6363
class OptionsDictFactory(ABC):
6464
"""Abstract class that creates OptionsDict objects"""
6565

66-
MAX_KRNS_DELTA = 128
6766
MAX_DIGIT = 3
68-
MIN_KRNS_DELTA = MIN_DIGIT = 0
67+
MIN_DIGIT = 0
6968
options = {
70-
"krns_delta": OptionsIntBounds(MIN_KRNS_DELTA, MAX_KRNS_DELTA, 0),
7169
"num_digits": OptionsIntBounds(MIN_DIGIT, MAX_DIGIT, None),
7270
}
7371

@@ -134,6 +132,6 @@ def parse(options: list[str]):
134132
).op_value
135133
except ValueError as err:
136134
raise ValueError(
137-
f"Options must be key/value pairs (e.g. krns_delta=1, num_digits=3): '{option}'"
135+
f"Options must be key/value pairs (e.g. num_digits=3): '{option}'"
138136
) from err
139137
return output_dict

kerngen/tests/test_kerngen.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def test_context_options_without_key(kerngen_path):
7878
)
7979
assert not result.stdout
8080
assert (
81-
"ValueError: Options must be key/value pairs (e.g. krns_delta=1, num_digits=3): '1'"
81+
"ValueError: Options must be key/value pairs (e.g. num_digits=3): '1'"
8282
in result.stderr
8383
)
8484
assert result.returncode != 0
@@ -99,14 +99,14 @@ def test_context_unsupported_options_variable(kerngen_path):
9999
@pytest.mark.parametrize("invalid", [-1, 256, 0.1, "str"])
100100
def test_context_option_invalid_values(kerngen_path, invalid):
101101
"""Test kerngen raises an exception if value is out of range for correct key"""
102-
input_string = f"CONTEXT BGV 16384 3 2 krns_delta={invalid}\nData a 2\n"
102+
input_string = f"CONTEXT BGV 16384 3 2 num_digits={invalid}\nData a 2\n"
103103
result = execute_process(
104104
[kerngen_path],
105105
data_in=input_string,
106106
)
107107
assert not result.stdout
108108
assert (
109-
f"ValueError: Options must be key/value pairs (e.g. krns_delta=1, num_digits=3): 'krns_delta={invalid}'"
109+
f"ValueError: Options must be key/value pairs (e.g. num_digits=3): 'num_digits={invalid}'"
110110
in result.stderr
111111
)
112112
assert result.returncode != 0

0 commit comments

Comments
 (0)