Skip to content

Commit

Permalink
Merge pull request #22 from phonopy/fix
Browse files Browse the repository at this point in the history
Necessary changes that were left behind due to recent updates
  • Loading branch information
atztogo authored Sep 3, 2024
2 parents 3fb27cf + 5e90c25 commit a0f0f0e
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
Expand Down
2 changes: 1 addition & 1 deletion src/phelel/base/Dij_qij.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
4 changes: 2 additions & 2 deletions src/phelel/file_IO.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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.')

Expand Down
5 changes: 4 additions & 1 deletion src/phelel/velph/cli/phono3py/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 3 additions & 2 deletions test/velph/cli/phono3py/init/test_phono3py_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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]
Expand Down

0 comments on commit a0f0f0e

Please sign in to comment.