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

[pre-commit.ci] pre-commit autoupdate #60

Merged
merged 2 commits into from
Jan 14, 2025
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.8.6
rev: v0.9.1
hooks:
- id: ruff
args: [ "--fix", "--show-fixes" ]
Expand Down
4 changes: 2 additions & 2 deletions src/phelel/base/Dij_qij.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ def _str_format(
):
text = (
f"Spin {i_spinor + 1}, Disp-Atom {i_eatom + 1}, "
f'Atom {i + 1} d{str1}ij/d{"xyz"[j]} {str2} part '
f"Atom {i + 1} d{str1}ij/d{'xyz'[j]} {str2} part "
f"({Dij_shape[0]}, {Dij_shape[1]})\n"
)
for xij_l in xij:
Expand Down Expand Up @@ -303,7 +303,7 @@ def _run_at_atom(self):
sitesyms = self._sitesym_sets[self._i_atom]
natom = len(self._supercell)
lmdim = self._delta_Dij_qijs[0].dDij.shape[-2]
dtype = f'c{np.dtype("double").itemsize * 2}'
dtype = f"c{np.dtype('double').itemsize * 2}"
ncdij = self._dDijdu.shape[0]

lattice = self._supercell.cell.T
Expand Down
6 changes: 3 additions & 3 deletions src/phelel/base/local_potential.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def write(
_filename = "locpot.dat"

if verbose:
print(f'dV_loc is written in "{_filename}" in LOCPOT like ' "format.")
print(f'dV_loc is written in "{_filename}" in LOCPOT like format.')

header = "\n".join(get_vasp_structure_lines(supercell))
locpot = get_CHGCAR(self.dV[0].real, header) # only cdij=0
Expand Down Expand Up @@ -336,7 +336,7 @@ def delta_Vs(self, delta_Vs: list[DeltaLocalPotential]):
]
self._sitesym_sets = sitesym_sets[sitesym_selected_indices]

dtype = f'c{np.dtype("double").itemsize * 2}'
dtype = f"c{np.dtype('double').itemsize * 2}"
ncdij = self._delta_Vs[0].dV.shape[0]
self._dVdu = np.zeros(
(ncdij, len(self._atom_indices_returned), 3, len(self._grid_points)),
Expand Down Expand Up @@ -466,7 +466,7 @@ def _run_finufft(
def _init_finufft(self, ncdij: int):
import finufft

dtype = f'c{np.dtype("double").itemsize * 2}'
dtype = f"c{np.dtype('double').itemsize * 2}"
self._finufft_plan = [
finufft.Plan(
2, self._delta_Vs[0].dV[i].shape, eps=self._finufft_eps, dtype=dtype
Expand Down
4 changes: 1 addition & 3 deletions src/phelel/cui/phelel_argparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,7 @@ def get_parser(load_phelel_yaml=False):
dest="supercell_dimension",
metavar="INT",
default=None,
help=(
"Supercell dimensions with three integers or matrix with " "9 integers"
),
help=("Supercell dimensions with three integers or matrix with 9 integers"),
)
parser.add_argument(
"--dim-phonon",
Expand Down
3 changes: 1 addition & 2 deletions src/phelel/interface/vasp/show_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,7 @@ def locpot(self):
self.V_loc.write_locpot(header)

msg = (
'The local potential is written in "locpot.dat" in VASP '
"LOCPOT-like format."
'The local potential is written in "locpot.dat" in VASP LOCPOT-like format.'
)
import textwrap

Expand Down
4 changes: 2 additions & 2 deletions src/phelel/velph/cli/hints/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def _show_hints(toml_filename: str):
click.echo()
click.echo("# Electron transport calculation")
click.echo(f'1. Write [vasp.transport] section in "{toml_filename}".')
click.echo('2. (optioanl) "velph transport generate": ' "Dry-run to find FFT-mesh.")
click.echo('2. (optioanl) "velph transport generate": Dry-run to find FFT-mesh.')
click.echo("3. (optioanl) Run VASP.")
click.echo('4. (optioanl) "velph transport check-fft": Check FFT grid.')
click.echo('5. (optioanl) Modify "fft_mesh" in [phelel] section manually.')
Expand All @@ -84,7 +84,7 @@ def _show_hints(toml_filename: str):
click.echo("# Electron self-energy calculation")
click.echo(f'1. Modify [vasp.selfenergy] section in "{toml_filename}".')
click.echo(
'2. (optional) "velph selfenergy generate -d": ' "Dry-run to find FFT-mesh."
'2. (optional) "velph selfenergy generate -d": Dry-run to find FFT-mesh.'
)
click.echo("3. (optional) Run VASP.")
click.echo('4. (optioanl) "velph selfenergy check-fft": Check FFT grid.')
Expand Down
8 changes: 3 additions & 5 deletions src/phelel/velph/cli/init/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,11 +306,9 @@ def _collect_init_params(
# Show parameters specified in velph-toml-template file.
if template_toml_filepath:
if len(template_init_params) == 1:
click.echo("Following option was found in " f'"{template_toml_filepath}":')
click.echo(f'Following option was found in "{template_toml_filepath}":')
elif len(template_init_params) > 1:
click.echo(
"Following options were found in " f'"{template_toml_filepath}":'
)
click.echo(f'Following options were found in "{template_toml_filepath}":')
if template_init_params:
click.echo(
"\n".join(
Expand Down Expand Up @@ -1417,7 +1415,7 @@ def _get_displacement_settings_lines(
lines = []
toml_dict = velph_dict.get(calc_type, {})
if "amplitude" in toml_dict:
lines.append(f'amplitude = {toml_dict["amplitude"]}')
lines.append(f"amplitude = {toml_dict['amplitude']}")
else:
lines.append(f"amplitude = {amplitude}")

Expand Down
2 changes: 1 addition & 1 deletion src/phelel/velph/utils/vasp.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def _get_line_mode(toml_dict: dict, cell: PhonopyAtoms) -> list:
for p in list(band_path["path"]):
for i in range(2):
coord = " ".join(
[f'{band_path["point_coords"][p[i]][j]:.8f}' for j in range(3)]
[f"{band_path['point_coords'][p[i]][j]:.8f}" for j in range(3)]
)
lines.append(f"{coord} {p[i]}")
lines.append("")
Expand Down
Loading