Skip to content

Commit

Permalink
#2711 Missed is_user_dofkern switch and updated invalid_iteration_spa…
Browse files Browse the repository at this point in the history
…ce test
  • Loading branch information
oakleybrunt committed Sep 19, 2024
1 parent a91f9a4 commit a688572
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/psyclone/domain/lfric/lfric_kern_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ def _validate_operates_on_dof(self, need_evaluator):
f"fields on different function spaces: {sorted(arg_fs_names)}."
f" This is not permitted in the LFRic API.")

self._is_user_dofkern = True
self._is_dofkern = True

def _validate_only_scalars_and_fields(self):
'''
Expand Down
2 changes: 1 addition & 1 deletion src/psyclone/tests/domain/lfric/dofkern_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def test_multiple_write_args():
# Load the metadata into an empty kernel
md = LFRicKernMetadata(ast, name=name)
# Proxy assertion that validating dof kern passes
assert md.is_user_dofkern
assert md.is_dofkern


def test_upper_bound_undf():
Expand Down
12 changes: 3 additions & 9 deletions src/psyclone/tests/dynamo0p3_stubgen_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,22 +65,16 @@ def test_kernel_stub_invalid_iteration_space():
''' Check that we raise an exception if we attempt to generate kernel
stub for a kernel with an unsupported iteration space. '''
ast = fpapi.parse(os.path.join(BASE_PATH,
"testkern_dofs_mod.f90"),
"testkern_domain_mod.F90"),
ignore_comments=False)
metadata = LFRicKernMetadata(ast)
kernel = LFRicKern()
kernel.load_meta(metadata)
with pytest.raises(GenerationError) as excinfo:
_ = kernel.gen_stub
assert ("supports kernels that operate on one of "
"['cell_column'] but found 'dof' in kernel "
"'testkern_dofs_code'." in str(excinfo.value))
kernel._iterates_over = "domain"
with pytest.raises(GenerationError) as excinfo:
_ = kernel.gen_stub
assert ("supports kernels that operate on one of "
"['cell_column'] but found 'domain' in kernel "
"'testkern_dofs_code'." in str(excinfo.value))
"['cell_column', 'dof'] but found 'domain' in kernel "
"'testkern_domain_code'." in str(excinfo.value))


def test_stub_generate_with_anyw2():
Expand Down

0 comments on commit a688572

Please sign in to comment.