Skip to content

Commit

Permalink
Fix xtb regression.
Browse files Browse the repository at this point in the history
  • Loading branch information
shyuep committed Jun 27, 2024
1 parent 94a7e6d commit 877dd24
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/pymatgen/io/xtb/inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def constrains_template(molecule, reference_fnm, constraints) -> str:
for idx, val in enumerate(atoms_for_mtd):
if val + 1 not in atoms_for_mtd:
interval_list.append(val)
if idx != len(atoms_for_mtd):
if idx != len(atoms_for_mtd) - 1:
interval_list.append(atoms_for_mtd[idx + 1])
allowed_mtd_string = ",".join(
[f"{interval_list[i]}-{interval_list[i + 1]}" for i in range(len(interval_list)) if i % 2 == 0]
Expand Down
6 changes: 3 additions & 3 deletions src/pymatgen/io/xtb/outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@ def _parse_crest_output(self):
print(f"Input file {split_cmd[0]} not found")

# Get CREST input flags
for i, entry in enumerate(split_cmd, start=1):
for i, entry in enumerate(split_cmd):
value = None
if entry and "-" in entry:
option = entry[1:]
if i < len(split_cmd) and "-" not in entry:
value = entry
if i < len(split_cmd) and "-" not in split_cmd[i + 1]:
value = split_cmd[i + 1]
self.cmd_options[option] = value
# Get input charge for decorating parsed molecules
chg = 0
Expand Down

0 comments on commit 877dd24

Please sign in to comment.