-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace atomic trajectory cython version with numpy implementation
- Loading branch information
Raunakk Banerjee
committed
Oct 3, 2024
1 parent
0c733b8
commit e35cf46
Showing
4 changed files
with
43 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ | |
.vscode | ||
*.pyc | ||
mdanse_env/ | ||
.venv/ | ||
sandbox/ | ||
|
||
# Distribution / packaging | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import numpy as np | ||
import pytest | ||
from MDANSE.Trajectory.AtomicTrajectory import atomic_trajectory | ||
# from MDANSE.Extensions import atomic_trajectory | ||
|
||
cells = np.array([np.eye(3)]*5) | ||
|
||
def test_constant(): | ||
coords = np.zeros((5, 3)) + 0.5 | ||
atomic_traj = atomic_trajectory(coords, cells, cells, False) | ||
assert np.allclose(atomic_traj, 0.5) | ||
|
||
|
||
def test_one_big_jump(): | ||
coords = np.zeros((5, 3)) + 3.2 | ||
coords[0, 0] = 0.1 | ||
atomic_traj = atomic_trajectory(coords, cells, cells, False) | ||
result = np.zeros((5, 3)) + 3.2 | ||
result[0, 0] = 0.1 | ||
result[1:, 0] = 0.2 | ||
assert np.allclose(atomic_traj, result) | ||
|
||
|
||
|
||
|
||
|