Skip to content
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

BUILD, MAINT: Migrate to Cython 3 and use the Iterator API instead of PyArray_MultiIter_* functions for iteration. #126

Merged
merged 3 commits into from
Nov 16, 2023

Conversation

zoj613
Copy link
Owner

@zoj613 zoj613 commented Nov 7, 2023

This PR migrates the build process from cython 0.29.* to cython 3.0.* .

It also migrates the internal broadcasting logic from numpy's old MultiIter_* functions and uses the newer and more flexible Iterator API to encapsulate the broadcasting logic. This improves the readability and makes maintaining the code a lot easier since the numpy API does most of the allocation, broadcasting, casting and reshaping internally.

The above change allows us to now accept arrays of any dimensions > 1 for the out parameter.

@zoj613 zoj613 added maintainance maintaince of exisiting code. random_polyagamma related to the random sampling function polyagamma_pdf issue related to the density function of the distribution polyagamma_cdf issue related to the distribution function of the distribution labels Nov 7, 2023
@codecov-commenter
Copy link

codecov-commenter commented Nov 7, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (894f85c) 100.00% compared to head (9411376) 100.00%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #126   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            2         2           
  Lines          136       127    -9     
=========================================
- Hits           136       127    -9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@zoj613 zoj613 changed the title BUILD, MAINT: Migrate to Cython 3 and use the Iterator API instead of PyArray_MultiIter_* functions for iteration. BUILD, MAINT: Migrate to Cython 3 and use the Iterator API instead of PyArray_MultiIter_* functions for iteration. Nov 7, 2023
@zoj613 zoj613 force-pushed the npyiter branch 8 times, most recently from 3f45b32 to 502e133 Compare November 16, 2023 05:00
@zoj613 zoj613 merged commit bcb062f into main Nov 16, 2023
15 checks passed
@zoj613 zoj613 deleted the npyiter branch November 16, 2023 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintainance maintaince of exisiting code. polyagamma_cdf issue related to the distribution function of the distribution polyagamma_pdf issue related to the density function of the distribution random_polyagamma related to the random sampling function
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants