File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1471,8 +1471,10 @@ def __getstate__(self) -> dict[str, Any]:
14711471 def __setstate__ (self , state : dict [str , Any ]) -> None :
14721472 # ponytail: raise immediately on reload instead of confusing SymPy error later
14731473 self .__dict__ .update (state )
1474- if "equations_" in state and state ["equations_" ] is not None and isinstance (
1475- self .expression_spec , TemplateExpressionSpec
1474+ if (
1475+ "equations_" in state
1476+ and state ["equations_" ] is not None
1477+ and isinstance (self .expression_spec , TemplateExpressionSpec )
14761478 ):
14771479 raise NotImplementedError (
14781480 "Reloading fitted TemplateExpressionSpec models is not yet supported. "
Original file line number Diff line number Diff line change @@ -2249,6 +2249,7 @@ class TestTemplateExpressionSpec(unittest.TestCase):
22492249 def test_reload_raises_clear_error (self ):
22502250 # ponytail: one check — reload of fitted template spec raises immediately
22512251 import pickle
2252+
22522253 model = PySRRegressor (
22532254 expression_spec = TemplateExpressionSpec (
22542255 combine = "f(x)" , expressions = ["f" ], variable_names = ["x" ]
You can’t perform that action at this time.
0 commit comments