Skip to content

Commit d36ce1e

Browse files
committed
test: fix typing error
1 parent e890277 commit d36ce1e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pysr/sr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def _process_constraints(
110110

111111
# Apply arity-specific validation for existing constraints
112112
if isinstance(constraints[op], tuple):
113-
constraint_tuple: tuple[int, ...] = constraints[op]
113+
constraint_tuple = cast(Tuple[int, ...], constraints[op])
114114
# Validate that constraint tuple length matches operator arity
115115
if len(constraint_tuple) != arity:
116116
raise ValueError(

pysr/test/test_main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1294,7 +1294,7 @@ def test_deprecated_functions(self):
12941294
def test_power_law_warning(self):
12951295
"""Ensure that a warning is given for a power law operator."""
12961296
with self.assertWarns(UserWarning):
1297-
_process_constraints(["^"], [], {})
1297+
_process_constraints({2: ["^"]}, {})
12981298

12991299
def test_size_warning(self):
13001300
"""Ensure that a warning is given for a large input size."""
@@ -1420,7 +1420,7 @@ def test_suggest_keywords(self):
14201420

14211421
# Farther matches (this might need to be changed)
14221422
with self.assertRaises(TypeError) as cm:
1423-
PySRRegressor(operators=["+", "-"])
1423+
PySRRegressor(nary_operators=["+", "-"])
14241424

14251425
self.assertIn("`unary_operators`, `binary_operators`", str(cm.exception))
14261426

0 commit comments

Comments
 (0)