openff-toolkit icon indicating copy to clipboard operation
openff-toolkit copied to clipboard

ForceField round trip changes Angle parameterize field

Open ntBre opened this issue 2 years ago • 4 comments
trafficstars

Describe the bug Parsing a ForceField and rewriting it a to file changes the parameterize field on some Angles from k to 1 * boltzmann_constant ** 1, upsetting ForceBalance.

To Reproduce I needed to remove the Constraints section of a ForceField for ForceBalance and got this suggestion from Lily:

from openff.toolkit import ForceField

ff = ForceField("input.offxml", allow_cosmetic_attributes=True)
ff.deregister_parameter_handler("Constraints")
ff.to_file("output.offxml")

But I can reproduce it even with the deregister_parameter_handler line commented out. The changes are clearly seen when running diff input.offxml output.xml or even just grepping for boltzmann in both files.

Output

--- input.offxml        2023-07-20 17:08:33.120707559 -0400
+++ output.offxml       2023-07-20 17:22:05.578948496 -0400
@@ -115,8 +115,8 @@
         <Angle smirks="[*;r6:1]~;@[*;r5:2]~;@[*;r5;x2:3]" angle="126.74947883718123 * degree ** 1" k="165.02172217717344 * kilocalorie_per_mole ** 1 * radian ** -2" id="a13" parameterize="k, angle"></Angle>
         <Angle smirks="[*:1]~;!@[*;X3;r5:2]~;@[*;r5:3]" angle="124.76218228987901 * degree ** 1" k="102.212672475332 * kilocalorie_per_mole ** 1 * radian ** -2" id="a14" parameterize="k, angle"></Angle>
         <Angle smirks="[#8X1:1]~[#6X3:2]~[#8:3]" angle="123.69384605432525 * degree ** 1" k="126.52435713215367 * kilocalorie_per_mole ** 1 * radian ** -2" id="a15" parameterize="k, angle"></Angle>
-        <Angle smirks="[*:1]~[#6X2:2]~[*:3]" angle="178.0651310592217 * degree ** 1" k="99.85352234417054 * kilocalorie_per_mole ** 1 * radian ** -2" id="a16" parameterize="k"></Angle>
-        <Angle smirks="[*:1]~[#7X2:2]~[*:3]" angle="176.02345454674762 * degree ** 1" k="89.9604117556478 * kilocalorie_per_mole ** 1 * radian ** -2" id="a17" parameterize="k"></Angle>
+        <Angle smirks="[*:1]~[#6X2:2]~[*:3]" angle="178.0651310592217 * degree ** 1" k="99.85352234417054 * kilocalorie_per_mole ** 1 * radian ** -2" id="a16" parameterize="1 * boltzmann_constant ** 1"></Angle>
+        <Angle smirks="[*:1]~[#7X2:2]~[*:3]" angle="176.02345454674762 * degree ** 1" k="89.9604117556478 * kilocalorie_per_mole ** 1 * radian ** -2" id="a17" parameterize="1 * boltzmann_constant ** 1"></Angle>
         <Angle smirks="[*:1]~[#7X4,#7X3,#7X2-1:2]~[*:3]" angle="113.18673214011471 * degree ** 1" k="249.16533568188814 * kilocalorie_per_mole ** 1 * radian ** -2" id="a18" parameterize="k, angle"></Angle>
         <Angle smirks="[*:1]@-[r!r6;#7X4,#7X3,#7X2-1:2]@-[*:3]" angle="98.4609417604599 * degree ** 1" k="215.46610831911238 * kilocalorie_per_mole ** 1 * radian ** -2" id="a18a" parameterize="k, angle"></Angle>
         <Angle smirks="[#1:1]-[#7X4,#7X3,#7X2-1:2]-[*:3]" angle="109.26647374981178 * degree ** 1" k="107.59800871001211 * kilocalorie_per_mole ** 1 * radian ** -2" id="a19" parameterize="k, angle"></Angle>
@@ -128,7 +128,7 @@
         <Angle smirks="[#1:1]-[#7X2+0:2]~[*:3]" angle="111.61555367908721 * degree ** 1" k="104.67457969782329 * kilocalorie_per_mole ** 1 * radian ** -2" id="a24" parameterize="k, angle"></Angle>
         <Angle smirks="[#6,#7,#8:1]-[#7X3:2](~[#8X1])~[#8X1:3]" angle="117.56973608432911 * degree ** 1" k="145.03189317662233 * kilocalorie_per_mole ** 1 * radian ** -2" id="a25" parameterize="k, angle"></Angle>
         <Angle smirks="[#8X1:1]~[#7X3:2]~[#8X1:3]" angle="124.45512289998524 * degree ** 1" k="140.35006169568325 * kilocalorie_per_mole ** 1 * radian ** -2" id="a26" parameterize="k, angle"></Angle>
