Skip to content

Fix for gh 1785 - #1792

Merged
oleksandr-pavlyk merged 3 commits into
masterfrom
fix-for-gh-1785
Aug 9, 2024
Merged

oleksandr-pavlyk merged 3 commits into
masterfrom
fix-for-gh-1785

Conversation

@oleksandr-pavlyk

Copy link
Copy Markdown
Contributor

Resolves gh-1785

Treat float and complex types as non-booleans. They used to be treated so because bool(key) works for these types.

Changed exception raised for unrecognized key from TypeError to IndexError,

  • 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?
  • Have you checked performance impact of proposed changes?
  • If this PR is a work in progress, are you opening the PR as a draft?

Previously these were treated as booleans (any object can be treated
as a boolean, since `bool(obj)` is always defined).

Replaced raise TypeError with raise IndexError for indices
of recognized type.
@github-actions

github-actions Bot commented Aug 7, 2024 •

Copy link
Copy Markdown

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

@github-actions

github-actions Bot commented Aug 7, 2024

Copy link
Copy Markdown

Array API standard conformance tests for dpctl=0.18.0dev0=py310ha798474_259 ran successfully.
Passed: 894
Failed: 1
Skipped: 119

@github-actions

github-actions Bot commented Aug 7, 2024

Copy link
Copy Markdown

Array API standard conformance tests for dpctl=0.18.0dev0=py310ha798474_262 ran successfully.
Passed: 894
Failed: 1
Skipped: 119

@coveralls

Copy link
Copy Markdown
Collaborator

Coverage Status

coverage: 87.93%. remained the same
when pulling 7f9ab84 on fix-for-gh-1785
into e3592bd on master.

@ndgrigorian ndgrigorian left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good to me!

@oleksandr-pavlyk

Copy link
Copy Markdown
Contributor Author

@vtavana Ping

@vtavana vtavana left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you, @oleksandr-pavlyk!
Works fine in dpnp as well.

@oleksandr-pavlyk
oleksandr-pavlyk merged commit a077f42 into master Aug 9, 2024
@oleksandr-pavlyk
oleksandr-pavlyk deleted the fix-for-gh-1785 branch August 9, 2024 12:41
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.

Raise an IndexError when array index is not integer

4 participants