Merge pull request #163 from Fraser-Birks/adaptivecont-fork #622
GitHub Actions / JUnit Test Report
failed
Jul 6, 2023 in 0s
634 tests run, 39 skipped, 2 failed.
Annotations
Check failure on line 1 in TestDislocation
github-actions / JUnit Test Report
TestDislocation.test_elastic_constants_EAM
NameError: name 'FIRE' is not defined
Raw output
self = <test_dislocation.TestDislocation testMethod=test_elastic_constants_EAM>
def test_elastic_constants_EAM(self):
"""Test the get_elastic_constants()
function using matscipy EAM calculator."""
target_values = np.array([3.1433, # alat
523.03, # C11
202.18, # C12
160.88]) # C44 for eam4
pot_name = "w_eam4.fs"
pot_path = os.path.join(test_dir, pot_name)
calc_EAM = EAM(pot_path)
> obtained_values = sd.get_elastic_constants(calculator=calc_EAM,
delta=1.0e-3)
test_dislocation.py:107:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pot_path = None
calculator = <matscipy.calculators.eam.calculator.EAM object at 0x7fa879df5390>
delta = 0.001, symbol = 'W'
def get_elastic_constants(pot_path=None,
calculator=None,
delta=1e-2,
symbol="W"):
"""
return lattice parameter, and cubic elastic constants: C11, C12, 44
using matscipy function
pot_path - path to the potential
symbol : string
Symbol of the element to pass to ase.lattice.cubic.SimpleCubicFactory
default is "W" for tungsten
"""
unit_cell = bulk(symbol, cubic=True)
if (pot_path is not None) and (calculator is None):
# create lammps calculator with the potential
lammps = LAMMPSlib(lmpcmds=["pair_style eam/fs",
"pair_coeff * * %s W" % pot_path],
atom_types={'W': 1}, keep_alive=True)
calculator = lammps
unit_cell.calc = calculator
# simple calculation to get the lattice constant and cohesive energy
# alat0 = W.cell[0][1] - W.cell[0][0]
sf = StrainFilter(unit_cell)
# or UnitCellFilter(W)
# -> to minimise wrt pos, cell
> opt = FIRE(sf)
E NameError: name 'FIRE' is not defined
/usr/local/lib/python3.10/dist-packages/matscipy/dislocation.py:475: NameError
Check failure on line 1 in TestNeighbourhood
github-actions / JUnit Test Report
TestNeighbourhood.test_triplets
AssertionError: False is not true
Raw output
self = <test_neighbours.TestNeighbourhood testMethod=test_triplets>
def test_triplets(self):
cutoff_pairs = np.array(self.cutoff.get_pairs(self.atoms, "ij")).T
molecules_pairs = np.array(self.molecule.get_pairs(self.atoms, "ij")).T
cutoff_d = self.cutoff.get_triplets(self.atoms, "ijk")
molecule_d = self.molecule.get_triplets(self.atoms, "ijk")
p = np.array([0, 1, 3, 2, 4, 5])
# We compare the refered pairs, not the triplet info directly
for c, m in zip(cutoff_d, molecule_d):
# print("c =", cutoff_pairs[:][c])
# print("m =", molecules_pairs[:][m])
self.assertArrayAlmostEqual(cutoff_pairs[:, 0][c],
molecules_pairs[:, 0][m][p], tol=1e-10)
> self.assertArrayAlmostEqual(cutoff_pairs[:, 1][c],
molecules_pairs[:, 1][m][p], tol=1e-10)
test_neighbours.py:372:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
matscipytest.py:107: in assertArrayAlmostEqual
self.assertTrue((a == b).all())
E AssertionError: False is not true
Loading