1.1.1.3.1.1.1.5.1. TreeOperation

class molpher.swig_wrappers.core.TreeOperation(*args)[source]

This class defines an interface for tree operations. It can be executed on any exploration tree using the ExplorationTree.runOperation() method or a tree can be explicitly attached to it.

It is an abstract class and therefore cannot be instantiated, but it defines a constructor that either takes a single argument (an instance of ExplorationTree) or nothing at all (in which case the associated exploration tree instance is set to None).

__call__()[source]

Call self as a function.

This method is abstract and is meant to be overridden by derived classes to run the operation on the currently registered tree (if any).

getTree()[source]

Fetch the ExplorationTree instance attached to this operation.

Note

This method always returns an instance of molpher.swig_wrappers.core.ExplorationTree. If you want to change this behaviour, you will need to override this method in the derived class.

Returns

an exploration tree

Return type

ExplorationTree

setTree(tree)[source]

Associate the given tree with this operation instance.

Parameters

tree (ExplorationTree) – the tree to associate this instance with