diff --git a/loki/program_unit.py b/loki/program_unit.py index 80e9d2f3b..ca32c879e 100644 --- a/loki/program_unit.py +++ b/loki/program_unit.py @@ -17,7 +17,6 @@ from loki.scope import Scope from loki.tools import CaseInsensitiveDict, as_tuple, flatten from loki.types import BasicType, DerivedType, ProcedureType -from loki.types import BasicType, DerivedType, ProcedureType from loki.visitors import FindNodes, Transformer diff --git a/tests/test_batch.py b/tests/test_batch.py index cb72ee557..98e7fac6f 100644 --- a/tests/test_batch.py +++ b/tests/test_batch.py @@ -5,7 +5,6 @@ # granted to it by virtue of its status as an intergovernmental organisation # nor does it submit to any jurisdiction. - from collections import deque from pathlib import Path import re @@ -236,7 +235,6 @@ def test_file_item2(here): items[0].ir['my_way'], items[0].ir.typedef_map['t1'], items[0].ir.typedef_map['t'], - # items[0].ir['nt1'] ) # Files don't have dependencies (direct dependencies, anyway) @@ -265,7 +263,6 @@ def test_file_item3(here): item.source['my_way'], item.source['t1'], item.source['t'], - # item.source['t_mod']['nt1'] ) # Filter items when calling create_definition_items() @@ -572,7 +569,7 @@ def test_procedure_item_with_config(here, config, expected_dependencies): # TODO: targets can't filter for type bound procedures, yet, hence we add this # always below continue - elif name not in scheduler_config.disable or local_name not in scheduler_config.disable: + if name not in scheduler_config.disable or local_name not in scheduler_config.disable: targets += [local_name] if name == 'header_mod': # TODO: targets can't filter out global variable imports, hence we add this @@ -596,7 +593,9 @@ def test_procedure_item_with_config2(here, disable): item_factory = ItemFactory() item_factory.item_cache[item.name] = item - item_factory.item_cache['t_mod'] = get_item(ModuleItem, proj/'module/t_mod.F90', 't_mod', RegexParserClass.ProgramUnitClass) + item_factory.item_cache['t_mod'] = get_item( + ModuleItem, proj/'module/t_mod.F90', 't_mod', RegexParserClass.ProgramUnitClass + ) item_factory.item_cache['header_mod'] = get_item( ModuleItem, proj/'headers/header_mod.F90', 'header_mod', RegexParserClass.ProgramUnitClass, scheduler_config=scheduler_config @@ -1191,7 +1190,9 @@ def discover_proj_typebound_item_factory(here, scheduler_config): definitions = { item.name: item for module in module_names - for item in item_factory.item_cache[module].create_definition_items(item_factory=item_factory, config=scheduler_config) + for item in item_factory.item_cache[module].create_definition_items( + item_factory=item_factory, config=scheduler_config + ) } item_factory.item_cache.update(definitions) @@ -1199,7 +1200,9 @@ def discover_proj_typebound_item_factory(here, scheduler_config): definitions = { item.name: item for type_ in type_names - for item in item_factory.item_cache[type_].create_definition_items(item_factory=item_factory, config=scheduler_config) + for item in item_factory.item_cache[type_].create_definition_items( + item_factory=item_factory, config=scheduler_config + ) } item_factory.item_cache.update(definitions) @@ -1286,9 +1289,7 @@ def discover_proj_typebound_item_factory(here, scheduler_config): 'calls': ('some_type%some_routine',), 'targets': ('some_type', 'self%some_routine') }, - ( - 'typebound_item#some_type', - ), + ('typebound_item#some_type',), ), ( ######################### @@ -1305,9 +1306,7 @@ def discover_proj_typebound_item_factory(here, scheduler_config): 'calls': ('some_type%some_routine',), 'targets': ('some_type', 'self%some_routine') }, - ( - 'typebound_item#some_type', - ), + ('typebound_item#some_type',), ), ( ######################### @@ -1324,9 +1323,7 @@ def discover_proj_typebound_item_factory(here, scheduler_config): 'calls': ('module_routine',), 'targets': ('some_type',) }, - ( - 'typebound_item#some_type', - ), + ('typebound_item#some_type',), ), ( ####################################### @@ -1378,8 +1375,7 @@ def discover_proj_typebound_item_factory(here, scheduler_config): 'calls': (), 'targets': () }, - ( - ), + (), ), ( ################################### @@ -1393,9 +1389,7 @@ def discover_proj_typebound_item_factory(here, scheduler_config): 'calls': (), 'targets': ('module_routine',), }, - ( - 'typebound_item#module_routine', - ), + ('typebound_item#module_routine',), ), ( ############################# @@ -1410,9 +1404,7 @@ def discover_proj_typebound_item_factory(here, scheduler_config): 'calls': (), 'targets': ('typebound_header', 'header') }, - ( - 'typebound_header', 'typebound_header#header_type', - ), + ('typebound_header', 'typebound_header#header_type',), ), ]) def test_batch_typebound_item(