-        <Angle smirks="[*:1]~[#7X2:2]~[#7X1:3]" angle="175.2204655094496 * degree ** 1" k="117.562291770754 * kilocalorie_per_mole ** 1 * radian ** -2" id="a27" parameterize="k"></Angle>
+        <Angle smirks="[*:1]~[#7X2:2]~[#7X1:3]" angle="175.2204655094496 * degree ** 1" k="117.562291770754 * kilocalorie_per_mole ** 1 * radian ** -2" id="a27" parameterize="1 * boltzmann_constant ** 1"></Angle>
         <Angle smirks="[*:1]-[#8:2]-[*:3]" angle="111.96993713031328 * degree ** 1" k="249.99419564046633 * kilocalorie_per_mole ** 1 * radian ** -2" id="a28" parameterize="k, angle"></Angle>
         <Angle smirks="[#6X3,#7:1]~;@[#8;r:2]~;@[#6X3,#7:3]" angle="109.19365977372304 * degree ** 1" k="337.3883162802198 * kilocalorie_per_mole ** 1 * radian ** -2" id="a29" parameterize="k, angle"></Angle>
         <Angle smirks="[*:1]-[#8X2+1:2]=[*:3]" angle="122.99067282760342 * degree ** 1" k="324.48394466290887 * kilocalorie_per_mole ** 1 * radian ** -2" id="a30"></Angle>

Computing environment (please complete the following information):

  • Arch Linux
  • ForceField files (renamed for GitHub): output.txt input.txt
  • conda list (important part is openff-toolkit 0.14.0, but I reproduced on 0.13.2 too):
# packages in environment at /home/brent/mambaforge/envs/temp-valence-fitting-repro:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       2_gnu    conda-forge
alsa-lib                  1.2.8                h166bdaf_0    conda-forge
amberlite                 22.0                     pypi_0    pypi
ambertools                22.5            py310hd182041_0    conda-forge
amberutils                21.0                     pypi_0    pypi
amqp                      5.1.1              pyhd8ed1ab_0    conda-forge
anyio                     3.7.1              pyhd8ed1ab_0    conda-forge
argcomplete               3.1.1              pyhd8ed1ab_0    conda-forge
argon2-cffi               21.3.0             pyhd8ed1ab_0    conda-forge
argon2-cffi-bindings      21.2.0          py310h5764c6d_3    conda-forge
arpack                    3.7.0                hdefa2d7_2    conda-forge
asttokens                 2.2.1              pyhd8ed1ab_0    conda-forge
astunparse                1.6.3              pyhd8ed1ab_0    conda-forge
async-lru                 2.0.3              pyhd8ed1ab_0    conda-forge
async-timeout             4.0.2              pyhd8ed1ab_0    conda-forge
attr                      2.5.1                h166bdaf_1    conda-forge
attrs                     23.1.0             pyh71513ae_1    conda-forge
aws-c-auth                0.7.0                hf8751d9_2    conda-forge
aws-c-cal                 0.6.0                h93469e0_0    conda-forge
aws-c-common              0.8.23               hd590300_0    conda-forge
aws-c-compression         0.2.17               h862ab75_1    conda-forge
aws-c-event-stream        0.3.1                h9599702_1    conda-forge
aws-c-http                0.7.11               hbe98c3e_0    conda-forge
aws-c-io                  0.13.28              h3870b5a_0    conda-forge
aws-c-mqtt                0.8.14               h2e270ba_2    conda-forge
aws-c-s3                  0.3.13               heb0bb06_2    conda-forge
aws-c-sdkutils            0.1.11               h862ab75_1    conda-forge
aws-checksums             0.1.16               h862ab75_1    conda-forge
aws-crt-cpp               0.20.3               he9c0e7f_4    conda-forge
aws-sdk-cpp               1.10.57             hbc2ea52_17    conda-forge
babel                     2.12.1             pyhd8ed1ab_1    conda-forge
backcall                  0.2.0              pyh9f0ad1d_0    conda-forge
backports                 1.0                pyhd8ed1ab_3    conda-forge
backports.functools_lru_cache 1.6.5              pyhd8ed1ab_0    conda-forge
backports.zoneinfo        0.2.1           py310hff52083_7    conda-forge
basis_set_exchange        0.9.1              pyhd8ed1ab_0    conda-forge
beautifulsoup4            4.12.2             pyha770c72_0    conda-forge
billiard                  4.1.0           py310h2372a71_0    conda-forge
black                     23.7.0          py310hff52083_1    conda-forge
bleach                    6.0.0              pyhd8ed1ab_0    conda-forge
blosc                     1.21.4               h0f2a231_0    conda-forge
boltons                   23.0.0             pyhd8ed1ab_0    conda-forge
boost                     1.78.0          py310hc4a4660_4    conda-forge
boost-cpp                 1.78.0               h6582d0a_3    conda-forge
brotli                    1.0.9                h166bdaf_9    conda-forge
brotli-bin                1.0.9                h166bdaf_9    conda-forge
brotli-python             1.0.9           py310hd8f1fbe_9    conda-forge
bson                      0.5.9                      py_0    conda-forge
bzip2                     1.0.8                h7f98852_4    conda-forge
c-ares                    1.19.1               hd590300_0    conda-forge
c-blosc2                  2.10.0               hb4ffafa_0    conda-forge
ca-certificates           2023.5.7             hbcca054_0    conda-forge
cached-property           1.5.2                hd8ed1ab_1    conda-forge
cached_property           1.5.2              pyha770c72_1    conda-forge
cachetools                5.3.1              pyhd8ed1ab_0    conda-forge
cairo                     1.16.0            hbbf8b49_1016    conda-forge
celery                    5.3.1              pyhd8ed1ab_0    conda-forge
certifi                   2023.5.7           pyhd8ed1ab_0    conda-forge
cffi                      1.15.1          py310h255011f_3    conda-forge
charset-normalizer        3.2.0              pyhd8ed1ab_0    conda-forge
chemper                   1.0.1              pyhd8ed1ab_0    conda-forge
click                     8.1.6           unix_pyh707e725_0    conda-forge
click-didyoumean          0.3.0              pyhd8ed1ab_0    conda-forge
click-option-group        0.5.6              pyhd8ed1ab_0    conda-forge
click-plugins             1.1.1                      py_0    conda-forge
click-repl                0.2.0              pyhd8ed1ab_0    conda-forge
cloudpickle               2.2.1              pyhd8ed1ab_0    conda-forge
cmiles                    0.1.6                ha770c72_2    conda-forge
cmiles-base               0.1.6              pyhd8ed1ab_2    conda-forge
colorama                  0.4.6              pyhd8ed1ab_0    conda-forge
comm                      0.1.3              pyhd8ed1ab_0    conda-forge
conda                     23.5.2          py310hff52083_0    conda-forge
conda-pack                0.7.0              pyh6c4a22f_0    conda-forge
conda-package-handling    2.0.2              pyh38be061_0    conda-forge
conda-package-streaming   0.8.0              pyhd8ed1ab_0    conda-forge
contourpy                 1.1.0           py310hd41b1e2_0    conda-forge
cryptography              41.0.2          py310h75e40e8_0    conda-forge
cudatoolkit               11.8.0              h37601d7_11    conda-forge
cycler                    0.11.0             pyhd8ed1ab_0    conda-forge
cython                    3.0.0           py310hc6cd4ac_0    conda-forge
dbus                      1.13.6               h5008d03_3    conda-forge
debugpy                   1.6.7           py310heca2aa9_0    conda-forge
decorator                 5.1.1              pyhd8ed1ab_0    conda-forge
defusedxml                0.7.1              pyhd8ed1ab_0    conda-forge
entrypoints               0.4                pyhd8ed1ab_0    conda-forge
exceptiongroup            1.1.2              pyhd8ed1ab_0    conda-forge
executing                 1.2.0              pyhd8ed1ab_0    conda-forge
expat                     2.5.0                hcb278e6_1    conda-forge
fastapi                   0.86.0             pyhd8ed1ab_0    conda-forge
fftw                      3.3.10          nompi_hc118613_108    conda-forge
flake8                    6.0.0              pyhd8ed1ab_0    conda-forge
flit-core                 3.9.0              pyhd8ed1ab_0    conda-forge
fmt                       9.1.0                h924138e_0    conda-forge
font-ttf-dejavu-sans-mono 2.37                 hab24e00_0    conda-forge
font-ttf-inconsolata      3.000                h77eed37_0    conda-forge
font-ttf-source-code-pro  2.038                h77eed37_0    conda-forge
font-ttf-ubuntu           0.83                 hab24e00_0    conda-forge
fontconfig                2.14.2               h14ed4e7_0    conda-forge
fonts-conda-ecosystem     1                             0    conda-forge
fonts-conda-forge         1                             0    conda-forge
fonttools                 4.41.0          py310h2372a71_0    conda-forge
forcebalance              1.9.5           py310h5a539fb_0    conda-forge
freetype                  2.12.1               hca18f0e_1    conda-forge
freetype-py               2.3.0              pyhd8ed1ab_0    conda-forge
future                    0.18.3             pyhd8ed1ab_0    conda-forge
geometric                 1.0                pyhd8ed1ab_1    conda-forge
gettext                   0.21.1               h27087fc_0    conda-forge
gflags                    2.2.2             he1b5a44_1004    conda-forge
glib                      2.76.4               hfc55251_0    conda-forge
glib-tools                2.76.4               hfc55251_0    conda-forge
glog                      0.6.0                h6f12383_0    conda-forge
gmp                       6.2.1                h58526e2_0    conda-forge
graphite2                 1.3.13            h58526e2_1001    conda-forge
greenlet                  2.0.2           py310hc6cd4ac_1    conda-forge
gst-plugins-base          1.22.3               h938bd60_1    conda-forge
gstreamer                 1.22.3               h977cf35_1    conda-forge
h11                       0.14.0             pyhd8ed1ab_0    conda-forge
h2                        4.1.0              pyhd8ed1ab_0    conda-forge
h5py                      3.9.0           nompi_py310hcca72df_101    conda-forge
harfbuzz                  7.3.0                hdb3a94d_0    conda-forge
hdf4                      4.2.15               h501b40f_6    conda-forge
hdf5                      1.14.1          nompi_h4f84152_100    conda-forge
hpack                     4.0.0              pyh9f0ad1d_0    conda-forge
httpcore                  0.17.3             pyhd8ed1ab_0    conda-forge
httpx                     0.24.1             pyhd8ed1ab_0    conda-forge
hyperframe                6.0.1              pyhd8ed1ab_0    conda-forge
icu                       72.1                 hcb278e6_0    conda-forge
idna                      3.4                pyhd8ed1ab_0    conda-forge
importlib-metadata        6.8.0              pyha770c72_0    conda-forge
importlib_metadata        6.8.0                hd8ed1ab_0    conda-forge
importlib_resources       6.0.0              pyhd8ed1ab_1    conda-forge
iniconfig                 2.0.0              pyhd8ed1ab_0    conda-forge
ipykernel                 6.24.0             pyh71e2992_0    conda-forge
ipython                   8.14.0             pyh41d4057_0    conda-forge
ipython_genutils          0.2.0                      py_1    conda-forge
ipywidgets                8.0.7              pyhd8ed1ab_0    conda-forge
isort                     5.12.0             pyhd8ed1ab_1    conda-forge
jedi                      0.18.2             pyhd8ed1ab_0    conda-forge
jinja2                    3.1.2              pyhd8ed1ab_1    conda-forge
json5                     0.9.14             pyhd8ed1ab_0    conda-forge
jsonpatch                 1.32               pyhd8ed1ab_0    conda-forge
jsonpointer               2.0                        py_0    conda-forge
jsonschema                4.18.4             pyhd8ed1ab_0    conda-forge
jsonschema-specifications 2023.7.1           pyhd8ed1ab_0    conda-forge
jupyter                   1.0.0           py310hff52083_8    conda-forge
jupyter-lsp               2.2.0              pyhd8ed1ab_0    conda-forge
jupyter_client            8.3.0              pyhd8ed1ab_0    conda-forge
jupyter_console           6.6.3              pyhd8ed1ab_0    conda-forge
jupyter_core              5.3.1           py310hff52083_0    conda-forge
jupyter_events            0.6.3              pyhd8ed1ab_0    conda-forge
jupyter_server            2.7.0              pyhd8ed1ab_0    conda-forge
jupyter_server_terminals  0.4.4              pyhd8ed1ab_1    conda-forge
jupyterlab                4.0.3              pyhd8ed1ab_0    conda-forge
jupyterlab_pygments       0.2.2              pyhd8ed1ab_0    conda-forge
jupyterlab_server         2.23.0             pyhd8ed1ab_0    conda-forge
jupyterlab_widgets        3.0.8              pyhd8ed1ab_0    conda-forge
keyutils                  1.6.1                h166bdaf_0    conda-forge
kiwisolver                1.4.4           py310hbf28c38_1    conda-forge
kombu                     5.3.1           py310hff52083_0    conda-forge
krb5                      1.20.1               h81ceb04_0    conda-forge
lame                      3.100             h166bdaf_1003    conda-forge
lcms2                     2.15                 haa2dc70_1    conda-forge
ld_impl_linux-64          2.40                 h41732ed_0    conda-forge
lerc                      4.0.0                h27087fc_0    conda-forge
libabseil                 20230125.3      cxx17_h59595ed_0    conda-forge
libaec                    1.0.6                hcb278e6_1    conda-forge
libarchive                3.6.2                h039dbb9_1    conda-forge
libarrow                  12.0.1           h657c46f_5_cpu    conda-forge
libblas                   3.9.0           17_linux64_openblas    conda-forge
libbrotlicommon           1.0.9                h166bdaf_9    conda-forge
libbrotlidec              1.0.9                h166bdaf_9    conda-forge
libbrotlienc              1.0.9                h166bdaf_9    conda-forge
libcap                    2.67                 he9d0100_0    conda-forge
libcblas                  3.9.0           17_linux64_openblas    conda-forge
libclang                  15.0.7          default_h7634d5b_2    conda-forge
libclang13                15.0.7          default_h9986a30_2    conda-forge
libcrc32c                 1.1.2                h9c3ff4c_0    conda-forge
libcups                   2.3.3                h36d4200_3    conda-forge
libcurl                   8.1.2                h409715c_0    conda-forge
libdeflate                1.18                 h0b41bf4_0    conda-forge
libedit                   3.1.20191231         he28a2e2_2    conda-forge
libev                     4.33                 h516909a_1    conda-forge
libevent                  2.1.12               hf998b51_1    conda-forge
libexpat                  2.5.0                hcb278e6_1    conda-forge
libffi                    3.4.2                h7f98852_5    conda-forge
libflac                   1.4.3                h59595ed_0    conda-forge
libgcc-ng                 13.1.0               he5830b7_0    conda-forge
libgcrypt                 1.10.1               h166bdaf_0    conda-forge
libgfortran-ng            13.1.0               h69a702a_0    conda-forge
libgfortran5              13.1.0               h15d22d2_0    conda-forge
libglib                   2.76.4               hebfc3b9_0    conda-forge
libgomp                   13.1.0               he5830b7_0    conda-forge
libgoogle-cloud           2.12.0               h840a212_1    conda-forge
libgpg-error              1.47                 h71f35ed_0    conda-forge
libgrpc                   1.56.2               h3905398_0    conda-forge
libiconv                  1.17                 h166bdaf_0    conda-forge
libjpeg-turbo             2.1.5.1              h0b41bf4_0    conda-forge
liblapack                 3.9.0           17_linux64_openblas    conda-forge
libllvm15                 15.0.7               h5cf9203_2    conda-forge
libmamba                  1.4.9                h658169a_0    conda-forge
libmambapy                1.4.9           py310h8aae740_0    conda-forge
libnetcdf                 4.9.2           nompi_h7e745eb_109    conda-forge
libnghttp2                1.52.0               h61bc06f_0    conda-forge
libnsl                    2.0.0                h7f98852_0    conda-forge
libnuma                   2.0.16               h0b41bf4_1    conda-forge
libogg                    1.3.4                h7f98852_1    conda-forge
libopenblas               0.3.23          pthreads_h80387f5_0    conda-forge
libopus                   1.3.1                h7f98852_1    conda-forge
libpng                    1.6.39               h753d276_0    conda-forge
libpq                     15.3                 hbcd7760_1    conda-forge
libprotobuf               4.23.3               hd1fb520_0    conda-forge
libsndfile                1.2.0                hb75c966_0    conda-forge
libsodium                 1.0.18               h36c2ea0_1    conda-forge
libsolv                   0.7.24               hfc55251_1    conda-forge
libsqlite                 3.42.0               h2797004_0    conda-forge
libssh2                   1.11.0               h0841786_0    conda-forge
libstdcxx-ng              13.1.0               hfd8a6a1_0    conda-forge
libsystemd0               253                  h8c4010b_1    conda-forge
libthrift                 0.18.1               h8fd135c_2    conda-forge
libtiff                   4.5.1                h8b53f26_0    conda-forge
libutf8proc               2.8.0                h166bdaf_0    conda-forge
libuuid                   2.38.1               h0b41bf4_0    conda-forge
libvorbis                 1.3.7                h9c3ff4c_0    conda-forge
libwebp-base              1.3.1                hd590300_0    conda-forge
libxcb                    1.15                 h0b41bf4_0    conda-forge
libxkbcommon              1.5.0                h5d7e998_3    conda-forge
libxml2                   2.11.4               h0d562d8_0    conda-forge
libxslt                   1.1.37               h0054252_1    conda-forge
libzip                    1.9.2                hc929e4a_1    conda-forge
libzlib                   1.2.13               hd590300_5    conda-forge
lxml                      4.9.3           py310h9b7343a_0    conda-forge
lz4-c                     1.9.4                hcb278e6_0    conda-forge
lzo                       2.10              h516909a_1000    conda-forge
mamba                     1.4.9           py310h51d5547_0    conda-forge
markdown-it-py            3.0.0              pyhd8ed1ab_0    conda-forge
markupsafe                2.1.3           py310h2372a71_0    conda-forge
matplotlib-base           3.7.2           py310hf38f957_0    conda-forge
matplotlib-inline         0.1.6              pyhd8ed1ab_0    conda-forge
mccabe                    0.7.0              pyhd8ed1ab_0    conda-forge
mctc-lib                  0.3.1                h74f4db8_0    conda-forge
mdtraj                    1.9.8           py310h8e08b51_2    conda-forge
mdurl                     0.1.0              pyhd8ed1ab_0    conda-forge
mistune                   3.0.0              pyhd8ed1ab_0    conda-forge
mmpbsa-py                 16.0                     pypi_0    pypi
mpg123                    1.31.3               hcb278e6_0    conda-forge
msgpack-python            1.0.5           py310hdf3cbec_0    conda-forge
munkres                   1.1.4              pyh9f0ad1d_0    conda-forge
mypy_extensions           1.0.0              pyha770c72_0    conda-forge
mysql-common              8.0.33               hf1915f5_2    conda-forge
mysql-libs                8.0.33               hca2cd23_2    conda-forge
nbclient                  0.8.0              pyhd8ed1ab_0    conda-forge
nbconvert                 7.7.1              pyhd8ed1ab_1    conda-forge
nbconvert-core            7.7.1              pyhd8ed1ab_1    conda-forge
nbconvert-pandoc          7.7.1              pyhd8ed1ab_1    conda-forge
nbformat                  5.9.1              pyhd8ed1ab_0    conda-forge
ncurses                   6.4                  hcb278e6_0    conda-forge
ndcctools                 7.6.0           py310he2ed3e8_0    conda-forge
nest-asyncio              1.5.6              pyhd8ed1ab_0    conda-forge
netcdf-fortran            4.6.1           nompi_hec59055_101    conda-forge
networkx                  3.1                pyhd8ed1ab_0    conda-forge
nglview                   3.0.6              pyhba93850_0    conda-forge
nomkl                     1.0                  h5ca1d4c_0    conda-forge
notebook                  7.0.0              pyhd8ed1ab_0    conda-forge
notebook-shim             0.2.3              pyhd8ed1ab_0    conda-forge
nspr                      4.35                 h27087fc_0    conda-forge
nss                       3.89                 he45b914_0    conda-forge
numexpr                   2.8.4           py310h690d005_100    conda-forge
numpy                     1.25.1          py310ha4c1d20_0    conda-forge
ocl-icd                   2.3.1                h7f98852_0    conda-forge
ocl-icd-system            1.0.0                         1    conda-forge
openeye-toolkits          2023.1.0                py310_0    openeye
openff-amber-ff-ports     0.0.3              pyh6c4a22f_0    conda-forge
openff-bespokefit         0.2.2              pyhd8ed1ab_0    conda-forge
openff-forcefields        2023.06.0          pyh1a96a4e_0    conda-forge
openff-fragmenter-base    0.2.0              pyhd8ed1ab_0    conda-forge
openff-interchange        0.3.8              pyhd8ed1ab_0    conda-forge
openff-interchange-base   0.3.8              pyhd8ed1ab_0    conda-forge
openff-models             0.0.5              pyh1a96a4e_1    conda-forge
openff-qcsubmit           0.4.1              pyhd8ed1ab_0    conda-forge
openff-toolkit            0.14.0             pyhd8ed1ab_3    conda-forge
openff-toolkit-base       0.14.0             pyhd8ed1ab_3    conda-forge
openff-units              0.2.1              pyh1a96a4e_0    conda-forge
openff-utilities          0.1.9              pyh1a96a4e_0    conda-forge
openjpeg                  2.5.0                hfec8fc6_2    conda-forge
openmm                    8.0.0           py310h5728c26_1    conda-forge
openmmforcefields         0.11.2             pyhd8ed1ab_2    conda-forge
openssl                   3.1.1                hd590300_1    conda-forge
orc                       1.9.0                h385abfd_1    conda-forge
overrides                 7.3.1              pyhd8ed1ab_0    conda-forge
packaging                 23.1               pyhd8ed1ab_0    conda-forge
packmol                   20.010               h86c2bf4_0    conda-forge
packmol-memgen            1.2.3rc0                 pypi_0    pypi
pandas                    2.0.3           py310h7cbd5c2_1    conda-forge
pandoc                    3.1.3                h32600fe_0    conda-forge
pandocfilters             1.5.0              pyhd8ed1ab_0    conda-forge
panedr                    0.7.1              pyhd8ed1ab_0    conda-forge
parmed                    4.1.0           py310heca2aa9_0    conda-forge
parso                     0.8.3              pyhd8ed1ab_0    conda-forge
pathspec                  0.11.1             pyhd8ed1ab_0    conda-forge
pbr                       5.11.1             pyhd8ed1ab_0    conda-forge
pcre2                     10.40                hc3806b6_0    conda-forge
pdb4amber                 22.0                     pypi_0    pypi
perl                      5.32.1          4_hd590300_perl5    conda-forge
pexpect                   4.8.0              pyh1a96a4e_2    conda-forge
pickleshare               0.7.5                   py_1003    conda-forge
pillow                    10.0.0          py310h582fbeb_0    conda-forge
pint                      0.21               pyhd8ed1ab_0    conda-forge
pip                       23.2               pyhd8ed1ab_0    conda-forge
pixman                    0.40.0               h36c2ea0_0    conda-forge
pkgutil-resolve-name      1.3.10             pyhd8ed1ab_0    conda-forge
platformdirs              3.9.1              pyhd8ed1ab_0    conda-forge
plotly                    5.15.0             pyhd8ed1ab_0    conda-forge
pluggy                    1.2.0              pyhd8ed1ab_0    conda-forge
ply                       3.11                       py_1    conda-forge
pooch                     1.7.0              pyha770c72_3    conda-forge
prometheus_client         0.17.1             pyhd8ed1ab_0    conda-forge
prompt-toolkit            3.0.39             pyha770c72_0    conda-forge
prompt_toolkit            3.0.39               hd8ed1ab_0    conda-forge
psutil                    5.9.5           py310h1fa729e_0    conda-forge
pthread-stubs             0.4               h36c2ea0_1001    conda-forge
ptyprocess                0.7.0              pyhd3deb0d_0    conda-forge
pulseaudio-client         16.1                 hb77b528_4    conda-forge
pure_eval                 0.2.2              pyhd8ed1ab_0    conda-forge
py-cpuinfo                9.0.0              pyhd8ed1ab_0    conda-forge
pyarrow                   12.0.1          py310h0576679_5_cpu    conda-forge
pybind11-abi              4                    hd8ed1ab_3    conda-forge
pycairo                   1.24.0          py310hda9f760_0    conda-forge
pycodestyle               2.10.0             pyhd8ed1ab_0    conda-forge
pycosat                   0.6.4           py310h5764c6d_1    conda-forge
pycparser                 2.21               pyhd8ed1ab_0    conda-forge
pydantic                  1.10.11         py310h2372a71_0    conda-forge
pyedr                     0.7.1              pyhd8ed1ab_0    conda-forge
pyflakes                  3.0.1              pyhd8ed1ab_0    conda-forge
pygments                  2.15.1             pyhd8ed1ab_0    conda-forge
pymbar                    3.1.0           py310hde88566_1    conda-forge
pyopenssl                 23.2.0             pyhd8ed1ab_1    conda-forge
pyparsing                 3.0.9              pyhd8ed1ab_0    conda-forge
pyqt                      5.15.7          py310hab646b1_3    conda-forge
pyqt5-sip                 12.11.0         py310heca2aa9_3    conda-forge
pysocks                   1.7.1              pyha2e5f31_6    conda-forge
pytables                  3.8.0           py310ha028ce3_2    conda-forge
pytest                    7.4.0              pyhd8ed1ab_0    conda-forge
python                    3.10.12         hd12c33a_0_cpython    conda-forge
python-constraint         1.4.0                      py_0    conda-forge
python-dateutil           2.8.2              pyhd8ed1ab_0    conda-forge
python-fastjsonschema     2.17.1             pyhd8ed1ab_0    conda-forge
python-json-logger        2.0.7              pyhd8ed1ab_0    conda-forge
python-tzdata             2023.3             pyhd8ed1ab_0    conda-forge
python_abi                3.10                    3_cp310    conda-forge
pytraj                    2.0.6                    pypi_0    pypi
pytz                      2023.3             pyhd8ed1ab_0    conda-forge
pyyaml                    6.0             py310h5764c6d_5    conda-forge
pyzmq                     25.1.0          py310h5bbb5d0_0    conda-forge
qcelemental               0.25.1             pyhd8ed1ab_2    conda-forge
qcengine                  0.26.0             pyhd8ed1ab_0    conda-forge
qcportal                  0.15.8             pyhd8ed1ab_0    conda-forge
qt-main                   5.15.8              h01ceb2d_13    conda-forge
qtconsole                 5.4.3              pyhd8ed1ab_0    conda-forge
qtconsole-base            5.4.3              pyha770c72_0    conda-forge
qtpy                      2.3.1              pyhd8ed1ab_0    conda-forge
qubekit                   2.1.1              pyhd8ed1ab_0    conda-forge
rdkit                     2023.03.2       py310h399bcf7_0    conda-forge
rdma-core                 28.9                 h59595ed_1    conda-forge
re2                       2023.03.02           h8c504da_0    conda-forge
readline                  8.2                  h8228510_1    conda-forge
redis-py                  4.6.0              pyhd8ed1ab_0    conda-forge
redis-server              7.0.12               h06160fa_0    conda-forge
referencing               0.30.0             pyhd8ed1ab_0    conda-forge
regex                     2023.6.3        py310h2372a71_0    conda-forge
reportlab                 4.0.4           py310h2372a71_0    conda-forge
reproc                    14.2.4               h0b41bf4_0    conda-forge
reproc-cpp                14.2.4               hcb278e6_0    conda-forge
requests                  2.31.0             pyhd8ed1ab_0    conda-forge
rfc3339-validator         0.1.4              pyhd8ed1ab_0    conda-forge
rfc3986-validator         0.1.1              pyh9f0ad1d_0    conda-forge
rich                      13.4.2             pyhd8ed1ab_0    conda-forge
rlpycairo                 0.2.0              pyhd8ed1ab_0    conda-forge
rpds-py                   0.9.2           py310hcb5633a_0    conda-forge
ruamel.yaml               0.17.32         py310h2372a71_0    conda-forge
ruamel.yaml.clib          0.2.7           py310h1fa729e_1    conda-forge
s2n                       1.3.46               h06160fa_0    conda-forge
sander                    22.0                     pypi_0    pypi
scipy                     1.11.1          py310ha4c1d20_0    conda-forge
send2trash                1.8.2              pyh41d4057_0    conda-forge
setuptools                68.0.0             pyhd8ed1ab_0    conda-forge
sip                       6.7.9           py310hc6cd4ac_0    conda-forge
six                       1.16.0             pyh6c4a22f_0    conda-forge
smirnoff99frosst          1.1.0              pyh44b312d_0    conda-forge
snappy                    1.1.10               h9fff704_0    conda-forge
sniffio                   1.3.0              pyhd8ed1ab_0    conda-forge
soupsieve                 2.3.2.post1        pyhd8ed1ab_0    conda-forge
sqlalchemy                2.0.19          py310h2372a71_0    conda-forge
stack_data                0.6.2              pyhd8ed1ab_0    conda-forge
starlette                 0.20.4             pyhd8ed1ab_1    conda-forge
tenacity                  8.2.2              pyhd8ed1ab_0    conda-forge
terminado                 0.17.1             pyh41d4057_0    conda-forge
tinycss2                  1.2.1              pyhd8ed1ab_0    conda-forge
tinydb                    4.8.0              pyhd8ed1ab_0    conda-forge
tk                        8.6.12               h27826a3_0    conda-forge
toml                      0.10.2             pyhd8ed1ab_0    conda-forge
tomli                     2.0.1              pyhd8ed1ab_0    conda-forge
toolz                     0.12.0             pyhd8ed1ab_0    conda-forge
tornado                   6.3.2           py310h2372a71_0    conda-forge
torsiondrive              1.1.0              pyhd8ed1ab_0    conda-forge
tqdm                      4.65.0             pyhd8ed1ab_1    conda-forge
traitlets                 5.9.0              pyhd8ed1ab_0    conda-forge
typing-extensions         4.7.1                hd8ed1ab_0    conda-forge
typing_extensions         4.7.1              pyha770c72_0    conda-forge
typing_utils              0.1.0              pyhd8ed1ab_0    conda-forge
tzdata                    2023c                h71feb2d_0    conda-forge
ucx                       1.14.1               hf587318_2    conda-forge
unicodedata2              15.0.0          py310h5764c6d_0    conda-forge
unidecode                 1.3.6              pyhd8ed1ab_0    conda-forge
urllib3                   2.0.4              pyhd8ed1ab_0    conda-forge
uvicorn                   0.23.1          py310hff52083_0    conda-forge
validators                0.20.0             pyhd8ed1ab_0    conda-forge
vine                      5.0.0              pyhd8ed1ab_1    conda-forge
wcwidth                   0.2.6              pyhd8ed1ab_0    conda-forge
webencodings              0.5.1                      py_1    conda-forge
websocket-client          1.6.1              pyhd8ed1ab_0    conda-forge
wheel                     0.40.0             pyhd8ed1ab_1    conda-forge
widgetsnbextension        4.0.8              pyhd8ed1ab_0    conda-forge
xcb-util                  0.4.0                hd590300_1    conda-forge
xcb-util-image            0.4.0                h8ee46fc_1    conda-forge
xcb-util-keysyms          0.4.0                h8ee46fc_1    conda-forge
xcb-util-renderutil       0.3.9                hd590300_1    conda-forge
xcb-util-wm               0.4.1                h8ee46fc_1    conda-forge
xkeyboard-config          2.39                 hd590300_0    conda-forge
xmltodict                 0.13.0             pyhd8ed1ab_0    conda-forge
xorg-kbproto              1.0.7             h7f98852_1002    conda-forge
xorg-libice               1.0.10               h7f98852_0    conda-forge
xorg-libsm                1.2.3             hd9c2040_1000    conda-forge
xorg-libx11               1.8.6                h8ee46fc_0    conda-forge
xorg-libxau               1.0.11               hd590300_0    conda-forge
xorg-libxdmcp             1.1.3                h7f98852_0    conda-forge
xorg-libxext              1.3.4                h0b41bf4_2    conda-forge
xorg-libxrender           0.9.11               hd590300_0    conda-forge
xorg-libxt                1.3.0                hd590300_0    conda-forge
xorg-renderproto          0.11.1            h7f98852_1002    conda-forge
xorg-xextproto            7.3.0             h0b41bf4_1003    conda-forge
xorg-xf86vidmodeproto     2.3.1             h7f98852_1002    conda-forge
xorg-xproto               7.0.31            h7f98852_1007    conda-forge
xtb                       6.5.1                h03160e7_1    conda-forge
xtb-python                22.1            py310h1fa729e_0    conda-forge
xz                        5.2.6                h166bdaf_0    conda-forge
yaml                      0.2.5                h7f98852_2    conda-forge
yaml-cpp                  0.7.0                h27087fc_2    conda-forge
zeromq                    4.3.4                h9c3ff4c_1    conda-forge
zipp                      3.16.2             pyhd8ed1ab_0    conda-forge
zlib                      1.2.13               hd590300_5    conda-forge
zlib-ng                   2.0.7                h0b41bf4_0    conda-forge
zstandard                 0.19.0          py310h1275a96_2    conda-forge
zstd                      1.5.2                hfc55251_7    conda-forge

