deepmd.utils.plugin
Base of plugin systems. A class to register and restore plugins. Metaclass for defining Abstract Base Classes (ABCs). A class to remove type from input arguments. Make a plugin registry. A class to register and restore plugins. Examples Bases: Metaclass for defining Abstract Base Classes (ABCs). Use this metaclass to create an ABC. An ABC can be subclassed directly, and then acts as a mix-in class. You can also register unrelated concrete classes (even built-in classes) and unrelated ABCs as ‘virtual subclasses’ – these and their descendants will be considered subclasses of the registering ABC by the built-in issubclass() function, but the registering ABC won’t show up in their MRO (Method Resolution Order) nor will method implementations defined by the registering ABC be callable (not even via super()).Classes
Functions
make_plugin_registry(→ Type[object])Module Contents
>>> plugin = Plugin()
>>> @plugin.register("xx")
def xxx():
pass
>>> print(plugin.plugins["xx"])
VariantMeta, abc.ABCMeta