Skip to content

Commit

Permalink
CLN: sindyderivative calculate values before assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
yb6599 committed Jun 2, 2024
1 parent 7268ee1 commit f9bf57f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pysindy/differentiation/sindy_derivative.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ def _differentiate(self, x, t=1):
flat_x = x.reshape((t.size, int(x.size / t.size)))
flat_x_dot = differentiator.d(flat_x, t, axis=0)
if self.save_smooth:
self.smoothed_x_ = differentiator.x(flat_x, t, axis=0)
smoothed_x_ = differentiator.x(flat_x, t, axis=0)
else:
self.smoothed_x_ = flat_x
smoothed_x_ = flat_x
x_dot = flat_x_dot.reshape(x_shape)
self.smoothed_x_ = self.smoothed_x_.reshape(x_shape)
smoothed_x_ = smoothed_x_.reshape(x_shape)
x_dot = np.moveaxis(x_dot, 0, self.axis)
self.smoothed_x_ = np.moveaxis(self.smoothed_x_, 0, self.axis)
self.smoothed_x_ = np.moveaxis(smoothed_x_, 0, self.axis)
return x_dot

0 comments on commit f9bf57f

Please sign in to comment.