Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Josh A. Mitchell <[email protected]>
  • Loading branch information
mattwthompson and Yoshanuikabundi authored Jan 10, 2025
1 parent a80a54d commit 98e216e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions openff/interchange/components/interchange.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ def to_gromacs(
than the default value, mass will be transferred from neighboring heavy atoms. Note that this is currently
not applied to any waters and is unsupported when virtual sites are present.
monolithic: bool, default=False
Whether the topology file should be monolithic (True) or reference individual .itp files (False).
Whether the topology file should be monolithic (True) or reference individual .itp files (False). Note that these individual .itp files rely on ad hoc atom types and cannot be transferred between systems.
_merge_atom_types: bool, default = False
The flag to define behaviour of GROMACSWriter. If True, then similar atom types will be merged.
If False, each atom will have its own atom type.
Expand Down Expand Up @@ -413,7 +413,7 @@ def to_top(
than the default value, mass will be transferred from neighboring heavy atoms. Note that this is currently
not applied to any waters and is unsupported when virtual sites are present.
monolithic: bool, default=False
Whether the topology file should be monolithic (True) or reference individual .itp files (False).
Whether the topology file should be monolithic (True) or reference individual .itp files (False). Note that these individual .itp files rely on ad hoc atom types and cannot be transferred between systems.
_merge_atom_types: book, default=False
The flag to define behaviour of GROMACSWriter. If True, then similar atom types will be merged.
If False, each atom will have its own atom type.
Expand Down
4 changes: 2 additions & 2 deletions openff/interchange/interop/gromacs/export/_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def to_top(self, monolithic: bool = True, _merge_atom_types: bool = False):
self._write_defaults(top)

if monolithic:
atomtypes_file_object: TextIOWrapper = top
atomtypes_file_object: IO[str] = top
else:
prefix = str(self.top_file).split(".top")[0]
atomtypes_file_object = open(
Expand Down Expand Up @@ -177,7 +177,7 @@ def _write_moleculetypes(
for molecule_name, molecule_type in self.system.molecule_types.items():
# this string needs to be something that plays nicely in file paths
# and also works as GROMACS's label for the moleculetype "name"
canonicalized_name = f"{molecule_name.replace(' ', '_')}"
canonicalized_name = molecule_name.translate({ord(c): '_' for c in r' \/:<>"|?*'})

if monolithic:
molecule_file = top
Expand Down

0 comments on commit 98e216e

Please sign in to comment.