diff --git a/pysindy/feature_library/generalized_library.py b/pysindy/feature_library/generalized_library.py index 3a68f8213..08b93cadb 100644 --- a/pysindy/feature_library/generalized_library.py +++ b/pysindy/feature_library/generalized_library.py @@ -161,7 +161,6 @@ def __init__( self.inputs_per_library_ = inputs_per_library self.libraries_full_ = self.libraries_ self.exclude_libs_ = exclude_libraries - self.calc_trajectory = self.libraries_[0].calc_trajectory @x_sequence_or_item def fit(self, x_full, y=None): @@ -315,6 +314,9 @@ def get_feature_names(self, input_features=None): feature_names += lib.get_feature_names(input_features_i) return feature_names + def calc_trajectory(self, diff_method, x, t): + return self.libraries_[0].calc_trajectory(diff_method, x, t) + def get_spatial_grid(self): for lib_k in self.libraries_: spatial_grid = lib_k.get_spatial_grid() diff --git a/pysindy/feature_library/parameterized_library.py b/pysindy/feature_library/parameterized_library.py index ce4208cd2..1f859e0b8 100644 --- a/pysindy/feature_library/parameterized_library.py +++ b/pysindy/feature_library/parameterized_library.py @@ -113,9 +113,7 @@ def calc_trajectory(self, diff_method, x, t): constants_final = np.ones(self.libraries_[0].K) for k in range(self.libraries_[0].K): constants_final[k] = np.sum(self.libraries_[0].fullweights0[k]) - return ( - self.libraries_[0].calc_trajectory(diff_method, x, t) - * constants_final[:, np.newaxis] - ) + x, x_int = self.libraries_[0].calc_trajectory(diff_method, x, t) + return x, x_int * constants_final[:, np.newaxis] else: return self.libraries_[0].calc_trajectory(diff_method, x, t)