PyForTool
Python-fortran-tool
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
pyfortool.tree.Tree Class Reference

Public Member Functions

 __init__ (self, tree=None, descTreeFile=None, parserOptions=None, wrapH=False, verbosity=None)
 
 getFullContent (self)
 
 setFullContent (self, content)
 
 copyFromOtherTree (self, other)
 
 copyToOtherTree (self, other)
 
 signal (self, file)
 
 popSignaled (self)
 
 knownFiles (self)
 
 isValid (self)
 
 tree (self)
 
 getDirs (self)
 
 getFiles (self)
 
 update (self, file)
 
 fromJson (self, filename)
 
 toJson (self, filename)
 
 scopeToFiles (self, scopePath)
 
 fileToScopes (self, filename)
 
 needsFile (self, filename, level=1)
 
 neededByFile (self, filename, level=1)
 
 callsScopes (self, scopePath, level=1)
 
 calledByScope (self, scopePath, level=1)
 
 isUnderStopScopes (self, scopePath, stopScopes, includeInterfaces=False, includeStopScopes=False)
 
 plotTree (self, centralNodeList, output, plotMaxUpper, plotMaxLower, kind, frame=False)
 
 plotCompilTreeFromFile (self, filename, output, plotMaxUpper, plotMaxLower)
 
 plotExecTreeFromScope (self, scopePath, output, plotMaxUpper, plotMaxLower)
 
 plotCompilTreeFromScope (self, scopePath, output, plotMaxUpper, plotMaxLower)
 
 plotExecTreeFromFile (self, filename, output, plotMaxUpper, plotMaxLower)
 
 findScopeInterface (self, scopePath)
 

Protected Member Functions

 _build (self)
 
 _emptyCache (self)
 
 _incInScope (self)
 
 _compilationTree (self)
 
 _executionTree (self)
 
 _analyseFile (self, file)
 

Static Protected Member Functions

 _recurList (node, descTreePart, level, down)
 

Protected Attributes

 _tree
 
 _descTreeFile
 
 _parserOptions
 
 _wrapH
 
 _verbosity
 
 _signaled
 
 _cwd
 
 _scopes
 
 _useList
 
 _includeList
 
 _callList
 
 _funcList
 
 _cacheCompilationTree
 
 _cacheExecutionTree
 
 _cacheIncInScope
 
 _compilationTree
 
 _executionTree
 

Detailed Description

Class to browse the Tree

Definition at line 48 of file tree.py.

Constructor & Destructor Documentation

◆ __init__()

pyfortool.tree.Tree.__init__ (   self,
  tree = None,
  descTreeFile = None,
  parserOptions = None,
  wrapH = False,
  verbosity = None 
)
:param tree: list of directories composing the tree or None
:param descTreeFile: filename where the description of the tree will be stored
:param parserOptions, wrapH: see the PYFT class
:param verbosity: if not None, sets the verbosity level

Definition at line 52 of file tree.py.

Here is the call graph for this function:

Member Function Documentation

◆ _analyseFile()

pyfortool.tree.Tree._analyseFile (   self,
  file 
)
protected
:param file: Name of the file to explore, or PYFTscope object
:return: dict of use, include, call, function and scope list

Definition at line 437 of file tree.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _build()

pyfortool.tree.Tree._build (   self)
protected
Builds the self._* variable

Definition at line 199 of file tree.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _compilationTree()

pyfortool.tree.Tree._compilationTree (   self)
protected
Fill and return the self._cacheCompilationTree cached value

Definition at line 238 of file tree.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _emptyCache()

pyfortool.tree.Tree._emptyCache (   self)
protected
Empties cached values

Definition at line 222 of file tree.py.

Here is the caller graph for this function:

◆ _executionTree()

pyfortool.tree.Tree._executionTree (   self)
protected
Fill and return the self._cacheCompilationTree cached value

Definition at line 314 of file tree.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _incInScope()

pyfortool.tree.Tree._incInScope (   self)
protected
Fill and return the self._cacheIncInScope cached value

Definition at line 229 of file tree.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _recurList()

pyfortool.tree.Tree._recurList (   node,
  descTreePart,
  level,
  down 
)
staticprotected
:param node: initial node
:param descTreePart: 'compilation_tree' or 'execution_tree' part of a descTree object
:param level: number of levels (0 to get only the initial node, None to get all nodes)
:param down: True to get the nodes lower in the tree, False to get the upper ones
:return: list of nodes lower or upper tahn initial node (recursively)

Definition at line 575 of file tree.py.

Here is the caller graph for this function:

◆ calledByScope()

pyfortool.tree.Tree.calledByScope (   self,
  scopePath,
  level = 1 
)
:param scopePath: initial scope path
:param level: number of levels (0 to get only the initial scope path,
                                None to get all scopes)
:return: list of scopes that calls the initial scope path (recursively)

Definition at line 624 of file tree.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ callsScopes()

pyfortool.tree.Tree.callsScopes (   self,
  scopePath,
  level = 1 
)
:param scopePath: initial scope path
:param level: number of levels (0 to get only the initial scope path,
                                None to get all scopes)
:return: list of scopes called by the initial scope path (recursively)

Definition at line 614 of file tree.py.

Here is the call graph for this function:

◆ copyFromOtherTree()

pyfortool.tree.Tree.copyFromOtherTree (   self,
  other 
)
Sets self to be a copy of other

Definition at line 129 of file tree.py.

Here is the call graph for this function:

◆ copyToOtherTree()

pyfortool.tree.Tree.copyToOtherTree (   self,
  other 
)
Sets other to be a copy of self

Definition at line 135 of file tree.py.

Here is the call graph for this function:

◆ fileToScopes()

pyfortool.tree.Tree.fileToScopes (   self,
  filename 
)
Return the scopes contained in the file
:param filename: name of the file tn inspect
:return: list of scopes defined in the file

Definition at line 566 of file tree.py.

Here is the caller graph for this function:

◆ findScopeInterface()

pyfortool.tree.Tree.findScopeInterface (   self,
  scopePath 
)
Return the file name containing an interface for the scope path
:param scopePath: scope path for which an interface is searched
:return: (file name, interface scope) or (None, None) if not found

Definition at line 815 of file tree.py.

◆ fromJson()

pyfortool.tree.Tree.fromJson (   self,
  filename 
)
read from json

Definition at line 525 of file tree.py.

Here is the caller graph for this function:

◆ getDirs()

pyfortool.tree.Tree.getDirs (   self)
:param tree: list of directories composing the tree or None
:return: list of directories and subdirectories

Definition at line 173 of file tree.py.

Here is the call graph for this function:

◆ getFiles()

pyfortool.tree.Tree.getFiles (   self)
:param tree: list of directories composing the tree or None
:return: list of directories and subdirectories

Definition at line 185 of file tree.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getFullContent()

pyfortool.tree.Tree.getFullContent (   self)
:return: a dict containing the full content of the instance

Definition at line 89 of file tree.py.

Here is the caller graph for this function:

◆ isUnderStopScopes()

pyfortool.tree.Tree.isUnderStopScopes (   self,
  scopePath,
  stopScopes,
  includeInterfaces = False,
  includeStopScopes = False 
)
:param scopePath: scope path to test
:param stopScopes: list of scopes
:param includeInterfaces: if True, interfaces of positive scopes are also positive
:param includeInterfaces: if True, scopes that are in stopScopes return True
:return: True if the scope path is called directly or indirectly by one of the scope
         paths listed in stopScopes

Definition at line 634 of file tree.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isValid()

pyfortool.tree.Tree.isValid (   self)
Is the Tree object valid

Definition at line 163 of file tree.py.

Here is the caller graph for this function:

◆ knownFiles()

pyfortool.tree.Tree.knownFiles (   self)
:return: the list of analysez file names

Definition at line 156 of file tree.py.

◆ neededByFile()

pyfortool.tree.Tree.neededByFile (   self,
  filename,
  level = 1 
)
:param filename: initial file name
:param level: number of levels (0 to get only the initial file, None to get all files)
:return: list of file names that needs the initial file (recursively)

Definition at line 605 of file tree.py.

Here is the call graph for this function:

◆ needsFile()

pyfortool.tree.Tree.needsFile (   self,
  filename,
  level = 1 
)
:param filename: initial file name
:param level: number of levels (0 to get only the initial file, None to get all files)
:return: list of file names needed by the initial file (recursively)

Definition at line 596 of file tree.py.

Here is the call graph for this function:

◆ plotCompilTreeFromFile()

pyfortool.tree.Tree.plotCompilTreeFromFile (   self,
  filename,
  output,
  plotMaxUpper,
  plotMaxLower 
)
Compute the compilation dependency graph
:param filename: central file
:param output: output file name (.dot or .png extension)
:param plotMaxUpper: Maximum number of elements to plot, upper than the central element
:param plotMaxLower: Maximum number of elements to plot, lower than the central element

Definition at line 769 of file tree.py.

Here is the call graph for this function:

◆ plotCompilTreeFromScope()

pyfortool.tree.Tree.plotCompilTreeFromScope (   self,
  scopePath,
  output,
  plotMaxUpper,
  plotMaxLower 
)
Compute the compilation dependency graph
:param scopePath: central scope path
:param output: output file name (.dot or .png extension)
:param plotMaxUpper: Maximum number of elements to plot, upper than the central element
:param plotMaxLower: Maximum number of elements to plot, lower than the central element

Definition at line 791 of file tree.py.

Here is the call graph for this function:

◆ plotExecTreeFromFile()

pyfortool.tree.Tree.plotExecTreeFromFile (   self,
  filename,
  output,
  plotMaxUpper,
  plotMaxLower 
)
Compute the execution dependency graph
:param filename: central filename
:param output: output file name (.dot or .png extension)
:param plotMaxUpper: Maximum number of elements to plot, upper than the central element
:param plotMaxLower: Maximum number of elements to plot, lower than the central element

