openmmtools
openmmtools copied to clipboard
Generalize how we autodetect global controllable parameters
Currently, the alchemy
module uses this code to identify controllable alchemical global parameters, which is restricted to a limited list that does not include many of the alchemical parameters we use in perses. We should generalize this to autodetect parameters, perhaps using a prefix (with lambda_
as a sensible default) to identify them.
As a workaround, the following is an idiom for augmenting the known alchemical parameters:
# Make sure AlchemicalState knows about some alchemical parameters
for name in ['lambda_sterics_core', 'lambda_electrostatics_core']:
# Add the parameter
setattr(alchemy.AlchemicalState, name, alchemy.AlchemicalState._LambdaParameter(name))