Reference Guide  2.5.0
psyclone.psyir.symbols.interfaces.ImportInterface Class Reference
Inheritance diagram for psyclone.psyir.symbols.interfaces.ImportInterface:
Collaboration diagram for psyclone.psyir.symbols.interfaces.ImportInterface:

Public Member Functions

def __init__ (self, container_symbol, orig_name=None)
 
def orig_name (self)
 
def container_symbol (self)
 
def container_symbol (self, value)
 
def __str__ (self)
 
def __eq__ (self, other)
 
def copy (self)
 

Public Attributes

 container_symbol
 

Detailed Description

Describes the interface to a Symbol that is imported from an
external PSyIR container. The symbol can be renamed on import and,
if so, its original name in the Container is specified using the
optional 'orig_name' argument.

:param container_symbol: symbol representing the external container \
    from which the symbol is imported.
:type container_symbol: \
    :py:class:`psyclone.psyir.symbols.ContainerSymbol`
:param Optional[str] orig_name: the name of the symbol in the \
    external container before it is renamed, or None (the default) if \
    it is not renamed.

:raises TypeError: if the orig_name argument is an unexpected type.

Definition at line 106 of file interfaces.py.

Member Function Documentation

◆ container_symbol() [1/2]

def psyclone.psyir.symbols.interfaces.ImportInterface.container_symbol (   self)
:return: symbol representing the container containing this Symbol.
:rtype: :py:class:`psyclone.psyir.symbols.ContainerSymbol`

Definition at line 144 of file interfaces.py.

144  def container_symbol(self):
145  '''
146  :return: symbol representing the container containing this Symbol.
147  :rtype: :py:class:`psyclone.psyir.symbols.ContainerSymbol`
148  '''
149  return self._container_symbol
150 

References psyclone.psyir.symbols.interfaces.ImportInterface._container_symbol.

Here is the caller graph for this function:

◆ container_symbol() [2/2]

def psyclone.psyir.symbols.interfaces.ImportInterface.container_symbol (   self,
  value 
)
:param value: the ContainerSymbol that imports the symbol with
    this interface.
:type value: :py:class:`psyclone.psyir.symbols.ContainerSymbol`

:raises TypeError: if the provided value is not a ContainerSymbol.

Definition at line 152 of file interfaces.py.

152  def container_symbol(self, value):
153  '''
154  :param value: the ContainerSymbol that imports the symbol with
155  this interface.
156  :type value: :py:class:`psyclone.psyir.symbols.ContainerSymbol`
157 
158  :raises TypeError: if the provided value is not a ContainerSymbol.
159 
160  '''
161  # Avoid circular import
162  # pylint: disable=import-outside-toplevel
163  from psyclone.psyir.symbols import ContainerSymbol
164 
165  if not isinstance(value, ContainerSymbol):
166  raise TypeError(
167  f"ImportInterface container_symbol parameter must be of type"
168  f" ContainerSymbol, but found "
169  f"'{type(value).__name__}'.")
170 
171  self._container_symbol = value
172 

References psyclone.psyir.symbols.interfaces.ImportInterface._container_symbol, psyclone.psyir.symbols.interfaces.ImportInterface.container_symbol, psyclone.domain.lfric.function_space.FunctionSpace.orig_name(), psyclone.dynamo0p3.DynamoPSy.orig_name(), and psyclone.psyir.symbols.interfaces.ImportInterface.orig_name().

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

◆ copy()

def psyclone.psyir.symbols.interfaces.ImportInterface.copy (   self)
:returns: a copy of this object.
:rtype: :py:class:`psyclone.psyir.symbol.SymbolInterface`

Reimplemented from psyclone.psyir.symbols.interfaces.SymbolInterface.

Definition at line 190 of file interfaces.py.

190  def copy(self):
191  '''
192  :returns: a copy of this object.
193  :rtype: :py:class:`psyclone.psyir.symbol.SymbolInterface`
194  '''
195  return self.__class__(self.container_symbol, orig_name=self.orig_name)
196 
197 

References psyclone.psyir.symbols.symbol.Symbol.__class__, psyclone.psyir.symbols.interfaces.ImportInterface.container_symbol, psyclone.domain.lfric.function_space.FunctionSpace.orig_name(), psyclone.dynamo0p3.DynamoPSy.orig_name(), and psyclone.psyir.symbols.interfaces.ImportInterface.orig_name().

Here is the call graph for this function:

◆ orig_name()

def psyclone.psyir.symbols.interfaces.ImportInterface.orig_name (   self)
:returns: the symbol's original name if it is renamed on \
    import, or None otherwise.
:rtype: Optional[str]

Definition at line 134 of file interfaces.py.

134  def orig_name(self):
135  '''
136  :returns: the symbol's original name if it is renamed on \
137  import, or None otherwise.
138  :rtype: Optional[str]
139 
140  '''
141  return self._orig_name
142 

References psyclone.domain.lfric.function_space.FunctionSpace._orig_name, psyclone.psyGen.Argument._orig_name, and psyclone.psyir.symbols.interfaces.ImportInterface._orig_name.

Here is the caller graph for this function:

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