• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

IntelPython / dpnp / 12873608213
81%

Build:
DEFAULT BRANCH: master
Ran 20 Jan 2025 06:34PM UTC
Jobs 1
Files 201
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

20 Jan 2025 06:07PM UTC coverage: 70.845% (+0.001%) from 70.844%
12873608213

push

github

web-flow
Follow recommendation on the interaction with `numpy.ndarray` in binary ops (#2266)

The PR proposes to follow NEP-13
[recommendations](https://numpy.org/neps/nep-0013-ufunc-overrides.html#behavior-in-combination-with-python-s-binary-operations)
on how to interact with `numpy.ndarray` in binary the operations.

It will set `__array_ufunc__ = None` which means that dpnp implements
Python binary operations freely and so `numpy.ufuncs` called on this
argument will raise `TypeError`:
```python
a = numpy.ones(10)
b = dpnp.ones(10)
a += b
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[9], line 1
----> 1 a += b

TypeError: operand 'dpnp_array' does not support ufuncs (__array_ufunc__=None)
```
And an elementwise operation with `numpy.ndarray` will cause an explicit
exception in dpnp:
```python
a + b
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[4], line 1
----> 1 a + b

File ~/code/dpnp/dpnp/dpnp_array.py:518, in dpnp_array.__radd__(self, other)
    516 def __radd__(self, other):
    517     """Return ``value+self``."""
--> 518     return dpnp.add(other, self)

File ~/code/dpnp/dpnp/dpnp_algo/dpnp_elementwise_common.py:314, in DPNPBinaryFunc.__call__(self, x1, x2, out, where, order, dtype, subok, **kwargs)
    303 def __call__(
    304     self,
    305     x1,
   (...)
    312     **kwargs,
    313 ):
--> 314     dpnp.check_supported_arrays_type(
    315         x1, x2, scalar_type=True, all_scalars=False
    316     )
    317     if kwargs:
    318         raise NotImplementedError(
    319             f"Requested function={self.name_} with kwargs={kwargs} "
    320             "isn't currently supported."
    321         )

File ~/code/dpnp/dpnp/dpnp_iface.py:400, in check_supported_arrays_type(scalar_type, all_scalars, *arrays)
   ... (continued)

4604 of 9556 branches covered (48.18%)

Branch coverage included in aggregate %.

1 of 1 new or added line in 1 file covered. (100.0%)

16760 of 20600 relevant lines covered (81.36%)

20931.18 hits per line

Jobs
ID Job ID Ran Files Coverage
1 12873608213.1 20 Jan 2025 06:43PM UTC 201
70.84
GitHub Action Run
Source Files on build 12873608213
  • Tree
  • List 201
  • Changed 23
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • 13816bdc on github
  • Prev Build on master (#12872653853)
  • Next Build on master (#12888946661)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc