Refactoring AMML handler functions
The handler registry ase_p_df
and all referenced handler functions should go to a special module. Then get_ase_property
should be rewritten: calc_name
-> method_name
, avoid use of generic
, avoid results
parameter (delegate mapping to handlers), delegate as much as possible to the the handler functions.
For example, this code
{
'calc_name': 'turbomole',
'prop_name': 'transition_state',
'internal_name': 'vibrational spectrum',
'handler': tm_transition_state_handler
}
will become something like
{
'method': 'turbomole',
'property': 'transition_state',
'handler': tm_transition_state_handler
}
There are two methods to retrieve a property: from results list of dicts or from a list of calculators. The switching between the two methods can be done in the handlers. Because the handler is already bound to a method and a property the internal name and the method are not ambiguous.
Edited by Ivan Kondov