key_renamed#

gufe.tokenization.key_renamed(dct, old_name, new_name)#

Serialization migration: Rename a key in the dictionary.

This can be used in when writing a serialization migration (see GufeTokenizable.serialization_migration() ) where a key has been renamed (e.g., a parameter name has changed).

Parameters:
  • dct (dict) – dictionary based on the old serialization version

  • old_name (str) – name of the key in the old serialization representation

  • new_name (str) – name of the key in the new serialization representation

Returns:

input dictionary modified to rename the key from the old name to the new one

Return type:

dict