Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error message for non-existing backends #992

Closed
gronerl opened this issue Oct 19, 2022 · 1 comment · Fixed by #979
Closed

Error message for non-existing backends #992

gronerl opened this issue Oct 19, 2022 · 1 comment · Fixed by #979
Labels
gt4py.cartesian Issues concerning the current version with support only for cartesian grids.

Comments

@gronerl
Copy link
Contributor

gronerl commented Oct 19, 2022

When compiling a stencil with the backend parameter set to an invalid string value currently raises

Traceback (most recent call last):
  File "/home/gronerl/gt4py/tmp.py", line 5, in <module>
    def test_stencil(out_storage: gtscript.Field[int]):
  File "/home/gronerl/gt4py/src/gt4py/gtscript.py", line 459, in _decorator
    StencilBuilder(
  File "/home/gronerl/gt4py/src/gt4py/stencil_builder.py", line 73, in __init__
    self.backend: "BackendType" = backend(self)
TypeError: 'NoneType' object is not callable

And should be a ValueError caught early on.

@gronerl gronerl added the gt4py.cartesian Issues concerning the current version with support only for cartesian grids. label Oct 19, 2022
@gronerl gronerl added this to the v1.0 / Christmas Cleanup 2022 milestone Oct 19, 2022
@jdahm
Copy link
Contributor

jdahm commented Oct 19, 2022

I believe that #979 indirectly addresses this because it has to be type correct. I'll add a proper exception with a good error message in that case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gt4py.cartesian Issues concerning the current version with support only for cartesian grids.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants