9.3. Algorithms, Widgets and Filters¶
The algorithm-plugins are containers for filters and widgets. They do not have an own instance. Filters are called by the filter(…)-Methods. To get an online help use filterHelp(…). Widgets are used with ui-dialogs. To get an online help use widgetHelp(…).
-
itom.
filter
(name: str, *args, _observer=None, **kwds) → Any¶ Invokes a filter (or algorithm) function from an algorithm-plugin.
This function is used to invoke itom filter-functions or algorithms, declared within itom-algorithm plugins. The parameters (arguments) depends on the specific filter function. Call
filterHelp()
to get a list of available filter functions.Pass all mandatory or optional arguments of the filter as positional or keyword-based parameters. Some filters, that implement the additional observer interface, can accept another
progressObserver
object, that allows monitoring the progress of the filter and / or interrupting the execution. If such an observer is given, you have to pass it as keyword-based argument_observer
!.During the execution of the filter, the python GIL (general interpreter lock) is released (e.g. for further asynchronous processes.
- Parameters
- name
str
The name of the filter
- *args
Any
positional arguments for the specific filter-method
- _observer
progressObserver
,optional
if the called filter implements the extended interface with progress and status information, an optional
progressObserver
object can be given (only as keyword-based parameter) which is then used as observer for the current progress of the filter execution. It is then also possible to interrupt the execution earlier (depending on the implementation of the filter). The observer object is reset before passed to the called filter function (using the slotreset()
).- **kwds
Any
keyword-based arguments for the specific filter-method. The argument name
_observer
is reserved for special use.
- name
- Returns
- out
obj
The returned values depend on the definition of each filter. In general it is a tuple of all output parameters that are defined by the filter function.
- out
See also
-
itom.
filterHelp
(filterName='', dictionary=0, furtherInfos=0) → Optional[dict]¶ Print outs an online help for the given filter(s) or return help information as dictionary.
This method prints information about one specific filter (algorithm) or a list of filters to the console output. If one specific filter, defined in an algorithm plugin, can be found that case-sensitively fits the given
filterName
, its full documentation is printed or returned. Else, a list of filters is printed whose name contains the givenfilterName
.- Parameters
- filterName
str
,optional
is the fullname or a part of any filter name which should be displayed. If
filterName
is empty or no filter matchesfilterName
(case sensitive) a list with all suitable filters is given.- dictionary
int
,optional
if
1
, a dictionary with all relevant information about the documentation of this filter is returned as dictionary and nothing is printed to the command line (default: 0).- furtherInfos
int
,optional
Usually, filters or algorithms whose name only contains the given
filterName
are only listed at the end of the information text. If this parameter is set to1
(default:0
), the full information for all these filters is printed as well.
- filterName
- Returns
- info
dict
This dictionary is only returned, if
dictionary
is set to1
. ElseNone
is returned. The dictionary contains relevant information about the desiredfilterName
.
- info
-
itom.
widgetHelp
(widgetName='', dictionary=0, furtherInfos=0) → Optional[dict]¶ Print outs an online help for the given widget(s) or return help information as dictionary.
This method prints information about one specific widget (defined in an algorithm plugin) or a list of widgets to the console output. If one specific widget can be found that case-sensitively fits the given
widgetName
, its full documentation is printed or returned. Else, a list of widgets is printed whose name contains the givenwidgetName
.- Parameters
- widgetName
str
,optional
is the fullname or a part of any widget name which should be displayed. If
widgetName
is empty or no widget matcheswidgetName
(case sensitive) a list with all suitable widgets is given.- dictionary
int
,optional
if
1
, a dictionary with all relevant information about the documentation of this widget is returned as dictionary and nothing is printed to the command line (default: 0).- furtherInfos
int
,optional
Usually, widgets whose name only contains the given
widgetName
are only listed at the end of the information text. If this parameter is set to1
(default:0
), the full information for all these widgets is printed as well.
- widgetName
- Returns
- info
dict
This dictionary is only returned, if
dictionary
is set to1
. ElseNone
is returned. The dictionary contains relevant information about the desiredwidgetName
.
- info