aiida.plugins#
Classes and functions to load and interact with plugin classes accessible through defined entry points.
Package Contents#
Classes#
Utility class that determines version information about a given plugin resource. |
Functions#
Return the plugin class registered under a given entry point group and name. |
|
Return the plugin registered under the given entry point. |
|
Return the CalcJob sub class registered under the given entry point. |
|
Return the Data sub class registered under the given entry point. |
|
Return the DbImporter sub class registered under the given entry point. |
|
Return the Group sub class registered under the given entry point. |
|
Return the Orbital sub class registered under the given entry point. |
|
Return the Parser sub class registered under the given entry point. |
|
Return the Scheduler sub class registered under the given entry point. |
|
Return the |
|
Return the Transport sub class registered under the given entry point. |
|
Return the WorkChain sub class registered under the given entry point. |
|
Return a list of all the entry points within a specific group |
|
Load the class registered under the entry point for a given name and group |
|
Load the class registered for a given entry point string that determines group and name |
|
Return an entry point, given its group and spec (as formatted in the setup) |
API#
- aiida.plugins.BaseFactory(group: str, name: str, load: bool = True) Union[importlib_metadata.EntryPoint, Any]#
Return the plugin class registered under a given entry point group and name.
- Parameters:
group – entry point group
name – entry point name
load – if True, load the matched entry point and return the loaded resource instead of the entry point itself.
- Returns:
the plugin class
- Raises:
aiida.common.MissingEntryPointError – entry point was not registered
aiida.common.MultipleEntryPointError – entry point could not be uniquely resolved
aiida.common.LoadingEntryPointError – entry point could not be loaded
- aiida.plugins.CalcJobImporterFactory(entry_point_name: str, load: bool = True) Union[importlib_metadata.EntryPoint, Type[aiida.engine.CalcJobImporter]]#
Return the plugin registered under the given entry point.
- Parameters:
entry_point_name – the entry point name.
- Returns:
the loaded
CalcJobImporterplugin.- Raises:
aiida.common.InvalidEntryPointTypeError – if the type of the loaded entry point is invalid.
- aiida.plugins.CalculationFactory(entry_point_name: str, load: bool = True) Union[importlib_metadata.EntryPoint, Type[aiida.engine.CalcJob], Callable]#
Return the CalcJob sub class registered under the given entry point.
- Parameters:
entry_point_name – the entry point name.
load – if True, load the matched entry point and return the loaded resource instead of the entry point itself.
- Returns:
sub class of
CalcJob- Raises:
aiida.common.InvalidEntryPointTypeError – if the type of the loaded entry point is invalid.
- aiida.plugins.DataFactory(entry_point_name: str, load: bool = True) Union[importlib_metadata.EntryPoint, Type[aiida.orm.Data]]#
Return the Data sub class registered under the given entry point.
- Parameters:
entry_point_name – the entry point name.
load – if True, load the matched entry point and return the loaded resource instead of the entry point itself.
- Returns:
sub class of
Data- Raises:
aiida.common.InvalidEntryPointTypeError – if the type of the loaded entry point is invalid.
- aiida.plugins.DbImporterFactory(entry_point_name: str, load: bool = True) Union[importlib_metadata.EntryPoint, Type[aiida.tools.dbimporters.DbImporter]]#
Return the DbImporter sub class registered under the given entry point.
- Parameters:
entry_point_name – the entry point name.
load – if True, load the matched entry point and return the loaded resource instead of the entry point itself.
- Returns:
sub class of
DbImporter- Raises:
aiida.common.InvalidEntryPointTypeError – if the type of the loaded entry point is invalid.
- aiida.plugins.GroupFactory(entry_point_name: str, load: bool = True) Union[importlib_metadata.EntryPoint, Type[aiida.orm.Group]]#
Return the Group sub class registered under the given entry point.
- Parameters:
entry_point_name – the entry point name.
load – if True, load the matched entry point and return the loaded resource instead of the entry point itself.
- Returns:
sub class of
Group- Raises:
aiida.common.InvalidEntryPointTypeError – if the type of the loaded entry point is invalid.
- aiida.plugins.OrbitalFactory(entry_point_name: str, load: bool = True) Union[importlib_metadata.EntryPoint, Type[aiida.tools.data.orbital.Orbital]]#
Return the Orbital sub class registered under the given entry point.
- Parameters:
entry_point_name – the entry point name.
load – if True, load the matched entry point and return the loaded resource instead of the entry point itself.
- Returns:
sub class of
Orbital- Raises:
aiida.common.InvalidEntryPointTypeError – if the type of the loaded entry point is invalid.
- aiida.plugins.ParserFactory(entry_point_name: str, load: bool = True) Union[importlib_metadata.EntryPoint, Type[aiida.parsers.Parser]]#
Return the Parser sub class registered under the given entry point.
- Parameters:
entry_point_name – the entry point name.
load – if True, load the matched entry point and return the loaded resource instead of the entry point itself.
- Returns:
sub class of
Parser- Raises:
aiida.common.InvalidEntryPointTypeError – if the type of the loaded entry point is invalid.
- class aiida.plugins.PluginVersionProvider#
Utility class that determines version information about a given plugin resource.
Initialization
- property logger: logging.Logger#
- get_version_info(plugin: str | type) dict[Any, dict[Any, Any]]#
Get the version information for a given plugin.
Note
This container will keep a cache, so if this method was already called for the given
pluginbefore for this instance, the result computed at the last invocation will be returned.- Parameters:
plugin – A class, function, or an entry point string. If the type is string, it will be assumed to be an entry point string and the class will attempt to load it first. It should be a full entry point string, including the entry point group.
- Returns:
Dictionary with the version.core and optionally version.plugin if it could be determined.
- Raises:
EntryPointError – If
pluginis a string but could not be loaded as a valid entry point.TypeError – If
plugin(or the resource pointed to it in the case of an entry point) is not a class or a function.
- aiida.plugins.SchedulerFactory(entry_point_name: str, load: bool = True) Union[importlib_metadata.EntryPoint, Type[aiida.schedulers.Scheduler]]#
Return the Scheduler sub class registered under the given entry point.
- Parameters:
entry_point_name – the entry point name.
load – if True, load the matched entry point and return the loaded resource instead of the entry point itself.
- Returns:
sub class of
Scheduler- Raises:
aiida.common.InvalidEntryPointTypeError – if the type of the loaded entry point is invalid.
- aiida.plugins.StorageFactory(entry_point_name: str, load: bool = True) Union[importlib_metadata.EntryPoint, Type[aiida.orm.implementation.StorageBackend]]#
Return the
StorageBackendsub class registered under the given entry point.- Parameters:
entry_point_name – the entry point name.
load – if True, load the matched entry point and return the loaded resource instead of the entry point itself.
- Returns:
sub class of
StorageBackend.- Raises:
aiida.common.InvalidEntryPointTypeError – if the type of the loaded entry point is invalid.
- aiida.plugins.TransportFactory(entry_point_name: str, load: bool = True) Union[importlib_metadata.EntryPoint, Type[aiida.transports.Transport]]#
Return the Transport sub class registered under the given entry point.
- Parameters:
entry_point_name – the entry point name.
load – if True, load the matched entry point and return the loaded resource instead of the entry point itself.
- Raises:
aiida.common.InvalidEntryPointTypeError – if the type of the loaded entry point is invalid.
- aiida.plugins.WorkflowFactory(entry_point_name: str, load: bool = True) Union[importlib_metadata.EntryPoint, Type[aiida.engine.WorkChain], Callable]#
Return the WorkChain sub class registered under the given entry point.
- Parameters:
entry_point_name – the entry point name.
load – if True, load the matched entry point and return the loaded resource instead of the entry point itself.
- Returns:
sub class of
WorkChainor a workfunction- Raises:
aiida.common.InvalidEntryPointTypeError – if the type of the loaded entry point is invalid.
- aiida.plugins.get_entry_points(group: str) importlib_metadata.EntryPoints#
Return a list of all the entry points within a specific group
- Parameters:
group – the entry point group
- Returns:
a list of entry points
- aiida.plugins.load_entry_point(group: str, name: str) Any#
Load the class registered under the entry point for a given name and group
- Parameters:
group – the entry point group
name – the name of the entry point
- Returns:
class registered at the given entry point
- Raises:
TypeError – if the entry_point_string is not a string type
ValueError – if the entry_point_string cannot be split into two parts on the entry point string separator
aiida.common.MissingEntryPointError – entry point was not registered
aiida.common.MultipleEntryPointError – entry point could not be uniquely resolved
aiida.common.LoadingEntryPointError – entry point could not be loaded
- aiida.plugins.load_entry_point_from_string(entry_point_string: str) Any#
Load the class registered for a given entry point string that determines group and name
- Parameters:
entry_point_string – the entry point string
- Returns:
class registered at the given entry point
- Raises:
TypeError – if the entry_point_string is not a string type
ValueError – if the entry_point_string cannot be split into two parts on the entry point string separator
aiida.common.MissingEntryPointError – entry point was not registered
aiida.common.MultipleEntryPointError – entry point could not be uniquely resolved
aiida.common.LoadingEntryPointError – entry point could not be loaded