omnisolver.random#

Package with purely random reference sampler.

This also serves as a reference implementation of omnisolver plugins.

Submodules#

Package Contents#

Classes#

Plugin

Namedtuple storing all information needed from plugin.

Functions#

plugin_from_specification(→ Plugin)

Create Plugin constructed from given specification.

get_plugin(→ omnisolver.common.plugin.Plugin)

Get package name and resource path.

Attributes#

plugin_impl

class omnisolver.random.Plugin#

Bases: NamedTuple

Namedtuple storing all information needed from plugin.

name: str#
description: str#
create_sampler: Callable[Ellipsis, dimod.Sampler]#
populate_parser: Callable[[argparse.ArgumentParser], None]#
init_args: Iterable[str]#
sample_args: Iterable[str]#
omnisolver.random.plugin_from_specification(specification, loader=importlib.import_module) Plugin#

Create Plugin constructed from given specification.

Parameters:
  • specification – dictionary specifying properties of the solver. For reference, see random.yml in omnisolver.random package.

  • 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”]

omnisolver.random.plugin_impl#
omnisolver.random.get_plugin() omnisolver.common.plugin.Plugin#

Get package name and resource path.