ntBre avatar Jul 20 '23 21:07 ntBre

I don't recall if cosmetic attributes are meant to be serialized out - the docstring of ForceField.to_file implies they are by default.

Is this an issue with just AngleHandler and/or parameterize? Does the same thing happen with other cosmetic attributes?

mattwthompson avatar Jul 20 '23 23:07 mattwthompson

I don't recall if cosmetic attributes are meant to be serialized out - the docstring of ForceField.to_file implies they are by default.

Yes, having discard_cosmetic_attributes=False by default implies to me that they should be written out as faithfully as possible.

Does the same thing happen with other cosmetic attributes?

This feels like more of #1633 and #1493, where I think the current fix so far only safeguards specific ParameterAttributes so everything else, including cosmetics, is fair game.

>>> from openff.toolkit import ForceField
>>> ff = ForceField("/Users/lily/Downloads/input.offxml", allow_cosmetic_attributes=True)
>>> handler = ff.get_parameter_handler("Angles")
>>> handler.parameters[15]._parameterize
1 boltzmann_constant
>>> handler.parameters[14]._parameterize
'k, angle'

This only happens with parameters where parameterize="k", as the toolkit correctly interprets parameterize="k, length" as a string.

lilyminium avatar Jul 20 '23 23:07 lilyminium

Agreed - The right resolution for this would be to not convert cosmetics - There's no safe way to encode that those should be quantities vs. strings, so we should always treat them as strings. I'll accept a PR that changes this, or will get to it myself after my current backlog!

j-wags avatar Jul 27 '23 18:07 j-wags

There's #1637, but #1641 is still an issue.

lilyminium avatar Aug 02 '23 21:08 lilyminium