PyTimeloop
Loading...
Searching...
No Matches
pytimeloop.timeloopfe.common.processor.Processor Class Reference

Base class for all processors, which are used to modify the specification before it is passed to Accelergy/Timeloop. More...

Inheritance diagram for pytimeloop.timeloopfe.common.processor.Processor:
Collaboration diagram for pytimeloop.timeloopfe.common.processor.Processor:

Public Member Functions

 __init__ (self, Optional["Specification"] spec=None)
 
 pre_parse_process (self, "Specification" spec)
 Process the specification before parsing.
 
 process (self, "Specification" spec)
 Process the specification.
 
 declare_attrs (self)
 Initialize the attributes that the processor is responsible for.
 
 get_index (self, type processor_type, "Specification" spec)
 Get the index of the processor in the list of processors.
 
 must_run_after (self, type other, "Specification" spec, bool ok_if_not_found=False)
 Ensure that this processor runs after another processor.
 
 add_attr (self, Node target, *args, **kwargs)
 

Public Attributes

 logger = logging.getLogger(self.__class__.__name__)
 
 spec = spec
 

Protected Attributes

bool _initialized = True
 

Detailed Description

Base class for all processors, which are used to modify the specification before it is passed to Accelergy/Timeloop.

Attributes: spec: The specification to process. logger: The logger for this processor.

Constructor & Destructor Documentation

◆ __init__()

Member Function Documentation

◆ add_attr()

pytimeloop.timeloopfe.common.processor.Processor.add_attr ( self,
Node target,
* args,
** kwargs )

◆ declare_attrs()

pytimeloop.timeloopfe.common.processor.Processor.declare_attrs ( self)

Initialize the attributes that the processor is responsible for.

!

Note
This method is called before process() is called. See the SimpleProcessor for an example.

Reimplemented in pytimeloop.timeloopfe.common.processor.SimpleProcessor, pytimeloop.timeloopfe.v4.processors.constraint_attacher.ConstraintAttacherProcessor, and pytimeloop.timeloopfe.v4.processors.constraint_macro.ConstraintMacroProcessor.

◆ get_index()

pytimeloop.timeloopfe.common.processor.Processor.get_index ( self,
type processor_type,
"Specification" spec )

Get the index of the processor in the list of processors.

◆ must_run_after()

pytimeloop.timeloopfe.common.processor.Processor.must_run_after ( self,
type other,
"Specification" spec,
bool ok_if_not_found = False )

Ensure that this processor runs after another processor.

!

Parameters
otherThe processor that this processor must run after.

!

Parameters
ok_if_not_foundIf False, OK if the other processor is not found. If True, raise an exception if the other processor is not found.

◆ pre_parse_process()

pytimeloop.timeloopfe.common.processor.Processor.pre_parse_process ( self,
"Specification" spec )

Process the specification before parsing.

◆ process()

Member Data Documentation

◆ _initialized

bool pytimeloop.timeloopfe.common.processor.Processor._initialized = True
protected

◆ logger

pytimeloop.timeloopfe.common.processor.Processor.logger = logging.getLogger(self.__class__.__name__)

◆ spec

pytimeloop.timeloopfe.common.processor.Processor.spec = spec

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