From fab1ce0f0d0bd64f7a2fdf034a9eb9a6a37d791e Mon Sep 17 00:00:00 2001 From: Balthasar Reuter Date: Fri, 20 Dec 2024 14:28:56 +0100 Subject: [PATCH] Linter compliance --- loki/batch/item_factory.py | 11 +++++++---- loki/transformations/tests/test_dependency.py | 8 ++++++-- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/loki/batch/item_factory.py b/loki/batch/item_factory.py index 1d11636ef..b4d411155 100644 --- a/loki/batch/item_factory.py +++ b/loki/batch/item_factory.py @@ -275,10 +275,10 @@ def get_or_create_item_from_item(self, name, item, config=None): if scope_name: scope = new_source[item.scope_name] scope.name = scope_name - ir = scope[item.local_name] + item_ir = scope[item.local_name] else: - ir = new_source[item.local_name] - ir.name = local_name + item_ir = new_source[item.local_name] + item_ir.name = local_name # Create a new FileItem for the new source new_source.path = item.path.with_name(f'{scope_name or local_name}{item.path.suffix}') @@ -297,7 +297,10 @@ def get_or_create_item_from_item(self, name, item, config=None): if scope_name and scope_name in self.item_cache: scope = self.item_cache[scope_name].ir if local_name not in scope: - raise RuntimeError(f'Cloning item {item.name} as {name} failed, {local_name} not found in existing scope {scope_name}') + raise RuntimeError(( + f'Cloning item {item.name} as {name} failed, ' + f'{local_name} not found in existing scope {scope_name}' + )) return self.create_from_ir(scope[local_name], scope, config=config) raise RuntimeError(f'Failed to clone item {item.name} as {name}') diff --git a/loki/transformations/tests/test_dependency.py b/loki/transformations/tests/test_dependency.py index 4de174f9c..84b2d3ca3 100644 --- a/loki/transformations/tests/test_dependency.py +++ b/loki/transformations/tests/test_dependency.py @@ -258,7 +258,9 @@ def test_dependency_remove(tmp_path, frontend, config): @pytest.mark.usefixtures('fcode_no_module') @pytest.mark.parametrize('frontend', available_frontends()) -@pytest.mark.parametrize('suffix, module_suffix', (('_duplicated', None), ('_dupl1', '_dupl2'), ('_d_test_1', '_d_test_2'))) +@pytest.mark.parametrize('suffix, module_suffix', ( + ('_duplicated', None), ('_dupl1', '_dupl2'), ('_d_test_1', '_d_test_2') +)) @pytest.mark.parametrize('full_parse', (True, False)) def test_dependency_duplicate_plan_no_module(tmp_path, frontend, suffix, module_suffix, config, full_parse): @@ -298,7 +300,9 @@ def test_dependency_duplicate_plan_no_module(tmp_path, frontend, suffix, module_ @pytest.mark.usefixtures('fcode_no_module') @pytest.mark.parametrize('frontend', available_frontends()) -@pytest.mark.parametrize('suffix, module_suffix', (('_duplicated', None), ('_dupl1', '_dupl2'), ('_d_test_1', '_d_test_2'))) +@pytest.mark.parametrize('suffix, module_suffix', ( + ('_duplicated', None), ('_dupl1', '_dupl2'), ('_d_test_1', '_d_test_2') +)) def test_dependency_duplicate_trafo_no_module(tmp_path, frontend, suffix, module_suffix, config): scheduler = Scheduler(