-
Notifications
You must be signed in to change notification settings - Fork 23
Unify dpnp public API exports by refactoring __init__.py
#2666
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
base: refactor_public_api_exports
Are you sure you want to change the base?
Changes from all commits
7cbc63a
b8a4b73
57fb9f3
723e2c1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -66,9 +66,6 @@ | |||||
| from .dpnp_array import dpnp_array as ndarray | ||||||
| from .dpnp_array_api_info import __array_namespace_info__ | ||||||
| from .dpnp_flatiter import flatiter as flatiter | ||||||
| from .dpnp_iface_types import * | ||||||
| from .dpnp_iface_utils import * | ||||||
| from .dpnp_iface_utils import __all__ as _ifaceutils__all__ | ||||||
| from ._version import get_versions | ||||||
| from . import exceptions as exceptions | ||||||
| from . import fft as fft | ||||||
|
|
@@ -77,6 +74,81 @@ | |||||
| from . import scipy as scipy | ||||||
|
|
||||||
|
|
||||||
| # ============================================================================= | ||||||
| # Data types, constants and type-related helpers | ||||||
| # ============================================================================= | ||||||
|
|
||||||
| # ----------------------------------------------------------------------------- | ||||||
| # Data types (borrowed from NumPy) | ||||||
| # | ||||||
| # The order of these declarations are borrowed from the NumPy document: | ||||||
| # https://numpy.org/doc/stable/reference/arrays.scalars.html | ||||||
|
Comment on lines
+84
to
+85
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It does not really make any sense, because there is a single
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The order is defined by the python sort linter and not by the pointing numpy's page. |
||||||
| # ----------------------------------------------------------------------------- | ||||||
| from .dpnp_iface_types import ( | ||||||
| bool, | ||||||
| bool_, | ||||||
| byte, | ||||||
| cdouble, | ||||||
| complex128, | ||||||
| complex64, | ||||||
| complexfloating, | ||||||
| csingle, | ||||||
| double, | ||||||
| dtype, | ||||||
| float16, | ||||||
| float32, | ||||||
| float64, | ||||||
| floating, | ||||||
| inexact, | ||||||
| int_, | ||||||
| int8, | ||||||
| int16, | ||||||
| int32, | ||||||
| int64, | ||||||
| integer, | ||||||
| intc, | ||||||
| intp, | ||||||
| longlong, | ||||||
| number, | ||||||
| short, | ||||||
| signedinteger, | ||||||
| single, | ||||||
| ubyte, | ||||||
| uint8, | ||||||
| uint16, | ||||||
| uint32, | ||||||
| uint64, | ||||||
| uintc, | ||||||
| uintp, | ||||||
| unsignedinteger, | ||||||
| ushort, | ||||||
| ulonglong, | ||||||
| ) | ||||||
|
|
||||||
| # ----------------------------------------------------------------------------- | ||||||
| # Constants (borrowed from NumPy) | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| # ----------------------------------------------------------------------------- | ||||||
| from .dpnp_iface_types import ( | ||||||
| e, | ||||||
| euler_gamma, | ||||||
| inf, | ||||||
| nan, | ||||||
| newaxis, | ||||||
| pi, | ||||||
| ) | ||||||
|
Comment on lines
+131
to
+138
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It has to be a part of the below |
||||||
|
|
||||||
| # ----------------------------------------------------------------------------- | ||||||
| # Type-related helper functions | ||||||
| # ----------------------------------------------------------------------------- | ||||||
| from .dpnp_iface_types import ( | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That is a part of |
||||||
| common_type, | ||||||
| finfo, | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need to move |
||||||
| iinfo, | ||||||
| isdtype, | ||||||
| issubdtype, | ||||||
| is_type_supported, | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That needs to be moved away. It's a kind of deprecated API which we should not expose. |
||||||
| ) | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And |
||||||
|
|
||||||
| # ============================================================================= | ||||||
| # Routines | ||||||
| # | ||||||
|
|
@@ -424,6 +496,11 @@ | |||||
| unwrap, | ||||||
| ) | ||||||
|
|
||||||
| # ----------------------------------------------------------------------------- | ||||||
| # Miscellaneous routines | ||||||
| # ----------------------------------------------------------------------------- | ||||||
| from .dpnp_iface_utils import byte_bounds | ||||||
|
|
||||||
| # ----------------------------------------------------------------------------- | ||||||
| # Sorting, searching, and counting | ||||||
| # ----------------------------------------------------------------------------- | ||||||
|
|
@@ -514,10 +591,8 @@ | |||||
| ) | ||||||
|
|
||||||
|
|
||||||
| __all__ = _ifaceutils__all__ | ||||||
|
|
||||||
| # add submodules | ||||||
| __all__ += ["exceptions", "fft", "linalg", "random", "scipy"] | ||||||
| __all__ = ["exceptions", "fft", "linalg", "random", "scipy"] | ||||||
|
|
||||||
|
|
||||||
| __version__ = get_versions()["version"] | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,8 +37,6 @@ | |
|
|
||
| import dpnp | ||
|
|
||
| __all__ = ["byte_bounds"] | ||
|
|
||
|
|
||
| def byte_bounds(a): | ||
| """ | ||
|
|
||
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.
Can we remove
"--disable=c-extension-no-member"from.pre-commit-config.yamlnow?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.
And E501 skipping in
.flake8