OpenPisco.Optim.Algorithms.OptimAlgoFactory module#

This module provide a factory to register all the optimization algoriths.

OpenPisco.Optim.Algorithms.OptimAlgoFactory.CheckIntegrity()[source]#
OpenPisco.Optim.Algorithms.OptimAlgoFactory.Create(name: str, ops: Optional[Dict] = None) Any[source]#

Create optimization algorithm instance from factory

Parameters
  • name (str) – class name registered in factory

  • ops (Optional[Dict], optional) – options, by default None

Returns

optimization algorithm instance

Return type

Any

OpenPisco.Optim.Algorithms.OptimAlgoFactory.InitAllAlgos()[source]#

Activate registration of all optimization algorithms (thus, RegisterClass should be called in the imported file). If a new optimization algorithm is added, an import of the suitable file must be added here

class OpenPisco.Optim.Algorithms.OptimAlgoFactory.OptimAlgoFactory[source]#

Bases: Factory

OpenPisco.Optim.Algorithms.OptimAlgoFactory.RegisterClass(name: str, classtype: Type, constructor: Optional[callable] = None, withError: bool = True) None[source]#

Register class

Parameters
  • name (str) – key to retrieve the instances of classType

  • classtype (Type) – A type of a class

  • constructor (Optional[callable], optional) – dedicated constructor, by default None

  • withError (bool, optional) – if false then the user can override a existent class/constructor , by default True