From fae5b7273ca535385be3020ec4ec32e084dbdb39 Mon Sep 17 00:00:00 2001 From: Qianqian Fang Date: Mon, 27 Nov 2023 22:14:41 -0500 Subject: [PATCH] [pmcx] typecast traj.id from float to uint32, fix #199 --- pmcx/pmcx/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pmcx/pmcx/utils.py b/pmcx/pmcx/utils.py index ef1e41d1..1c691620 100644 --- a/pmcx/pmcx/utils.py +++ b/pmcx/pmcx/utils.py @@ -666,7 +666,7 @@ def mcxlab(*args): if len(data): traj = {} traj["pos"] = np.transpose(data[1:4, :]) - traj["id"] = np.uint32(data[0, :]) + traj["id"] = np.frombuffer(data[0, :].tobytes(), dtype=np.uint32) traj["id"], idx = np.sort(traj["id"]), np.argsort(traj["id"]) traj["pos"] = traj["pos"][idx, :] traj["data"] = np.vstack([np.single(traj["id"]), data[1:, idx]])