-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
531 additions
and
37 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
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,20 @@ | ||
"""Tests for deformation_utils module""" | ||
import numpy as np | ||
import abipy.data as abidata | ||
|
||
from abipy.core.testing import AbipyTest | ||
from abipy.dfpt.deformation_utils import generate_deformations | ||
|
||
|
||
class DeformationUtilsTest(AbipyTest): | ||
|
||
def test_generate_deformations(self): | ||
"""Testing generate_deformations""" | ||
eps = 0.005 | ||
si = self.get_structure("Si") | ||
structures_dict, strain_inds, spgrp_number = generate_deformations(si, eps) | ||
assert len(structures_dict) == 3 | ||
assert spgrp_number == 227 | ||
assert strain_inds.shape == (3, 6) | ||
self.assert_equal(strain_inds[:, 0], [0, 1, 2]) | ||
assert np.all(strain_inds[1:, 1] == 0) |
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
Oops, something went wrong.