def test_make_recommended_supercell(simple_cubic, simple_cubic_2x2x2, tmpdir): tmpdir.chdir() args = Namespace(unitcell=simple_cubic, matrix=None, min_num_atoms=8, max_num_atoms=8) make_supercell(args) info = loadfn("supercell_info.json") assert IStructure.from_file("SPOSCAR") == simple_cubic_2x2x2 assert info.structure == simple_cubic_2x2x2 assert info.transformation_matrix == [[2, 0, 0], [0, 2, 0], [0, 0, 2]]
def test_make_supercell_from_matrix(simple_cubic, simple_cubic_2x1x1, tmpdir): tmpdir.chdir() matrix = [2, 1, 1] args = Namespace(unitcell=simple_cubic, matrix=matrix, min_num_atoms=None, max_num_atoms=None) make_supercell(args) info = loadfn("supercell_info.json") assert IStructure.from_file("SPOSCAR") == simple_cubic_2x1x1 assert info.structure == simple_cubic_2x1x1 assert info.transformation_matrix == [[2, 0, 0], [0, 1, 0], [0, 0, 1]]