basegraph module

Module basegraph aims to define base classes related to the graphs in .sbs and .sbsar packages:
class common_interfaces.basegraph.BaseGraph(aIdentifier, aParamInputs)

Bases: object

Class used to provide a common interface between a Graph and a ModuleGraph.

Members:
  • mIdentifier: Unique identifier of the graph

  • mParamInputs: Absolute directory of the package

getIdentifier()

getIdentifer()

Returns:

str identifier

getAttribute(aAttributeIdentifier)

Get the given attribute value

Parameters:

aAttributeIdentifier (AttributesEnum) – the attribute identifier

Returns:

the attribute value if defined, None otherwise

getAllInputs()

Get the list of all inputs (images and parameters) defined on this graph

Returns:

a list of inputs as ParamInput

abstractmethod getAllInputsInGroup(aGroup)
Get the list of all inputs (images and parameters) contained in the given group.
If aGroup is None, returns all the parameters that are not included in a group.
Parameters:

aGroup (SBSARGuiGroup or str) – The group of parameter to consider, given a SBSARGuiGroup object or a Group identifier

Returns:

a list of inputs

getAllInputGroups()

Get the list of all groups used for the inputs of the graph.

Returns:

a list of groups as strings

getInput(aInputIdentifier)

Get the ParamInput with the given identifier, among the input images and parameters

Parameters:

aInputIdentifier (str) – input parameter identifier

Returns:

the corresponding ParamInput object if found, None otherwise

getInputFromUID(aInputUID)

Get the ParamInput with the given UID, among the input images and parameters

Parameters:

aInputUID (str) – input parameter UID

Returns:

the corresponding ParamInput object if found, None otherwise

getInputImages()

Get the list of image inputs

Returns:

a list of image inputs as ParamInput

getInputImage(aInputImageIdentifier)

Get the image input with the given identifier

Parameters:

aInputImageIdentifier (str) – input image identifier

Returns:

a ParamInput if found, None otherwise

getInputImageWithUsage(aUsage)

Get the first image input which has the given usage defined

Parameters:

aUsage (UsageEnum or str) – usage to look for

Returns:

a ParamInput if found, None otherwise

getInputParameters()

Get the list of input parameters (not image)

Returns:

a list of ParamInput

getInputParameter(aInputParamIdentifier)

Get the input parameter with the given identifier

Parameters:

aInputParamIdentifier (str) – input parameter identifier

Returns:

the corresponding ParamInput object if found, None otherwise

getInputParameterFromUID(aInputParamUID)

Get the input parameter with the given UID

Parameters:

aInputParamUID (str) – input parameter UID

Returns:

the corresponding ParamInput object if found, None otherwise

class common_interfaces.basegraph.Graph(aIdentifier, aPrimaryInput, aParamInputs, aGraphOutputs, aPresets)

Bases: BaseGraph

Class used to provide a common interface between a SBSGraph and a SBSARGraph.

Members:
  • mIdentifier: Unique identifier of the graph

  • mPrimaryInput: Execution context, with alias definition

  • mParamInputs: Absolute directory of the package

  • mGraphOutputs: Absolute path of the package

  • mPresets: List of parameters presets

getAllPresets()

Get all the presets defined on this graph

Returns:

a list of Preset

getAttribute(aAttributeIdentifier)

Get the given attribute value

Parameters:

aAttributeIdentifier (AttributesEnum) – the attribute identifier

Returns:

the attribute value if defined, None otherwise

getGraphOutputs()

Get all the graph outputs

Returns:

the list of GraphOutput defined on this graph

getGraphOutput(aOutputIdentifier)

Get the graph output with the given identifier

Parameters:

aOutputIdentifier (str) – identifier of the output

Returns:

a GraphOutput object if found, None otherwise

getGraphOutputWithUsage(aUsage)

Get the first graph output which has the given usage defined

Parameters:

aUsage (UsageEnum or str) – usage to look for

Returns:

a GraphOutput object if found, None otherwise

getPreset(aPresetLabel)

Get the preset with the given label

Returns:

a Preset object if found, None otherwise

abstractmethod getPrimaryInput()

Get the primary input of the graph

Returns:

The primary input as a string if it exists, None otherwise

abstractmethod isPrimaryInput(aInput)

Check if the given input is the primary input for this graph or not

Parameters:

aInput (str) – The input to check

Returns:

True if this is the primary input, False otherwise