Definition at line 803 of file tree.py.

Here is the call graph for this function:

◆ plotExecTreeFromScope()

pyfortool.tree.Tree.plotExecTreeFromScope (   self,
  scopePath,
  output,
  plotMaxUpper,
  plotMaxLower 
)
Compute the execution dependency graph
:param scopePath: central scope path
:param output: output file name (.dot or .png extension)
:param plotMaxUpper: Maximum number of elements to plot, upper than the central element
:param plotMaxLower: Maximum number of elements to plot, lower than the central element

Definition at line 780 of file tree.py.

Here is the call graph for this function:

◆ plotTree()

pyfortool.tree.Tree.plotTree (   self,
  centralNodeList,
  output,
  plotMaxUpper,
  plotMaxLower,
  kind,
  frame = False 
)
Compute a dependency graph
:param centralNodeList: file, scope path, list of files or list of scope paths
:param output: output file name (.dot or .png extension)
:param plotMaxUpper: Maximum number of elements to plot, upper than the central element
:param plotMaxLower: Maximum number of elements to plot, lower than the central element
:param kind: must be 'compilation_tree' or 'execution_tree'
:param frame: True to plot a frame grouping the central nodes

Definition at line 660 of file tree.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ popSignaled()

pyfortool.tree.Tree.popSignaled (   self)
:return: the list of file signaled for update and empties the list

Definition at line 148 of file tree.py.

◆ scopeToFiles()

pyfortool.tree.Tree.scopeToFiles (   self,
  scopePath 
)
Return the name of the file defining the scope
:param scopePath: scope path to search for
:return: list file names in which scope is defined

Definition at line 557 of file tree.py.

Here is the caller graph for this function:

◆ setFullContent()

pyfortool.tree.Tree.setFullContent (   self,
  content 
)
:param content: Fill the current instance with this dict

Definition at line 109 of file tree.py.

Here is the caller graph for this function:

◆ signal()

pyfortool.tree.Tree.signal (   self,
  file 
)
Method used for signaling a modified file which needs to be analized
:param filename: file name or PYFTscope object

Definition at line 141 of file tree.py.

◆ toJson()

pyfortool.tree.Tree.toJson (   self,
  filename 
)
save to json

Definition at line 537 of file tree.py.

Here is the caller graph for this function:

◆ tree()

pyfortool.tree.Tree.tree (   self)
List of directories

Definition at line 168 of file tree.py.

Here is the caller graph for this function:

◆ update()

pyfortool.tree.Tree.update (   self,
  file 
)
Updates the object when a file has changed
:param file: name of the file (or list of names) with updated content
             or PYFTscope object

Definition at line 208 of file tree.py.

Here is the call graph for this function:

Member Data Documentation

◆ _cacheCompilationTree

pyfortool.tree.Tree._cacheCompilationTree
protected

Definition at line 79 of file tree.py.

◆ _cacheExecutionTree

pyfortool.tree.Tree._cacheExecutionTree
protected

Definition at line 80 of file tree.py.

◆ _cacheIncInScope

pyfortool.tree.Tree._cacheIncInScope
protected

Definition at line 81 of file tree.py.

◆ _callList

pyfortool.tree.Tree._callList
protected

Definition at line 77 of file tree.py.

◆ _compilationTree

pyfortool.tree.Tree._compilationTree
protected

Definition at line 602 of file tree.py.

◆ _cwd

pyfortool.tree.Tree._cwd
protected

Definition at line 72 of file tree.py.

◆ _descTreeFile

pyfortool.tree.Tree._descTreeFile
protected

Definition at line 63 of file tree.py.

◆ _executionTree

pyfortool.tree.Tree._executionTree
protected

Definition at line 621 of file tree.py.

◆ _funcList

pyfortool.tree.Tree._funcList
protected

Definition at line 78 of file tree.py.

◆ _includeList

pyfortool.tree.Tree._includeList
protected

Definition at line 76 of file tree.py.

◆ _parserOptions

pyfortool.tree.Tree._parserOptions
protected

Definition at line 64 of file tree.py.

◆ _scopes

pyfortool.tree.Tree._scopes
protected

Definition at line 74 of file tree.py.

◆ _signaled

pyfortool.tree.Tree._signaled
protected

Definition at line 69 of file tree.py.

◆ _tree

pyfortool.tree.Tree._tree
protected

Definition at line 62 of file tree.py.

◆ _useList

pyfortool.tree.Tree._useList
protected

Definition at line 75 of file tree.py.

◆ _verbosity

pyfortool.tree.Tree._verbosity
protected

Definition at line 66 of file tree.py.

◆ _wrapH

pyfortool.tree.Tree._wrapH
protected

Definition at line 65 of file tree.py.


The documentation for this class was generated from the following file: