pytensor icon indicating copy to clipboard operation
pytensor copied to clipboard

feat: support numba compiled `sort` and `argsort` functions

Open victorgarcia98 opened this issue 9 months ago • 3 comments

Description

This PR introduces Numba compiled function sort and argsort for certain kind of sorting algorithms that are supported by Numba (See this).

Related Issue

  • [X] Closes https://github.com/pymc-devs/pytensor/issues/1151

Checklist

Type of change

  • [X] New feature / enhancement
  • [ ] Bug fix
  • [ ] Documentation
  • [ ] Maintenance
  • [ ] Other (please specify):

📚 Documentation preview 📚: https://pytensor--1309.org.readthedocs.build/en/1309/

victorgarcia98 avatar Mar 20 '25 22:03 victorgarcia98

It looks like there's some syntax that isn't python 3.10 compatible. We're following the numpy depreciation schedule, so we should still support python 3.10 for one more week

jessegrabowski avatar Mar 30 '25 09:03 jessegrabowski

It looks like there's some syntax that isn't python 3.10 compatible. We're following the numpy depreciation schedule, so we should still support python 3.10 for one more week

Aw indeed! I changed the syntax to be compatible with Python 3.10 :smile:

victorgarcia98 avatar Mar 30 '25 09:03 victorgarcia98

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 82.02%. Comparing base (a149f6c) to head (8726955). Report is 178 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1309      +/-   ##
==========================================
+ Coverage   82.00%   82.02%   +0.01%     
==========================================
  Files         188      203      +15     
  Lines       48478    48837     +359     
  Branches     8665     8691      +26     
==========================================
+ Hits        39755    40058     +303     
- Misses       6575     6627      +52     
- Partials     2148     2152       +4     
Files with missing lines Coverage Δ
pytensor/link/numba/dispatch/basic.py 80.38% <100.00%> (+2.53%) :arrow_up:

... and 26 files with indirect coverage changes

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar Mar 30 '25 10:03 codecov[bot]

Thanks for this!

jessegrabowski avatar Apr 04 '25 17:04 jessegrabowski