diff --git a/loki/bulk/scheduler.py b/loki/bulk/scheduler.py index 1cc726caa..6821d2b55 100644 --- a/loki/bulk/scheduler.py +++ b/loki/bulk/scheduler.py @@ -657,10 +657,7 @@ def process(self, transformation): continue _item = items[0] - transformation.apply( - items[0].source, role=_item.role, mode=_item.mode, - item=_item, items=items, targets=_item.targets, - ) + transformation.apply(items[0].source, items=items) else: for item in traversal: if item_filter and not isinstance(item, item_filter): diff --git a/loki/transform/transformation.py b/loki/transform/transformation.py index c6ac564ea..2723a2a84 100644 --- a/loki/transform/transformation.py +++ b/loki/transform/transformation.py @@ -191,15 +191,14 @@ def apply_file(self, sourcefile, **kwargs): role = kwargs.pop('role', None) targets = kwargs.pop('targets', None) - if 'items' in kwargs: + if items: # TODO: This special logic is required for the # DependencyTransformation to capture certain corner # cases. Once the module wrapping is split into its # own transformation, we can probably simplify this. # We consider the sourcefile to be a "kernel" file if all items are kernels - if all(item.role == 'kernel' for item in items): - role = 'kernel' + role = 'kernel' if all(item.role == 'kernel' for item in items) else 'driver' if targets is None: # We collect the targets for file/module-level imports from all items