Skip to content

Commit

Permalink
Python 3.8 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
reuterbal committed May 23, 2023
1 parent 8ddbdbf commit 64b6a04
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
22 changes: 22 additions & 0 deletions loki/bulk/item.py
Original file line number Diff line number Diff line change
Expand Up @@ -1028,6 +1028,28 @@ def ir(self):
return decl
raise RuntimeError(f'Declaration for {local_name} cannot be found in {self.scope_name}')

# Below properties are only here to appease the Linter and become
# redundant once the Item base class has been cleaned up
@property
def calls(self):
pass

@property
def function_interfaces(self):
pass

@property
def imports(self):
pass

@property
def members(self):
pass

@property
def routine(self):
pass


class SubroutineItem(Item):
"""
Expand Down
4 changes: 2 additions & 2 deletions tests/test_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,13 +429,13 @@ def test_procedure_item_with_config(here, config, expected_dependencies):

# We need to have suitable dependency modules in the cache to spawn the dependency items
item_cache = {item.name: item}
item_cache |= {
item_cache.update({
(i := get_item(ModuleItem, proj/path, name, RegexParserClass.ProgramUnitClass)).name: i
for path, name in [
('module/t_mod.F90', 't_mod'), ('module/a_mod.F90', 'a_mod'),
('module/b_mod.F90', 'b_mod'), ('headers/header_mod.F90', 'header_mod')
]
}
})
scheduler_config = SchedulerConfig.from_dict(config)
assert item.create_dependency_items(item_cache=item_cache, config=scheduler_config) == expected_dependencies

Expand Down

0 comments on commit 64b6a04

Please sign in to comment.