Open BenWeber42 opened 2 years ago
We are aware of the issue and will gradually improve it (work to support keyword arguments in calls to programs has already started: https://github.com/GridTools/gt4py/pull/982).
There's still:
The second failure seems to trigger an unrelated bug earlier, but would most likely also not be handled well.
I guess I should open a separate issue for that, but I don't have time to look into it currently and see if the test case could be reduced. I can try to do this later.
We are aware of the issue and will gradually improve it (work to support keyword arguments in calls to programs has already started: https://github.com/GridTools/gt4py/pull/982).
Yes, but ast.arguments
has up to 7 attributes, and we are currently ignoring all but one. It's not clear to me whether that PR will make sure that all cases are handled properly (if something isn't supported yet, the user should get an appropriate error message). Leaving all the other cases completely unhandled is against the principle of defensive coding. You are only risking forgetting about it (we don't have an official backlog anyway) and then leave it up to the user to discover it, which will lead to a poor user experience. If we don't support something (because we plan to add support later, deliberately chose not to support it or any other reason), all cases should be handled properly, and the user should get an appropriate error message for all those cases.
See these tests: https://github.com/BenWeber42/gt4py/commit/b5d2c87be469efdb78ed8eb59358fa239a7e67a3
They fail with:
The first failure is because
ast.argument
isn't handled exhaustively here: https://github.com/GridTools/gt4py/blob/c0388b6757a363d51361132b5206e6fac6a5f609/src/functional/ffront/func_to_foast.py#L174-L175The error message may be correct, because we only support normal arguments in field operators. It's still missleading to the user, because there is no message that positional only arguments aren't supported (this is silently ignored by the foast parser).
The second failure seems to trigger an unrelated bug earlier, but would most likely also not be handled well.