diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 49bbb3a..d018172 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,7 +10,7 @@ repos: - id: check-added-large-files - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.6.2 + rev: v0.6.3 hooks: - id: ruff args: [ "--fix", "--show-fixes" ] diff --git a/src/phelel/base/Dij_qij.py b/src/phelel/base/Dij_qij.py index 5ec4a84..a808b8b 100644 --- a/src/phelel/base/Dij_qij.py +++ b/src/phelel/base/Dij_qij.py @@ -633,7 +633,7 @@ def run(self, Dij_per, Dij_disps, qij_per, qij_disps, displacements, lm_channels def _allocate_arrays(self, ncdij, lmdim): dtype = "c%d" % (np.dtype("double").itemsize * 2) - natom = self._supercell.get_number_of_atoms() + natom = len(self._supercell) shape = (ncdij, len(self.atom_indices), 3, natom, lmdim, lmdim) self._dDijdu = np.zeros(shape, dtype=dtype, order="C") self._dqijdu = np.zeros(shape, dtype=dtype, order="C") diff --git a/src/phelel/file_IO.py b/src/phelel/file_IO.py index 2f9a8e8..89060b9 100644 --- a/src/phelel/file_IO.py +++ b/src/phelel/file_IO.py @@ -112,7 +112,7 @@ def read_phelel_params_hdf5( cell=f["supercell_lattice"][:].T, scaled_positions=f["supercell_positions"][:], symbols=[atom_data[n][1] for n in f["supercell_numbers"][:]], - masses=f["supercell_masses"], + masses=f["supercell_masses"][:], ) symmetry = Symmetry(supercell) if "atom_indices_in_derivatives" in f: @@ -131,7 +131,7 @@ def read_phelel_params_hdf5( if log_level: print(f'dV/du was read from "{filename}".') - print('dDij/du was read from "{filename}".') + print(f'dDij/du was read from "{filename}".') else: raise FileNotFoundError(f'"{filename}" was not found.') diff --git a/src/phelel/velph/cli/phono3py/init.py b/src/phelel/velph/cli/phono3py/init.py index 0b832d1..5a91393 100644 --- a/src/phelel/velph/cli/phono3py/init.py +++ b/src/phelel/velph/cli/phono3py/init.py @@ -27,7 +27,10 @@ def run_init( """ convcell = parse_cell_dict(toml_dict["unitcell"]) supercell_matrix = toml_dict["phelel"].get("supercell_dimension", None) - phonon_supercell_matrix = toml_dict["phonopy"].get("supercell_dimension", None) + if "phonopy" in toml_dict: + phonon_supercell_matrix = toml_dict["phonopy"].get("supercell_dimension", None) + else: + phonon_supercell_matrix = None if "primitive_cell" in toml_dict: primitive = parse_cell_dict(toml_dict["primitive_cell"]) primitive_matrix = np.dot(np.linalg.inv(convcell.cell.T), primitive.cell.T) diff --git a/test/velph/cli/phono3py/init/test_phono3py_init.py b/test/velph/cli/phono3py/init/test_phono3py_init.py index 0f1586c..cb97d7e 100644 --- a/test/velph/cli/phono3py/init/test_phono3py_init.py +++ b/test/velph/cli/phono3py/init/test_phono3py_init.py @@ -16,7 +16,8 @@ def test_phono3py_init_random_displacements(distance: float): supercell_dimension = [4, 4, 2] amplitude = {distance} fft_mesh = [18, 18, 28] -[vasp.supercell.incar] + +[vasp.phonopy.incar] lwap = true isym = 0 kpar = 2 @@ -31,7 +32,7 @@ def test_phono3py_init_random_displacements(distance: float): lcharg = false addgrid = true lsorbit = true -[vasp.supercell.kpoints] +[vasp.phonopy.kpoints] mesh = [6, 6, 7] [unitcell]