FqprActionContainer¶
- class HSTB.kluster.fqpr_actions.FqprActionContainer(parent=None)¶
Bases:
objectActionContainer attached to the fqpr_intelligence.FqprIntel object. Holds the FqprActions and manages the adding/ removing/updating/executing of actions.
fqpr = fully qualified ping record, the term for the datastore in kluster, see fqpr_generation
Methods Summary
add_action(action)Add a new action, autosort by priority whenever we do
clear()Clear all actions and trigger any observers using the _update_actions method
clear_actions_by_type(action_type)Remove all actions from the actions buffer that are of the provided type
execute_action([idx])Run the action selected from the action list using the provided index.
Actions are sorted on update, so the first action in the list is always the highest priority one
remove_action(action)Remove an action, autosort by priority whenever we do
return_actions_by_type(action_type)Return all actions from the actions buffer that are of the provided type
update_action(action, **kwargs)Update an existing action with new arguments.
update_action_from_list(action_type, ...)Remove any actions that have destinations not in the action_destination_list.
update_actions_client(client)On executing an action, we trigger this to update the action with the new client that we might have generated AFTER building the action originally.
update_unmatched(new_unmatched)Update the unmatched files dict, used to provide a tooltip in the action gui
Methods Documentation
- add_action(action)¶
Add a new action, autosort by priority whenever we do
- Parameters
action (
FqprAction) – new FqprAction instance to add
- clear()¶
Clear all actions and trigger any observers using the _update_actions method
- clear_actions_by_type(action_type)¶
Remove all actions from the actions buffer that are of the provided type
- Parameters
action_type (
str) – one of ‘multibeam’, ‘svp’, ‘navigation’, ‘processing’, ‘gridding’
- execute_action(idx=0)¶
Run the action selected from the action list using the provided index. Removes the action after execution. Return is generally the affected fqpr_instance.
- Parameters
idx (
int) – index of the action in the actions list
- get_next_action()¶
Actions are sorted on update, so the first action in the list is always the highest priority one
- Returns
highest priority action
- Return type
- remove_action(action)¶
Remove an action, autosort by priority whenever we do
- Parameters
action (
FqprAction) – FqprAction instance to remove
- return_actions_by_type(action_type)¶
Return all actions from the actions buffer that are of the provided type
- Parameters
action_type (
str) – one of ‘multibeam’, ‘svp’, ‘navigation’, ‘processing’, ‘gridding’- Returns
list of actions that are of the provided type
- Return type
list
- update_action(action, **kwargs)¶
Update an existing action with new arguments. Example would be if you have a conversion action and the quantity of multibeam files changes. Action would be updated with the new list of files to convert.
- Parameters
action (
FqprAction) – FqprAction to updatekwargs – dict of keyword arguments to update
- update_action_from_list(action_type, action_destination_list)¶
Remove any actions that have destinations not in the action_destination_list. This method allows us to remove actions that no longer apply.
- Parameters
action_type (
str) – type of action, ex: ‘multibeam’action_destination_list (
list) – list of valid destinations to filter the actions by
- Returns
list – list of valid actions that match the provided action type (after removing actions)
list – list of destinations from all valid actions
- update_actions_client(client)¶
On executing an action, we trigger this to update the action with the new client that we might have generated AFTER building the action originally.
If client is None, dask is disabled so we ensure the action also has None for client.
- Parameters
client (
Optional[Client]) – dask distributed client instance
- update_unmatched(new_unmatched)¶
Update the unmatched files dict, used to provide a tooltip in the action gui