diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 67e7a2c..7e756d4 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.8.6 + rev: v0.9.1 hooks: - id: ruff args: [ "--fix", "--show-fixes" ] diff --git a/src/phelel/base/Dij_qij.py b/src/phelel/base/Dij_qij.py index ae3e2a2..b364d6c 100644 --- a/src/phelel/base/Dij_qij.py +++ b/src/phelel/base/Dij_qij.py @@ -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: @@ -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 diff --git a/src/phelel/base/local_potential.py b/src/phelel/base/local_potential.py index a5caf25..f6b431a 100644 --- a/src/phelel/base/local_potential.py +++ b/src/phelel/base/local_potential.py @@ -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 @@ -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)), @@ -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 diff --git a/src/phelel/cui/phelel_argparse.py b/src/phelel/cui/phelel_argparse.py index 495bbc5..f8ef204 100644 --- a/src/phelel/cui/phelel_argparse.py +++ b/src/phelel/cui/phelel_argparse.py @@ -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", diff --git a/src/phelel/interface/vasp/show_data.py b/src/phelel/interface/vasp/show_data.py index 5134c76..7f069a4 100644 --- a/src/phelel/interface/vasp/show_data.py +++ b/src/phelel/interface/vasp/show_data.py @@ -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 diff --git a/src/phelel/velph/cli/hints/__init__.py b/src/phelel/velph/cli/hints/__init__.py index bed3d31..40ef6b3 100644 --- a/src/phelel/velph/cli/hints/__init__.py +++ b/src/phelel/velph/cli/hints/__init__.py @@ -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.') @@ -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.') diff --git a/src/phelel/velph/cli/init/init.py b/src/phelel/velph/cli/init/init.py index 303320f..0e68817 100644 --- a/src/phelel/velph/cli/init/init.py +++ b/src/phelel/velph/cli/init/init.py @@ -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( @@ -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}") diff --git a/src/phelel/velph/utils/vasp.py b/src/phelel/velph/utils/vasp.py index f3cf9e9..7531019 100644 --- a/src/phelel/velph/utils/vasp.py +++ b/src/phelel/velph/utils/vasp.py @@ -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("")