orrery.models.ModelRegistry#
- class ModelRegistry[source]#
Bases:
object
Holds a list of named Models
Methods
Add observer to listen to invalidated callback of the specified Model
Add a model to this registry with the specified name
Add observer to listen to changed callback of the specified Model
Return the model in this registry with the specified name
Return a Model containing a list of current model names
Return dictionary of registered model names to models
Remove previously added invalidated observer
Remove previously added value changed observer
- add_invalidated_observer(name, callback, **kwargs)[source]#
Add observer to listen to invalidated callback of the specified Model
- add_model(name, model=None)[source]#
Add a model to this registry with the specified name
- Return type:
- Parameters:
name – Name used to reference the model in the registry
model – The Model to add. If a model is not specified, a new ValueModel will be created
- Returns:
the Model that was added to the registry
- add_observer(name, callback, **kwargs)[source]#
Add observer to listen to changed callback of the specified Model