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

Fixed gh-998: exception raised while forming an expected TypeError exception message #999

Merged
merged 3 commits into from
Nov 28, 2022

Conversation

oleksandr-pavlyk
Copy link
Collaborator

This change fixes formation of TypeError message string.

Closes #998.

It also reworks dtype argument validation, fixing unreferenced issue with dpt.usm_ndarray(1, dtype=np.dtype(">f4")).

  • Have you provided a meaningful PR description?
  • Have you added a test, reproducer or referred to an issue with a reproducer?
  • Have you tested your changes locally for CPU and GPU devices?
  • Have you made sure that new changes do not introduce compiler warnings?

@github-actions
Copy link

@coveralls
Copy link
Collaborator

coveralls commented Nov 25, 2022

Coverage Status

Coverage increased (+0.01%) to 82.012% when pulling 5e98b8d on fix-exception-forming-gh-998 into 457450a on master.

This change fixes formation of TypeError message string.

Also improved dtype argument validation.
@github-actions
Copy link

Array API standard conformance tests for dpctl=0.14.0=py310h8c27c75_13 ran successfully.
Passed: 33
Failed: 801
Skipped: 3138

antonwolfy
antonwolfy previously approved these changes Nov 28, 2022
return descr_to_typenum(dt)
else:
return -1
except TypeError:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe except * in the definition of dtype_to_typenum isn't needed anymore also, since no exception is raised by the function.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct. This is an optimization change though. It does not hurt to keep it.

I will push the suggested change and merge.

@github-actions
Copy link

Array API standard conformance tests for dpctl=0.14.0=py310h8c27c75_14 ran successfully.
Passed: 33
Failed: 801
Skipped: 3138

@oleksandr-pavlyk oleksandr-pavlyk merged commit 1b1eb15 into master Nov 28, 2022
@oleksandr-pavlyk oleksandr-pavlyk deleted the fix-exception-forming-gh-998 branch November 28, 2022 16:57
@github-actions
Copy link

Deleted rendered PR docs from intelpython.github.com/dpctl, latest should be updated shortly. 🤞

@github-actions
Copy link

Array API standard conformance tests for dpctl=0.14.0=py310h8c27c75_14 ran successfully.
Passed: 33
Failed: 801
Skipped: 3138

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failed to build TypeError exception
3 participants