loki.transformations.sanitise package
Subpackages
Submodules
Module contents
Sub-package with assorted utility Transformation classes to
harmonize the look-and-feel of input source code.
- class SanitiseTransformation(resolve_associate_mappings=True, resolve_sequence_association=False)
Bases:
TransformationTransformationobject to apply several code sanitisation steps when batch-processing large source trees via theScheduler.- Parameters:
resolve_associate_mappings (bool) – Resolve ASSOCIATE mappings in body of processed subroutines; default: True.
resolve_sequence_association (bool) – Replace scalars that are passed to array arguments with array ranges; default: False.
- transform_subroutine(routine, **kwargs)
Defines the transformation to apply to
Subroutineitems.For transformations that modify
Subroutineobjects, this method should be implemented. It gets called via the dispatch methodapply().- Parameters:
routine (
Subroutine) – The subroutine to be transformed.**kwargs (optional) – Keyword arguments for the transformation.