Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jan 14, 2025
1 parent 705ade8 commit 33522bd
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 15 deletions.
9 changes: 4 additions & 5 deletions phono3py/conductivity/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def kappa(self):
def get_kappa(self):
"""Return kappa."""
warnings.warn(
"Use attribute, Conductivity.kappa " "instead of Conductivity.get_kappa().",
"Use attribute, Conductivity.kappa instead of Conductivity.get_kappa().",
DeprecationWarning,
stacklevel=2,
)
Expand Down Expand Up @@ -550,7 +550,7 @@ def gamma(self, gamma):
def get_gamma(self):
"""Return gamma."""
warnings.warn(
"Use attribute, Conductivity.gamma " "instead of Conductivity.get_gamma().",
"Use attribute, Conductivity.gamma instead of Conductivity.get_gamma().",
DeprecationWarning,
stacklevel=2,
)
Expand All @@ -559,7 +559,7 @@ def get_gamma(self):
def set_gamma(self, gamma):
"""Set gamma."""
warnings.warn(
"Use attribute, Conductivity.gamma " "instead of Conductivity.set_gamma().",
"Use attribute, Conductivity.gamma instead of Conductivity.set_gamma().",
DeprecationWarning,
stacklevel=2,
)
Expand Down Expand Up @@ -603,8 +603,7 @@ def sigmas(self):
def get_sigmas(self):
"""Return sigmas."""
warnings.warn(
"Use attribute, Conductivity.sigmas "
"instead of Conductivity.get_sigmas().",
"Use attribute, Conductivity.sigmas instead of Conductivity.get_sigmas().",
DeprecationWarning,
stacklevel=2,
)
Expand Down
2 changes: 1 addition & 1 deletion phono3py/conductivity/direct_solution.py
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ def _average_collision_matrix_by_degeneracy(self):
# Average matrix elements belonging to degenerate bands
if self._log_level:
sys.stdout.write(
"- Averaging collision matrix elements " "by phonon degeneracy "
"- Averaging collision matrix elements by phonon degeneracy "
)
sys.stdout.flush()

Expand Down
4 changes: 2 additions & 2 deletions phono3py/cui/kaccum_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ def _get_parser():
parser.add_argument(
"--trace",
action="store_true",
help=("Output the traces of the tensors " "rather than the unique elements"),
help=("Output the traces of the tensors rather than the unique elements"),
)
parser.add_argument(
"--smearing",
Expand Down Expand Up @@ -329,7 +329,7 @@ def main():
conditions = frequencies > 0
if np.logical_not(conditions).sum() > 3:
sys.stderr.write(
"# Imaginary frequencies are found. " "They are set to be zero.\n"
"# Imaginary frequencies are found. They are set to be zero.\n"
)
frequencies = np.where(conditions, frequencies, 0)

Expand Down
2 changes: 1 addition & 1 deletion phono3py/file_IO.py
Original file line number Diff line number Diff line change
Expand Up @@ -1333,7 +1333,7 @@ def read_pp_from_hdf5(
# check_consistency==True in write_pp_to_hdf5 required.
if check_consistency and g_zero is not None:
if verbose:
print("Checking consistency of ph-ph interanction " "strength.")
print("Checking consistency of ph-ph interanction strength.")
assert (g_zero == f["g_zero"][:]).all()
assert np.allclose(pp, f["pp"][:])
else:
Expand Down
2 changes: 1 addition & 1 deletion phono3py/phonon/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ def _get_mock_symmetry_dataset(self, transformation_matrix) -> dict:
tmat_inv = np.linalg.inv(transformation_matrix)
tmat_inv_int = np.rint(tmat_inv).astype(int)
if (tmat_inv - tmat_inv_int > 1e-8).all():
msg = "Inverse of transformation matrix has to be an " "integer matrix."
msg = "Inverse of transformation matrix has to be an integer matrix."
raise RuntimeError(msg)
if determinant(tmat_inv_int) < 0:
msg = "Determinant of transformation matrix has to be positive."
Expand Down
2 changes: 1 addition & 1 deletion phono3py/phonon3/imag_self_energy.py
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ def get_imag_self_energy(
"--------------------"
)
print("Grid point: %d" % gp)
print("Number of ir-triplets: " "%d / %d" % (len(weights), weights.sum()))
print("Number of ir-triplets: %d / %d" % (len(weights), weights.sum()))

ise.run_interaction()
frequencies = interaction.get_phonons()[0][gp]
Expand Down
8 changes: 4 additions & 4 deletions phono3py/phonon3/interaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def fc3(self) -> np.ndarray:
def get_fc3(self):
"""Return fc3."""
warnings.warn(
"Use attribute, Interaction.fc3 " "instead of Interaction.get_fc3().",
"Use attribute, Interaction.fc3 instead of Interaction.get_fc3().",
DeprecationWarning,
stacklevel=2,
)
Expand Down Expand Up @@ -693,12 +693,12 @@ def set_phonon_data(self, frequencies, eigenvectors, bz_grid_addresses):
"""Set phonons on grid."""
if bz_grid_addresses.shape != self._bz_grid.addresses.shape:
raise RuntimeError(
"Input grid address size is inconsistent. " "Setting phonons faild."
"Input grid address size is inconsistent. Setting phonons faild."
)

if (self._bz_grid.addresses - bz_grid_addresses).all():
raise RuntimeError(
"Input grid addresses are inconsistent. " "Setting phonons faild."
"Input grid addresses are inconsistent. Setting phonons faild."
)
else:
self._phonon_done[:] = 1
Expand Down Expand Up @@ -797,7 +797,7 @@ def run_phonon_solver_with_eigvec_rotation(self):

bz_grid_points_solved = self._get_phonons_at_minus_q()
if bz_grid_points_solved:
print("DEBUG: BZ-grid points additionally solved " "than ir-grid-points.")
print("DEBUG: BZ-grid points additionally solved than ir-grid-points.")
qpoints = np.dot(
self._bz_grid.addresses[bz_grid_points_solved]
/ self._bz_grid.D_diag.astype("double"),
Expand Down

0 comments on commit 33522bd

Please sign in to comment.