gemseo / core

monitoring module

Monitoring mechanism to track GEMSEO execution (update events)

Classes:

Monitoring(*args, **kwargs)

This class implements the observer pattern.

class gemseo.core.monitoring.Monitoring(*args, **kwargs)[source]

Bases: object

This class implements the observer pattern.

It is a singleton, it is called by GEMSEO core classes like MDODicipline whenever an event of interest like a status change occurs. Client objects register with add_observer and are notified whenever a discipline status change occurs.

Initializes the monitoring.

Parameters

scenario (MDOScenario) – the scenario to be monitored.

Methods:

add_observer(observer)

Registers an observer object interested in observable update events.

get_statuses()

Gets the statuses of all disciplines.

remove_all_observers()

Unsubscribes all observers.

remove_observer(observer)

Unsubscribes the given observer.

update(atom)

Notifies observers that the corresponding observable object is updated.

add_observer(observer)[source]

Registers an observer object interested in observable update events.

Parameters

observer – object to be notified

get_statuses()[source]

Gets the statuses of all disciplines.

Returns

a dictionary of all statuses, keys are the atom ids

Return type

dict

remove_all_observers()[source]

Unsubscribes all observers.

remove_observer(observer)[source]

Unsubscribes the given observer.

Parameters

observer – observer to be removed

update(atom)[source]

Notifies observers that the corresponding observable object is updated. Observers have to know what to retrieve from the observable object.

Parameters

atom – updated object