Skip to content

Commit

Permalink
Merge pull request #275 from hjkgrp/no_tab_flag
Browse files Browse the repository at this point in the history
flag to use spaces instead of tabs in molSimplify construction
  • Loading branch information
gianmarco-terrones authored Oct 24, 2024
2 parents 4d4fea6 + f56041b commit 284906a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
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 @@ def parseinputfile(args, inputfile_str=None):
args.jobdir = l[1]
else:
args.jobdirblank = True
if (l[0] == '-no_tabs'):
args.no_tabs = True
### 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 @@ def parseinputs_advanced(*p):
"-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

0 comments on commit 284906a

Please sign in to comment.