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

Deferring #394

Merged
merged 3 commits into from
Dec 7, 2021
Merged
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
Next Next commit
Updated file_write call in martinize2
  • Loading branch information
Tsjerk committed Dec 6, 2021
commit be3ec4561fc4fbf11c518df9df76c81c9f368420
6 changes: 3 additions & 3 deletions bin/martinize2
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import sys

import vermouth
import vermouth.forcefield
from vermouth.file_writer import open, DeferredFileWriter
from vermouth.file_writer import deferred_open, DeferredFileWriter
from vermouth import DATA_PATH
from vermouth.dssp import dssp
from vermouth.dssp.dssp import (
Expand Down Expand Up @@ -191,7 +191,7 @@ def write_gmx_topology(system, top_path, defines=(), header=()):
# A given moltype can appear more than once in the sequence of
# molecules, without being uninterupted by other moltypes. Even in
# that case, we want to write the ITP only once.
with open('{}.itp'.format(moltype), 'w') as outfile:
with deferred_open('{}.itp'.format(moltype), 'w') as outfile:
# here we format and merge all citations
header[-1] = header[-1]+"\n"
header.append("Pleas cite the following papers:")
Expand Down Expand Up @@ -232,7 +232,7 @@ def write_gmx_topology(system, top_path, defines=(), header=()):
define_string = '\n'.join(
'#define {}'.format(define) for define in defines
)
with open(str(top_path), 'w') as outfile:
with deferred_open(str(top_path), 'w') as outfile:
outfile.write(
textwrap.dedent(
template.format(
Expand Down