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

IntelPython / dpnp / 36609985014
79%

Build:
DEFAULT BRANCH: master
Ran 29 Sep 2026 07:40PM UTC
Jobs 1
Files 263
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

29 Sep 2026 06:08PM UTC coverage: 78.609%. Remained the same
36609985014

push

github

web-flow
Sort NaNs to the end for descending order (#3066)

`dpnp.sort`, `dpnp.argsort`, and their `dpnp.ndarray`/`dpnp.tensor`
counterparts placed `NaN` values at the *beginning* when sorting in
descending order, while NumPy 2.5 keeps `NaN` values at the *end* for
both ascending and descending order.

For descending order the sort kernels simply reversed the ascending
comparison, which also moved `NaN` (treated as the largest value) to the
front.

The PR proposes to change:
- Merge-sort comparators: only the comparison between non-`NaN` values
is reversed for descending order, so `NaN`s stay at the end. For complex
values the `NaN`-ness groups `(no nan) -> (imag nan) -> (real nan) ->
(all nan)` keep the same trailing order as ascending, and only the
finite-component lexicographic comparison is reversed.
- Radix-sort float casts (half / float32 / float64): map `NaN` to the
maximum key, so it lands in the last bucket regardless of direction.
This keeps the descending float radix fast path intact rather than
falling back to a slower comparator.
- `dpnp.tensor.top_k` inherits the change through the shared descending
comparator: `NaN` values (and complex values with a `NaN` component) are
now treated as the smallest, so `mode="largest"` no longer returns them
ahead of finite values.

`NaN` ordering under `sort`/`argsort` is left implementation-defined by
the Python Array API standard, and `top_k` explicitly permits sorting
`NaN` values to either end. The new "`NaN` last" behavior is therefore
spec-conforming and is chosen to match NumPy 2.5; it is now consistent
across the `dpnp` and `dpnp.tensor` namespaces.

1566 of 2924 branches covered (53.56%)

Branch coverage included in aggregate %.

26840 of 33212 relevant lines covered (80.81%)

8589.48 hits per line

Jobs
ID Job ID Ran Files Coverage
1 36609985014.1 29 Sep 2026 07:40PM UTC 263
78.61
GitHub Action Run
Source Files on build 36609985014
  • Tree
  • List 263
  • Changed 3
  • Source Changed 3
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #36609985014
  • 32252b89 on github
  • Prev Build on master (#36563218007)
  • Next Build on master (#36713873812)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc