neuraxle.metaopt.observable

Module-level documentation for neuraxle.metaopt.observable. Here is an inheritance diagram, including dependencies to other base modules of Neuraxle:


Neuraxle’s Observable Classes

Base observable classes, implementing the Observer pattern. Some of them are used to track the evolution of the optimization process.

class neuraxle.metaopt.observable._ObservableRepo[source]

Bases: typing.Generic

This class is used to implement the Observer design pattern. The _Observable class is a subject that is being observed by the _Observer class. The type T is the type of the value that will be observed.

There are methods that the observer can define to send the notification: - notify_next(value: T), - notify_complete(value: T).

The _Observable class is a generic class, so it can be used with any type T.

It is possible to subscribe and unsubscribe observers. A subscription is a call to the subscribe method of the _Observable class. A unsubscription is a call to the unsubscribe method of the _Observable class. Thus, the subsibers receive the notifications of the _Observable class.

A notification is a call to one of the notify_* methods of the _Observable class. A notification is a call to one of the update_* methods of the _Observer class.

__init__()[source]

Initialize self. See help(type(self)) for accurate signature.

subscribe(observer: neuraxle.metaopt.observable._ObserverOfRepo[~BaseDataclassT][BaseDataclassT])[source]
unsubscribe(observer: neuraxle.metaopt.observable._ObserverOfRepo[~BaseDataclassT][BaseDataclassT])[source]
notify_next(value: BaseDataclassT)[source]
notify_complete(value: BaseDataclassT)[source]
class neuraxle.metaopt.observable._ObserverOfRepo[source]

Bases: typing.Generic

This class is used to implement the Observer design pattern. The _Observer class is an observer that is being notified by the _Observable class. The type T is the type of the value that will be observed.

Upon receiving a notification, the _Observer class can define these methods: - update_next(value: T), - update_complete(value: T)

These methods are called by the _Observable class observing the observer.

update_next(value: BaseDataclassT)[source]
update_complete(value: BaseDataclassT)[source]