openmmtools icon indicating copy to clipboard operation
openmmtools copied to clipboard

Generalize how we autodetect global controllable parameters

Open jchodera opened this issue 3 years ago • 1 comments

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.

jchodera avatar Mar 27 '21 19:03 jchodera

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))

jchodera avatar Mar 27 '21 19:03 jchodera