:py:mod:`omnisolver.random` =========================== .. py:module:: omnisolver.random .. autoapi-nested-parse:: Package with purely random reference sampler. This also serves as a reference implementation of omnisolver plugins. Submodules ---------- .. toctree:: :titlesonly: :maxdepth: 1 sampler/index.rst Package Contents ---------------- Classes ~~~~~~~ .. autoapisummary:: omnisolver.random.Plugin Functions ~~~~~~~~~ .. autoapisummary:: omnisolver.random.plugin_from_specification omnisolver.random.get_plugin Attributes ~~~~~~~~~~ .. autoapisummary:: omnisolver.random.plugin_impl .. py:class:: Plugin Bases: :py:obj:`NamedTuple` Namedtuple storing all information needed from plugin. .. py:attribute:: name :type: str .. py:attribute:: description :type: str .. py:attribute:: create_sampler :type: Callable[Ellipsis, dimod.Sampler] .. py:attribute:: populate_parser :type: Callable[[argparse.ArgumentParser], None] .. py:attribute:: init_args :type: Iterable[str] .. py:attribute:: sample_args :type: Iterable[str] .. py:function:: plugin_from_specification(specification, loader=importlib.import_module) -> Plugin Create Plugin constructed from given specification. :param specification: dictionary specifying properties of the solver. For reference, see random.yml in omnisolver.random package. :param loader: function used for loading modules. Usually no need to override this. :returns: a instance of Plugin with the following properties: - plugin.name is taken from "name" in specification - create_solver of a class pointed to by specification["sampler_class"] - populate_parser acts in such a way, that it adds to the target parser all arguments present in specification["args"] .. py:data:: plugin_impl .. py:function:: get_plugin() -> omnisolver.common.plugin.Plugin Get package name and resource path.