Skip to content

Commit

Permalink
add default option not to remap hops atomate style
Browse files Browse the repository at this point in the history
  • Loading branch information
esoteric-ephemera committed Dec 12, 2024
1 parent 3f1653e commit eed728b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/atomate2/common/flows/approx_neb.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class ApproxNebFromEndpointsMaker(Maker):
def make(
self,
working_ion: CompositionLike,
end_points: list[Structure],
end_point_structures: list[Structure],
charge_density_path: str | Path,
n_images: int = 5,
prev_dir: str | Path | None = None,
Expand All @@ -61,7 +61,7 @@ def make(
working_ion : CompositionLike
The element which migrates.
end_points : list of pymatgen .Structure
end_point_structures : list of pymatgen .Structure
The two endpoint structures
charge_density_path: str or .Path
Path to the directory containing the charge density file(s).
Expand All @@ -78,7 +78,7 @@ def make(
"""
ep_jobs: list[Job] = []
ep_output: dict[str, dict[str, Any]] = {}
for idx, ep in enumerate(end_points):
for idx, ep in enumerate(end_point_structures):
job = self.image_relax_maker.make(ep, prev_dir=prev_dir)
job.name = f"ApproxNEB relax endpoint {idx}"
ep_output[str(idx)] = {
Expand Down
16 changes: 13 additions & 3 deletions src/atomate2/vasp/flows/approx_neb.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ def make_from_migration_graph(
migration_graph: MigrationGraph,
n_images: int = 5,
prev_dir: str | Path | None = None,
atomate_compat_labels : bool = False,
) -> Flow:
"""
Make an ApproxNEB flow from a migration graph.
Expand All @@ -172,19 +173,28 @@ def make_from_migration_graph(
inserted coordinates, etc.
n_images: int
number of images for the ApproxNEB calculation
selective_dynamics: str
the scheme for adding selective dynamics to image relaxations
prev_dir: str or .Path or None (default)
A previous calculation directory to copy outputs from.
atomate_compat_labels : bool = False
Whether to use atomate style labeling of the endpoints (True)
or the original labels from the MigrationGraphDoc (False, default)
Returns
-------
Flow
A flow performing AppoxNEB calculations
"""
inserted_coords_dict, inserted_coords_combo, _ = (
inserted_coords_dict, inserted_coords_combo, mapping = (
MigrationGraphDoc.get_distinct_hop_sites(
migration_graph.inserted_ion_coords, migration_graph.insert_coords_combo
)
)
if not atomate_compat_labels:
inserted_coords_combo = [mapping[k] for k in inserted_coords_combo]
inserted_coords_dict = {
mapping[k] : v for k, v in inserted_coords_dict.items()
}

working_ion = next(
ele.value
for ele in migration_graph.working_ion_entry.composition.remove_charges()
Expand Down

0 comments on commit eed728b

Please sign in to comment.