Test that coordinates are correctly transformed from scaled to cartesian and back again.
()
| 88 | |
| 89 | |
| 90 | def test_transformations(): |
| 91 | """Test that coordinates are correctly transformed from scaled to |
| 92 | cartesian and back again. |
| 93 | """ |
| 94 | system = System( |
| 95 | scaled_positions=[[0.0, 0.0, 0.0], [0.5, 0.5, 0.5]], |
| 96 | symbols=["H", "H"], |
| 97 | cell=[[5, 5, 0], [0, -5, -5], [5, 0, 5]], |
| 98 | ) |
| 99 | |
| 100 | orig = np.array([[2, 1.45, -4.8]]) |
| 101 | scal = system.to_scaled(orig) |
| 102 | cart = system.to_cartesian(scal) |
| 103 | assert np.allclose(orig, cart) |
| 104 | |
| 105 | |
| 106 | def test_cell_wrap(): |
nothing calls this directly
no test coverage detected