Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gamess efmo #437

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
more efmo
  • Loading branch information
loriab committed Nov 1, 2023
commit 96418579d1f70ea057ddab8a022f3d3673649937
12 changes: 10 additions & 2 deletions qcengine/programs/gamess/keywords.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,19 @@ def format_keywords(keywords: Dict[str, Any]) -> str:

grouped_lines = {}
for group, opts in sorted(grouped_options.items()):
is_block = False
line = []
line.append(f"${group.lower()}")
for key, val in sorted(grouped_options[group].items()):
line.append("=".join(format_keyword(key, val, lop_off=False)))
if key == "":
is_block = True
line.extend(val.split("\n"))
else:
line.append("=".join(format_keyword(key, val, lop_off=False)))
line.append("$end\n")
grouped_lines[group] = textwrap.fill(" ".join(line), initial_indent=" ", subsequent_indent=" ")
if is_block:
grouped_lines[group] = "\n".join(" " + ln for ln in line)
else:
grouped_lines[group] = textwrap.fill(" ".join(line), initial_indent=" ", subsequent_indent=" ")

return "\n".join(grouped_lines.values()) + "\n"
Loading