8.4.8. pymodaq_utils.factory module

Created the 04/11/2022

@author: Sebastien Weber

class pymodaq_utils.factory.BuilderBase(name, bases, namespace, /, **kwargs)[source]

Bases: ABCMeta

Abstract class defining an object/service builder with a callable interface accepting some arguments

See https://realpython.com/factory-method-python/ for some details

See also

pymodaq.post_treatment.process_1d_to_scalar

Methods

__call__(*args, **kwargs)

class pymodaq_utils.factory.ObjectFactory[source]

Bases: object

Generic ObjectFactory with a decorator register to add object builders to the factory with a unique key identifier

See https://realpython.com/factory-method-python/ for some details

Examples

@ObjectFactory.register(‘custom’) def my_custom_builder():

pass

See also

pymodaq.post_treatment.process_1d_to_scalar.Data1DProcessorFactory

Attributes:
builders
keys

Methods

create

get_class

keys_function

register

classmethod create(key, **kwargs)[source]
classmethod get_class(key)[source]
classmethod register(key)[source]
Return type:

Callable

keys_function(do_sort=True)[source]
property builders
property keys