fix(solver): fix a bug where `_auto_enforce` fails to deduce param count
@@ -768,6 +768,10 @@ class SolverSpherical(BaseSolver):
if self.enforcer:
return self.enforcer(net, cond, coordinates)
+ # Base .enforce takes a variable length *arg; n_params should be deduced from .parameterize
+ if cond.__class__.enforce == BaseCondition.enforce:
+ n_params = len(signature(cond.parameterize).parameters)
+ else:
n_params = len(signature(cond.enforce).parameters)
coordinates = coordinates[:n_params - 1]
return cond.enforce(net, *coordinates)
