d3m.index¶
-
d3m.index.get_loaded_primitives()[source]¶ Returns a list of all currently loaded primitives.
- Returns
A list of all currently loaded primitives.
- Return type
-
d3m.index.get_primitive(primitive_path)[source]¶ Loads (if not already) a primitive class and returns it.
- Parameters
primitive_path (
str) – A Python path underd3m.primitivesnamespace of a primitive.- Returns
A primitive class.
- Return type
-
d3m.index.get_primitive_by_id(primitive_id)[source]¶ Returns a primitive class based on its ID from all currently loaded primitives.
- Parameters
primitive_id (
str) – An ID of a primitive.- Returns
A primitive class.
- Return type
-
d3m.index.load_all(blocklist=None)[source]¶ Loads all primitives available and populates
d3m.primitivesnamespace with them.If a primitive cannot be loaded, an error is logged, but loading of other primitives continue.
- Parameters
blocklist (
Optional[Collection[str]]) – A collection of primitive path prefixes to not (try to) load.- Return type
None
-
d3m.index.register_primitive(primitive_path, primitive)[source]¶ Registers a primitive under
d3m.primitivesnamespace.This is useful to register primitives not necessary installed on the system or which are generated at runtime. It is also useful for testing purposes.
primitive_pathhas to start withd3m.primitives.- Parameters
primitive_path (
str) – A primitive path to register a primitive under.primitive (
Type[PrimitiveBase]) – A primitive class to register.
- Return type
None
-
d3m.index.search(*, primitive_path_prefix=None)[source]¶ Returns a list of primitive paths (Python paths under
d3m.primitivesnamespace) for all known (discoverable through entry points) primitives, or limited by theprimitive_path_prefixsearch argument.Not all returned primitive paths are not necessary loadable and it is not necessary that they are all really pointing to primitive classes, because this method does not try to load them yet to determine any of that.