Skip to content

Commit bed9c6b

Browse files
committed
compatible with numpy 2.0
1 parent 7a2759b commit bed9c6b

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

modules/helper/setting.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -262,10 +262,10 @@ def write_config(self):
262262
c = self.config_parser["SENSOR_IMU"]
263263
c["AXIS_SWAP_XY_STATUS"] = str(self.config.G_IMU_AXIS_SWAP_XY["STATUS"])
264264
c["AXIS_CONVERSION_STATUS"] = str(self.config.G_IMU_AXIS_CONVERSION["STATUS"])
265-
c["AXIS_CONVERSION_COEF"] = str(list(self.config.G_IMU_AXIS_CONVERSION["COEF"]))
265+
c["AXIS_CONVERSION_COEF"] = str(self.config.G_IMU_AXIS_CONVERSION["COEF"].tolist())
266266
c["MAG_AXIS_SWAP_XY_STATUS"] = str(self.config.G_IMU_MAG_AXIS_SWAP_XY["STATUS"])
267267
c["MAG_AXIS_CONVERSION_STATUS"] = str(self.config.G_IMU_MAG_AXIS_CONVERSION["STATUS"])
268-
c["MAG_AXIS_CONVERSION_COEF"] = str(list(self.config.G_IMU_MAG_AXIS_CONVERSION["COEF"]))
268+
c["MAG_AXIS_CONVERSION_COEF"] = str(self.config.G_IMU_MAG_AXIS_CONVERSION["COEF"].tolist())
269269
c["MAG_DECLINATION"] = str(int(self.config.G_IMU_MAG_DECLINATION))
270270

271271
self.config_parser["DISPLAY_PARAM"] = {}

modules/utils/filters/savitzky_golay.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ def savitzky_golay(y, window_size, order, deriv=0, rate=1):
1616
order_range = range(order + 1)
1717
half_window = (window_size - 1) // 2
1818
# precompute coefficients
19-
b = np.mat(
19+
# b = np.mat(
20+
b = np.asmatrix(
2021
[[k**i for i in order_range] for k in range(-half_window, half_window + 1)]
2122
)
2223
m = np.linalg.pinv(b).A[deriv] * rate**deriv * factorial(deriv)

0 commit comments

Comments
 (0)