예제 #1
0
def test_supercells(simple_cubic):
    supercells = Supercells(input_structure=simple_cubic,
                            min_num_atoms=64,
                            max_num_atoms=100)
    expected = simple_cubic * [[4, 0, 0], [0, 4, 0], [0, 0, 4]]
    assert isinstance(supercells.most_isotropic_supercell, Supercell)
    assert supercells.most_isotropic_supercell.structure == expected
예제 #2
0
    def _generate_supercell(self, crystal_system):
        if self._matrix:
            self.supercell = Supercell(self.conv_structure, self._matrix)
        else:
            if crystal_system == "t":
                supercells = TetragonalSupercells(self.conv_structure,
                                                  **self._supercell_kwargs)
            else:
                supercells = Supercells(self.conv_structure,
                                        **self._supercell_kwargs)

            self.supercell = supercells.most_isotropic_supercell
예제 #3
0
def test_supercells_raise_no_supercell_error(simple_cubic):
    supercells = Supercells(input_structure=simple_cubic,
                            min_num_atoms=10,
                            max_num_atoms=10)
    with pytest.raises(SupercellError):
        print(supercells.most_isotropic_supercell)