Closed dwhswenson closed 7 months ago
Hello @dwhswenson! Thanks for opening this PR. We checked the lines you've touched for PEP 8 issues, and found:
gufe/custom_codecs.py
:Line 110:27: E261 at least two spaces before inline comment Line 110:28: E262 inline comment should start with '# '
Migration of settings is not working as intended in OpenFE.
Fundamentally, the issue is that we have two serialization mechanisms: one for
GufeTokenizable
s, and one for any other objects. ForGufeTokenizable
s, we have explicitto_dict
/from_dict
methods. For all other objects, we use the custom JSON. As a matter of practice, objects must be reloaded from JSON before they are inserted intoGufeTokenizable
s, so objects using the custom JSON path are deserialized beforeGufeTokenizable
s.However, this becomes a problem for settings migration, because settings use the custom JSON serialization path. So they get reconstituted before we hit the migration hooks. This leads to errors if, e.g., you rename a setting.
As of the first commit in this PR, this should fix some problems downstream, but there aren't tests in place to ensure that it is at all future proofed. I think the approach here may not be the best, long-term, but this is a start to a band-aid for it.