# loki.transformations.sanitise package

## Subpackages

- loki.transformations.sanitise.tests package
  - Submodules
    - loki.transformations.sanitise.tests.test_associates module
    - loki.transformations.sanitise.tests.test_sanitise module
    - loki.transformations.sanitise.tests.test_sequence_associations module
  - Module contents

## Submodules

- loki.transformations.sanitise.associates module
  - `AssociatesTransformation`
    - `AssociatesTransformation.transform_subroutine()`
  - `do_resolve_associates()`
  - `ResolveAssociatesTransformer`
    - `ResolveAssociatesTransformer.visit_Expression()`
    - `ResolveAssociatesTransformer.visit_Associate()`
    - `ResolveAssociatesTransformer.visit_CallStatement()`
  - `do_merge_associates()`
- loki.transformations.sanitise.sequence_associations module
  - `SequenceAssociationTransformation`
    - `SequenceAssociationTransformation.transform_subroutine()`
  - `do_resolve_sequence_association()`
  - `SequenceAssociationTransformer`
    - `SequenceAssociationTransformer.visit_CallStatement()`
- loki.transformations.sanitise.substitute module
  - `SubstituteExpressionTransformation`
    - `SubstituteExpressionTransformation.transform_subroutine()`

## 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: `Transformation`

  `Transformation` object to apply several code sanitisation steps when batch-processing large source trees via the `Scheduler`.

  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 `Subroutine` items.

    For transformations that modify `Subroutine` objects, this method should be implemented. It gets called via the dispatch method `apply()`.

    Parameters:

      - routine (`Subroutine`) – The subroutine to be transformed.

      - **kwargs (optional) – Keyword arguments for the transformation.