Subgroup: Processing
Class: QgsProcessingModelChildAlgorithm¶
-
class
qgis.core.
QgsProcessingModelChildAlgorithm
(algorithmId: str = '')¶ Bases:
qgis._core.QgsProcessingModelComponent
Constructor for QgsProcessingModelChildAlgorithm. The
algorithmId
parameter should be set to a QgsProcessingAlgorithm algorithm ID.QgsProcessingModelChildAlgorithm(other: QgsProcessingModelChildAlgorithm)
Child algorithm representing a single component of a QgsProcessingModelAlgorithm.
New in version 3.0: Methods
addParameterSources
Adds a parameter source. algorithm
Returns the underlying child algorithm, or a None if a matching algorithm is not available. algorithmId
Returns the underlying child algorithm’s ID. asPythonCode
Attempts to convert the child to executable Python code. childId
Returns the child algorithm’s unique ID string, used the identify this child algorithm within its parent model. configuration
Returns the child algorithm’s configuration map. dependencies
Returns the list of child algorithms from the parent model on which this algorithm is dependent. generateChildId
Automatically generates a unique childId() for the algorithm, avoiding child IDs which are already present in model
.isActive
Returns true if the child algorithm is active. loadVariant
Loads this child from a QVariant. modelOutput
Returns the final model output with matching name
.modelOutputs
Returns the map of final model outputs which are generated by this child algorithm. outputsCollapsed
Returns true if the list of outputs for this algorithm should be collapsed in the graphical modeler. parameterSources
Returns a map of parameter sources. parametersCollapsed
Returns true if the list of parameters for this algorithm should be collapsed in the graphical modeler. removeModelOutput
Removes an existing output from the final model outputs. restoreCommonProperties
saveCommonProperties
setActive
Sets whether the child algorithm is active. setAlgorithmId
Sets the underlying child algorithm’s ID. setChildId
Sets the child algorithm’s unique id
string, used the identify this child algorithm within its parent model.setConfiguration
Sets the child algorithm’s configuration
map.setDependencies
Sets the list of child algorithms from the parent model on which this algorithm is dependent. setModelOutputs
Sets the map of final model outputs
which are generated by this child algorithm.setOutputsCollapsed
Sets whether the list of outputs for this algorithm should be collapsed in the graphical modeler. setParameterSources
Sets the map of parameter sources
.setParametersCollapsed
Sets whether the list of parameters for this algorithm should be collapsed in the graphical modeler. toVariant
Saves this child to a QVariant. Signals
Attributes
-
addParameterSources
(self, name: str, source: Iterable[QgsProcessingModelChildParameterSource])¶ Adds a parameter source. The
name
argument should match one of the child algorithm’s parameter names, and thesources
argument is used to set the sources for that parameter.Any existing parameter sources with matching name will be replaced.
See also
See also
-
algorithm
(self) → QgsProcessingAlgorithm¶ Returns the underlying child algorithm, or a None if a matching algorithm is not available.
See also
-
algorithmId
(self) → str¶ Returns the underlying child algorithm’s ID.
See also
See also
-
asPythonCode
(self) → str¶ Attempts to convert the child to executable Python code.
-
childId
(self) → str¶ Returns the child algorithm’s unique ID string, used the identify this child algorithm within its parent model.
See also
See also
-
configuration
(self) → Dict[str, Any]¶ Returns the child algorithm’s configuration map.
This map specifies configuration settings which are passed to the algorithm, allowing it to dynamically adjust its initialized parameters and outputs according to this configuration. This allows child algorithms in the model to adjust their behavior at run time according to some user configuration.
See also
-
dependencies
(self) → List[str]¶ Returns the list of child algorithms from the parent model on which this algorithm is dependent. The returned list contains the id() of the dependent algorithms.
See also
-
generateChildId
(self, model: QgsProcessingModelAlgorithm)¶ Automatically generates a unique childId() for the algorithm, avoiding child IDs which are already present in
model
.See also
See also
-
isActive
(self) → bool¶ Returns true if the child algorithm is active.
See also
-
loadVariant
(self, child: Any) → bool¶ Loads this child from a QVariant.
See also
-
modelOutput
(self, name: str) → QgsProcessingModelOutput¶ Returns the final model output with matching
name
. If no output exists with the name, a new one will be created and returned.If child model outputs are altered by this method,
QgsProcessingModelAlgorithm.updateDestinationParameters()
must be called on the parent model.See also
See also
-
modelOutputs
(self) → object¶ Returns the map of final model outputs which are generated by this child algorithm. The keys are the output names from this child algorithm. Only outputs which are part of the final outputs from the model are included in this map.
See also
See also
-
outputsCollapsed
(self) → bool¶ Returns true if the list of outputs for this algorithm should be collapsed in the graphical modeler.
See also
See also
-
parameterSources
(self) → object¶ Returns a map of parameter sources. The keys are the child algorithm parameter names, the values are the sources for that parameter.
See also
See also
-
parametersCollapsed
(self) → bool¶ Returns true if the list of parameters for this algorithm should be collapsed in the graphical modeler.
See also
See also
-
removeModelOutput
(self, name: str) → bool¶ Removes an existing output from the final model outputs.
QgsProcessingModelAlgorithm.updateDestinationParameters() must be called on the parent model.
See also
New in version 3.2.
-
restoreCommonProperties
()¶
-
saveCommonProperties
()¶
-
setActive
(self, active: bool)¶ Sets whether the child algorithm is active.
See also
-
setAlgorithmId
(self, algorithmId: str)¶ Sets the underlying child algorithm’s ID. This should be set to an existing QgsProcessingAlgorithm algorithm ID.
See also
See also
-
setChildId
(self, id: str)¶ Sets the child algorithm’s unique
id
string, used the identify this child algorithm within its parent model.See also
See also
-
setConfiguration
(self, configuration: Dict[str, Any])¶ Sets the child algorithm’s
configuration
map.This map specifies configuration settings which are passed to the algorithm, allowing it to dynamically adjust its initialized parameters and outputs according to this configuration. This allows child algorithms in the model to adjust their behavior at run time according to some user configuration.
See also
-
setDependencies
(self, dependencies: Iterable[str])¶ Sets the list of child algorithms from the parent model on which this algorithm is dependent. The list should contain the id() of the dependent algorithms.
See also
-
setModelOutputs
(self, outputs: Dict[str, QgsProcessingModelOutput])¶ Sets the map of final model
outputs
which are generated by this child algorithm. Only outputs which are part of the final outputs from the model should be included in this map.If child model outputs are altered by this method,
QgsProcessingModelAlgorithm.updateDestinationParameters()
must be called on the parent model.See also
-
setOutputsCollapsed
(self, collapsed: bool)¶ Sets whether the list of outputs for this algorithm should be collapsed in the graphical modeler.
See also
See also
-
setParameterSources
(self, sources: object)¶ Sets the map of parameter
sources
. The keys are the child algorithm parameter names, the values are the sources for that parameter.See also
See also
-
setParametersCollapsed
(self, collapsed: bool)¶ Sets whether the list of parameters for this algorithm should be collapsed in the graphical modeler.
See also
See also
-
toVariant
(self) → Any¶ Saves this child to a QVariant.
See also
-