Skip to content

Commit

Permalink
bug: replace AxesArray.__dict__ with AxesArray.axes
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob-Stevens-Haas committed Jan 13, 2024
1 parent 0bd7182 commit 46aba19
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
5 changes: 2 additions & 3 deletions pysindy/feature_library/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,9 @@ def correct_shape(self, x: AxesArray):
return x

def calc_trajectory(self, diff_method, x, t):
axes = x.__dict__
x_dot = diff_method(x, t=t)
x = AxesArray(diff_method.smoothed_x_, axes)
return x, AxesArray(x_dot, axes)
x = AxesArray(diff_method.smoothed_x_, x.axes)
return x, AxesArray(x_dot, x.axes)

def get_spatial_grid(self):
return None
Expand Down
2 changes: 1 addition & 1 deletion pysindy/feature_library/generalized_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def transform(self, x_full):
else:
xps.append(lib.transform([x])[0])

xp = AxesArray(np.concatenate(xps, axis=xps[0].ax_coord), xps[0].__dict__)
xp = AxesArray(np.concatenate(xps, axis=xps[0].ax_coord), xps[0].axes)
xp_full = xp_full + [xp]
return xp_full

Expand Down
2 changes: 1 addition & 1 deletion pysindy/feature_library/polynomial_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def transform(self, x_full):
dtype=x.dtype,
order=self.order,
),
x.__dict__,
x.axes,
)
for i, comb in enumerate(combinations):
xp[..., i] = x[..., comb].prod(-1)
Expand Down
2 changes: 1 addition & 1 deletion pysindy/feature_library/sindy_pi_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,5 +404,5 @@ def transform(self, x_full):
*[x[:, comb] for comb in f_combs]
) * f_dot(*[x_dot[:, comb] for comb in f_dot_combs])
library_idx += 1
xp_full = xp_full + [AxesArray(xp, x.__dict__)]
xp_full = xp_full + [AxesArray(xp, x.axes)]
return xp_full

0 comments on commit 46aba19

Please sign in to comment.