Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Necessary changes that were left behind due to recent updates #22

Merged
merged 1 commit into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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