Skip to content

Commit

Permalink
pylint compliance
Browse files Browse the repository at this point in the history
  • Loading branch information
reuterbal committed Jan 18, 2024
1 parent 59d15f6 commit 009f189
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 25 deletions.
1 change: 0 additions & 1 deletion loki/program_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
40 changes: 16 additions & 24 deletions tests/test_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -1191,15 +1190,19 @@ 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)

type_names = [item.name for item in definitions.values() if isinstance(item, TypeDefItem)]
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)

Expand Down Expand Up @@ -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',),
),
(
#########################
Expand All @@ -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',),
),
(
#########################
Expand All @@ -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',),
),
(
#######################################
Expand Down Expand Up @@ -1378,8 +1375,7 @@ def discover_proj_typebound_item_factory(here, scheduler_config):
'calls': (),
'targets': ()
},
(
),
(),
),
(
###################################
Expand All @@ -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',),
),
(
#############################
Expand All @@ -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(
Expand Down

0 comments on commit 009f189

Please sign in to comment.