Skip to content

Commit 0625a2f

Browse files
authored
np.mat error using pyMBE
While running the pyMBE [tutorial](https://github.com/pyMBE-dev/pyMBE/blob/main/tutorials/pyMBE_tutorial.ipynb) the notebook notified me that `np.mat()` is depreciated in numpy and replaced by `np.asmatrix()`. Short check of the numpy 2.0 docs didn't show a `np.mat()` function anymore.
1 parent 2b7c8f2 commit 0625a2f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/python/espressomd/visualization.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2887,6 +2887,6 @@ def update_modelview(self):
28872887

28882888
self.modelview = trans.dot(rotate_cam.dot(trans_cam))
28892889

2890-
c_xyz = -1 * np.mat(self.modelview[:3, :3]) * \
2891-
np.mat(self.modelview[3, :3]).T
2890+
c_xyz = -1 * np.asmatrix(self.modelview[:3, :3]) * \
2891+
np.asmatrix(self.modelview[3, :3]).T
28922892
self.cam_pos = np.array([c_xyz[0, 0], c_xyz[1, 0], c_xyz[2, 0]])

0 commit comments

Comments
 (0)