From 638e4bb1657ee9a7caaeca753ec0749f32f194fa Mon Sep 17 00:00:00 2001 From: Alan Kaptanoglu Date: Fri, 1 Dec 2023 13:00:32 -0500 Subject: [PATCH] Fixed import error with Tuple(cp) --- pysindy/optimizers/stable_linear_sr3.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pysindy/optimizers/stable_linear_sr3.py b/pysindy/optimizers/stable_linear_sr3.py index fd1cdd704..106e784b6 100644 --- a/pysindy/optimizers/stable_linear_sr3.py +++ b/pysindy/optimizers/stable_linear_sr3.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import warnings from typing import Tuple @@ -205,7 +207,7 @@ def _create_var_and_part_cost( y: np.ndarray, coef_sparse: np.ndarray, coef_neg_def: np.ndarray, - ) -> Tuple[cp.Variable, cp.Expression]: + ) -> Tuple["cp.Variable", "cp.Expression"]: xi = cp.Variable(coef_sparse.shape[0] * coef_sparse.shape[1]) cost = cp.sum_squares(x @ xi - y.flatten()) cost = cost + cp.sum_squares(xi - coef_neg_def.flatten()) / (2 * self.nu)