Fixed frame-index selection in occupancy calculation.
This commit is contained in:
parent
c89cead81c
commit
33c4756e34
@ -80,10 +80,7 @@ def occupation_matrix(
|
|||||||
bins = [x_bins, y_bins, z_bins]
|
bins = [x_bins, y_bins, z_bins]
|
||||||
# Trajectory is split for parallel computing
|
# Trajectory is split for parallel computing
|
||||||
size = math.ceil(len(frame_indices) / nodes)
|
size = math.ceil(len(frame_indices) / nodes)
|
||||||
indices = [
|
indices = [frame_indices[i : i + size] for i in range(0, len(frame_indices), size)]
|
||||||
np.arange(len(frame_indices))[i : i + size]
|
|
||||||
for i in range(0, len(frame_indices), size)
|
|
||||||
]
|
|
||||||
pool = mp.Pool(nodes)
|
pool = mp.Pool(nodes)
|
||||||
results = pool.map(
|
results = pool.map(
|
||||||
partial(_calc_histogram, trajectory=trajectory, bins=bins), indices
|
partial(_calc_histogram, trajectory=trajectory, bins=bins), indices
|
||||||
|
@ -13,19 +13,7 @@ def trajectory(request):
|
|||||||
|
|
||||||
|
|
||||||
def test_get_fel(trajectory):
|
def test_get_fel(trajectory):
|
||||||
test_array = np.array(
|
test_array = np.array([210., 214., 209., 192., 200., 193., 230., 218., 266.])
|
||||||
[
|
|
||||||
184.4909136,
|
|
||||||
233.79320471,
|
|
||||||
223.12003988,
|
|
||||||
228.49746397,
|
|
||||||
200.5626769,
|
|
||||||
212.82484221,
|
|
||||||
165.10818396,
|
|
||||||
170.74123681,
|
|
||||||
175.86672931,
|
|
||||||
]
|
|
||||||
)
|
|
||||||
|
|
||||||
OW = trajectory.subset(atom_name="OW")
|
OW = trajectory.subset(atom_name="OW")
|
||||||
box = trajectory[0].box
|
box = trajectory[0].box
|
||||||
|
Loading…
Reference in New Issue
Block a user