-
Notifications
You must be signed in to change notification settings - Fork 49
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
refactor[next] error handling #1275
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main changes in the PR look good to me. I've left many comments, questions and suggestions, but usually minor things.
tests/next_tests/integration_tests/feature_tests/ffront_tests/test_type_deduction.py
Outdated
Show resolved
Hide resolved
tests/next_tests/integration_tests/feature_tests/ffront_tests/test_scalar_if.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Enrique G. Paredes <18477+egparedes@users.noreply.github.com>
Co-authored-by: Enrique G. Paredes <18477+egparedes@users.noreply.github.com>
Co-authored-by: Enrique G. Paredes <18477+egparedes@users.noreply.github.com>
Co-authored-by: Enrique G. Paredes <18477+egparedes@users.noreply.github.com>
Co-authored-by: Till Ehrengruber <t.ehrengruber@me.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the coding and design issues have been addressed. I only have comments about coding style. I'll approve the PR as soon as they get addressed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ILGTM.
…d program (#1323) After #1275 most of the error message given to the user when calling a field operator or program with invalid arguments was only available in verbose mode. This PR shows this information again. ```python @field_operator def foo(x: IField): return x @field_operator def testee(a: IField, b: IField, c: IField) -> IField: return foo(1) ``` ``` gt4py.next.errors.exceptions.DSLError: Invalid argument types in call to `foo`. E Invalid call to function of type `FieldOperatorType(definition=FunctionType(pos_only_args=[], pos_or_kw_args={'x': FieldType(dims=[Dimension(value='IDim', kind=<DimensionKind.HORIZONTAL: 'horizontal'>)], dtype=ScalarType(kind=<ScalarKind.INT32: 32>, shape=None))}, kw_only_args={}, returns=FieldType(dims=[Dimension(value='IDim', kind=<DimensionKind.HORIZONTAL: 'horizontal'>)], dtype=ScalarType(kind=<ScalarKind.INT32: 32>, shape=None))))`: E - Expected argument `x` to be of type `Field[[IDim], int32]`, but got `int32`. E File ".../gt4py_functional/tests/next_tests/integration_tests/feature_tests/ffront_tests/test_arg_call_interface.py", line 113 E return foo(1) ```
Contents:
CompilerError
and subclasses for specific errorsGT*Error
classes,DialetSyntaxError
classesraise
statements in frontend [needs further work]raise
statements intype_system
[needs further work]sys.excepthook
for printing uncaughtCompilerError
s__str__
method for printing uncaught errors in PyCharmUsage:
next.errors
(alias ofnext.errors.exceptions)
or create a new class if makes sensenext.errors
.sys.excepthook
!Results:
Errors are displayed similarly to Python syntax errors: