Source code for schrodinger.models.adapters.inputconfig
import copy
from configobj import ConfigObj
from schrodinger.application.inputconfig import InputConfig
from schrodinger.models.adapters.abstractadapter import AbstractAdapter
[docs]class ParamToConfigObj(AbstractAdapter):
"""
Adapter to copy data from a compound param to a config obj
If the configobj is supplied and has a spec, the compound param must have
subparams with the same name (or lowercase equivalent) as any required or
unset keyword for the configobj to be valid.
"""
@classmethod
def _createDefaultObj(cls):
return ConfigObj()
@classmethod
def _copyItem(cls, key, value, destination_obj):
destination_obj[key] = copy.deepcopy(value)
@classmethod
def _convertKeyword(cls, param_key):
return param_key.upper()