Skip to content

Commit

Permalink
change function name to solve the conflict with hiphive function
Browse files Browse the repository at this point in the history
  • Loading branch information
leslie-zheng committed Jul 1, 2024
1 parent c4dbb52 commit a066ba5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/atomate2/common/jobs/phonons.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
CubicSupercellTransformation,
)

from atomate2.common.schemas.phonons import ForceConstants, PhononBSDOSDoc, get_factor
from atomate2.common.schemas.phonons import Forceconstants, PhononBSDOSDoc, get_factor

if TYPE_CHECKING:
from pathlib import Path
Expand Down Expand Up @@ -248,7 +248,7 @@ def generate_phonon_displacements(

@job(
output_schema=PhononBSDOSDoc,
data=[PhononDos, PhononBandStructureSymmLine, ForceConstants],
data=[PhononDos, PhononBandStructureSymmLine, Forceconstants],
)
def generate_frequencies_eigenvectors(
structure: Structure,
Expand Down
17 changes: 9 additions & 8 deletions src/atomate2/common/schemas/phonons.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class PhononUUIDs(BaseModel):
born_run_uuid: Optional[str] = Field(None, description="born run uuid")


class ForceConstants(MSONable):
class Forceconstants(MSONable):
"""A force constants class."""

def __init__(self, force_constants: list[list[Matrix3D]]) -> None:
Expand Down Expand Up @@ -198,7 +198,7 @@ class PhononBSDOSDoc(StructureMetadata, extra="allow"): # type: ignore[call-arg
)

# needed, e.g. to compute Grueneisen parameter etc
force_constants: Optional[ForceConstants] = Field(
force_constants: Optional[Forceconstants] = Field(
None, description="Force constants between every pair of atoms in the structure"
)

Expand Down Expand Up @@ -554,8 +554,10 @@ def from_forces_born(

new_plotter = PhononBSPlotter(bs=bs_symm_line)

new_plotter.save_plot("phonon_band_structure.eps",img_format=kwargs.get("img_format", "eps"),units=kwargs.get("units", "THz"),)

new_plotter.save_plot(
filename=kwargs.get("filename_bs", "phonon_band_structure.pdf"),
units=kwargs.get("units", "THz"),
)
imaginary_modes_hiphive = bs_symm_line.has_imaginary_freq(
tol=kwargs.get("tol_imaginary_modes", 1e-5)
)
Expand Down Expand Up @@ -619,10 +621,9 @@ def from_forces_born(
new_plotter = PhononBSPlotter(bs=bs_symm_line)

new_plotter.save_plot(
"phonon_band_structure.eps",
img_format=kwargs.get("img_format", "eps"),
units=kwargs.get("units", "THz"),
)
filename=kwargs.get("filename_bs", "phonon_band_structure.pdf"),
units=kwargs.get("units", "THz"),
)

else:
pass
Expand Down

0 comments on commit a066ba5

Please sign in to comment.