Skip to content

Commit

Permalink
simplify names per review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
esoteric-ephemera committed Jan 14, 2025
1 parent e41d5d2 commit 3970c0b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/pymatgen/core/trajectory.py
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ def from_file(cls, filename: str | Path, constant_lattice: bool = True, **kwargs

elif fnmatch(filename, "*.traj"):
if NO_ASE_ERR is None:
return cls.ase_to_pmg_trajectory(
return cls.from_ase(
filename,
constant_lattice=constant_lattice,
store_frame_properties=True,
Expand Down Expand Up @@ -733,7 +733,7 @@ def _get_site_props(self, frames: ValidIndex) -> SitePropsType | None:
raise ValueError("Unexpected frames type.")
raise ValueError("Unexpected site_properties type.")

def to_ase_trajectory(self, **kwargs) -> AseTrajectory:
def to_ase(self, **kwargs) -> AseTrajectory:
"""
Convert to an ASE trajectory.
Expand All @@ -748,7 +748,7 @@ def to_ase_trajectory(self, **kwargs) -> AseTrajectory:
raise ImportError("ASE is required to write .traj files. pip install ase")

@classmethod
def ase_to_pmg_trajectory(
def from_ase(
cls,
trajectory: str | Path | AseTrajectory,
constant_lattice: bool | None = None,
Expand Down
4 changes: 2 additions & 2 deletions tests/core/test_trajectory.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ def test_to_ase_traj(self):
traj = Trajectory.from_file(f"{TEST_DIR}/LiMnO2_chgnet_relax.json.gz")

try:
ase_traj = traj.to_ase_trajectory()
ase_traj = traj.to_ase()

assert len(ase_traj) == len(traj)

Expand All @@ -572,4 +572,4 @@ def test_to_ase_traj(self):
ImportError,
match="ASE is required to write .traj files. pip install ase",
):
ase_traj = traj.to_ase_trajectory()
ase_traj = traj.to_ase()

0 comments on commit 3970c0b

Please sign in to comment.