The Open Forcefield Toolkit provides implementations of the SMIRNOFF format, parameterization engine, and other tools. Documentation available at http://open-forcefield-toolkit.readthedocs.io
POSIX-like systems expect files to end with the newline character (\n in Python). The toolkit does not do this. This leads to quirks with common tools, a simple case being that cating two files squishes them together.
To Reproduce.
In [1]: from openff.toolkit import ForceField
In [2]: ForceField().to_file("x.offxml")
In [3]: !cat x.offxml x.offxml
<?xml version="1.0" encoding="utf-8"?>
<SMIRNOFF version="0.3" aromaticity_model="OEAroModel_MDL"></SMIRNOFF><?xml version="1.0" encoding="utf-8"?>
<SMIRNOFF version="0.3" aromaticity_model="OEAroModel_MDL"></SMIRNOFF>
In [4]: ForceField().to_string()
Out[4]: '<?xml version="1.0" encoding="utf-8"?>\n<SMIRNOFF version="0.3" aromaticity_model="OEAroModel_MDL"></SMIRNOFF>'
Note the \n between lines but not at the end of the file. (Whether or not the newline should be added to the stringified version, it's not modified in XMLParameterIOHandler.to_file.)
Describe the bug
POSIX-like systems expect files to end with the newline character (
\n
in Python). The toolkit does not do this. This leads to quirks with common tools, a simple case being thatcat
ing two files squishes them together.To Reproduce.
Note the
\n
between lines but not at the end of the file. (Whether or not the newline should be added to the stringified version, it's not modified inXMLParameterIOHandler.to_file
.)