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

flag to use spaces instead of tabs in molSimplify construction #275

Merged
merged 2 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 4 additions & 0 deletions molSimplify/Scripts/inparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,8 @@
args.jobdir = l[1]
else:
args.jobdirblank = True
if (l[0] == '-no_tabs'):
args.no_tabs = True

Check warning on line 586 in molSimplify/Scripts/inparse.py

View check run for this annotation

Codecov / codecov/patch

molSimplify/Scripts/inparse.py#L586

Added line #L586 was not covered by tests
### parse structure generation arguments ###
if (l[0] == '-bind' and len(l[1:]) > 0):
l = [_f for _f in re.split(' |,|\t', line) if _f] # noqa: E741
Expand Down Expand Up @@ -1194,6 +1196,8 @@
"-reportonly", help='add this flag if you just want the report, without actual structure generation. Currently does not support pentadentates.')
parser.add_argument(
"-jobmanager", help='use jobmanager naming convention.', default=False)
parser.add_argument(
"-no_tabs", help="add this flag to use spaces instead of tabs in written xyz files", default=False)
if len(p) == 1: # only one input, printing help only
args = parser.parse_args()
return args
Expand Down
2 changes: 1 addition & 1 deletion molSimplify/Scripts/structgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -3015,7 +3015,7 @@ def structgen(args: Namespace, rootdir: str, ligands: List[str], ligoc: List[int

# write xyz file
if (not args.reportonly) and (write_files):
core3D.writexyz(fname)
core3D.writexyz(fname, no_tabs=args.no_tabs)
strfiles.append(fname)
if write_files:
# write report file
Expand Down
2 changes: 1 addition & 1 deletion tests/test_inparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def test_parseinputs_advanced(monkeypatch):
defaults = dict(MLbonds=False, antigeoisomer=None, calccharge=True,
charge=None, decoration=False, decoration_index=False,
distort='0', genall=False, isomers=None, langles=False,
ligalign=False, nconfs='1', oldANN=None, pangles=False,
ligalign=False, nconfs='1', no_tabs=False, oldANN=None, pangles=False,
reportonly=None, scoreconfs=False, stereos=None,
jobmanager=False)
assert args.__dict__ == defaults
Expand Down
Loading