Skip to content

Commit

Permalink
Linter compliance
Browse files Browse the repository at this point in the history
  • Loading branch information
reuterbal committed Dec 20, 2024
1 parent a4cf4bb commit fab1ce0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
11 changes: 7 additions & 4 deletions loki/batch/item_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}')
Expand All @@ -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}')
Expand Down
8 changes: 6 additions & 2 deletions loki/transformations/tests/test_dependency.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):

Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit fab1ce0

Please sign in to comment.