(class from pyomo.contrib.viewer.ui_data)
pyomo.contrib.viewer.ui_data
Bases: object
object
This is the UIData object minus the signals. This is the base class for UIData. The class is split this way for testing when PyQt is not available.
This class holds the basic UI setup, but doesn’t depend on Qt. It shouldn’t really be used except for testing when Qt is not available.
model – The Pyomo model to view
model_var_name_in_main – if this is set, check that the model variable which points to a model object in __main__ has the same id when the UI is refreshed due to a command being executed in jupyter notebook or QtConsole, if not the same id, then update the model Since the model viewer is not necessarily pointed at a model in the __main__ namespace only set this if you want the model to auto update. Since the model selector dialog lets you choose models from the __main__ namespace it sets this when you select a model. This is useful if you run a script repeatedly that replaces a model preventing you from looking at a previous version of the model.
Methods
__init__([model, model_var_name_in_main])
__init__
This class holds the basic UI setup, but doesn't depend on Qt.
begin_update()
begin_update
Lets the model setup be changed without emitting the updated signal until the end_update function is called.
calculate_constraints()
calculate_constraints
calculate_expressions()
calculate_expressions
emit_exec_refresh()
emit_exec_refresh
Don't forget to overloaded this, not raising a NotImplementedError so tests can run without Qt
emit_update()
emit_update
end_update([emit])
end_update
Sets the begin update flag to false.
Attributes
model
Member Documentation
Don’t forget to overloaded this, not raising a NotImplementedError so tests can run without Qt
Sets the begin update flag to false. Needs to be overloaded to also emit an update signal in the full UIData class