approximation.approximator_factory module

class approximation.approximator_factory.ApproximatorFactory

Bases: object

Factory class for creating ApproxMethod instances.

Provides functionality to create ApproxMethod instances based on their unique class IDs and settings dictionaries.

SUPPORTED_APP_METHODS = {'AIG': <function ApproximatorFactory.<lambda>>, 'PS': <function ApproximatorFactory.<lambda>>}
static factory(method_id, settings=None)

Creates an ApproxMethod instance of the type specified by methodId.

The settings attribute of the ApproxMethod can be set as well. If no ApproxMethod of the given methodId is known, a NotImplementedError will be raised.

  • method_id (str) – The unique ID string of the ApproxMethod subclass to instantiate.
  • settings (Dictionary) – A dictionary containing arbitrary settings for the new ApproxMethod.

An instance of the ApproxMethod subclass specified by method_id.

Return type:



NotImplementedError – If method_id matches none of the supported ApproxMethod subclasses.