Skip to content

Import of deprecated dpnp.dparray class caused exception #1210

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

Merged
merged 4 commits into from
Oct 24, 2022

Conversation

antonwolfy
Copy link
Contributor

A dpnp.dparray class is actually obsolete and needs to be declared as deprecated. There is dpnp.dpnp_array class which has to be used instead. So the PR implements a deprecation warning for dpnp.dparray class.
Another issue which is fixed by the PR is an exception raised during import of dpnp.dparray, like in below example:

> python -c "import dpnp; import dpnp.dparray"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "dpnp/dparray.pyx", line 40, in init dpnp.dparray
    from dpnp.dpnp_iface import *
TypeError: Cannot overwrite C type array
  • Have you provided a meaningful PR description?
  • Have you added a test, reproducer or referred to 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?
  • If this PR is a work in progress, are you filing the PR as a draft?

@antonwolfy antonwolfy self-assigned this Oct 21, 2022

from libcpp cimport bool as cpp_bool

from dpnp.dpnp_iface_types import *
from dpnp.dpnp_iface import *
Copy link
Contributor

@oleksandr-pavlyk oleksandr-pavlyk Oct 21, 2022

Choose a reason for hiding this comment

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

Is importing of this module fixed by changes on lines 52-55 without removal of from dpnp.dpnp_iface import *?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, it didn't help, the same exception raised.

@antonwolfy antonwolfy merged commit a731718 into IntelPython:master Oct 24, 2022
@antonwolfy antonwolfy deleted the dparray_import_issue branch October 24, 2022 12:55
antonwolfy added a commit that referenced this pull request Nov 2, 2022
Out of cycle release to distribute the fix of #1210 to intel channel on Anaconda.
Temporary pin `dpcpp-cpp-rt` on `2022.2.0` version to be able to build DPNP in internal CI.
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.

2 participants