class documentation
Model class.
The model maintains a strict hierarchy of dependencies: parameters > metric > field > sampling volume > wire When a lower module's data changed, all higher modules are invalidated (i.e. have their calculation results reset).
Method | __init__ |
Initializes the model. |
Method | calculate |
Calculates the field. |
Method | calculate |
Calculates the metric. |
Method | calculate |
Calculates the parameters. |
Method | calculate |
Calculates the sampling volume. |
Method | calculate |
Calculates the wire. |
Method | field |
Sets the currently selected field type. |
Method | get |
Gets a field by type if the field is valid. |
Method | invalidate |
Invalidates multiple hierarchy levels at once, in descending order of hierarchy. |
Method | on |
Gets called when the field was invalidated. |
Method | on |
Gets called when the field was successfully calculated. |
Method | on |
Gets called when the metric was invalidated. |
Method | on |
Gets called when the metric was successfully calculated. |
Method | on |
Gets called when the parameters were invalidated. |
Method | on |
Gets called when the parameters were successfully calculated. |
Method | on |
Gets called when the sampling volume was invalidated. |
Method | on |
Gets called when the sampling volume was successfully calculated. |
Method | on |
Gets called when the wire was invalidated. |
Method | on |
Gets called when the wire was successfully calculated. |
Method | set |
Sets the field. |
Method | set |
Sets the metric. |
Method | set |
Sets the parameters. |
Method | set |
Sets the sampling volume. |
Method | set |
Sets the wire. |
Class Variable |
|
Undocumented |
Instance Variable | field |
Currently selected field type |
Instance Variable | gui |
Undocumented |
Instance Variable | metric |
Undocumented |
Instance Variable | parameters |
Undocumented |
Instance Variable | sampling |
Undocumented |
Instance Variable | wire |
Undocumented |
Property | field |
Currently selected field |
Property | valid |
True if model is valid, False otherwise |
Instance Variable | _field |
Undocumented |
Instance Variable | _field |
Undocumented |
def calculate_field(self, progress_callback:
Callable
, num_cores: int
, backend_type: int
) -> bool
:
¶
Calculates the field.
Parameters | |
progressCallable | Progress callback |
numint | Number of CPU cores to use |
backendint | Backend type |
Returns | |
bool | True if successful, False if interrupted |
Calculates the metric.
Parameters | |
progressCallable | Progress callback |
Returns | |
bool | True (currently non-interruptable) |
Calculates the parameters.
Parameters | |
progressCallable | Progress callback |
Returns | |
bool | True (currently non-interruptable) |
Calculates the sampling volume.
Parameters | |
progressCallable | Progress callback |
Returns | |
bool | True if successful, False if interrupted |
Calculates the wire.
Parameters | |
progressCallable | Progress callback |
Returns | |
True if successful, False if interrupted |
Gets a field by type if the field is valid.
Parameters | |
fieldint | Field type |
Returns | |
Field | None | Field if valid, None otherwise |
def invalidate(self, do_wire:
bool
= False, do_sampling_volume: bool
= False, do_field: bool
= False, do_metric: bool
= False, do_parameters: bool
= False, do_all: bool
= False):
¶
Invalidates multiple hierarchy levels at once, in descending order of hierarchy.
Parameters | |
dobool | Enable to invalidate wire |
dobool | Enable to invalidate sampling volume |
dobool | Enable to invalidate all fields |
dobool | Enable to invalidate metric |
dobool | Enable to invalidate parameters |
dobool | Enable to invalidate all hierarchy levels |
Gets called when the metric was successfully calculated.
Note: Field label creation is triggered on-demand inside VisPyCanvas.redraw()
, not here.
Sets the field.
Parameters | |
invalidate:bool | Enable to invalidate this model hierarchy level |
fieldint | Field type |
*args | Undocumented |
**kwargs | Undocumented |
Sets the metric.
Parameters | |
invalidate:bool | Enable to invalidate this model hierarchy level |
*args | Undocumented |
**kwargs | Undocumented |
Sets the parameters.
Parameters | |
invalidate:bool | Enable to invalidate this model hierarchy level |
*args | Undocumented |
**kwargs | Undocumented |
Sets the sampling volume.
Parameters | |
invalidate:bool | Enable to invalidate this model hierarchy level |
*args | Undocumented |
**kwargs | Undocumented |