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

Use more nanobind API #3024

Merged
merged 4 commits into from
Aug 7, 2024
Merged

Use more nanobind API #3024

merged 4 commits into from
Aug 7, 2024

Conversation

ferdonline
Copy link
Member

@ferdonline ferdonline commented Jul 31, 2024

Objective

Use nanobind API to further simplify operations and correct ref count.

This PR

  • Use nb::list and nb::handle API to simplify operations
  • Use nb::steal to track a new reference returned by PyObject_CallMethod(tpyobj, "insert"
  • Add missing .inc_ref() to an object being returned
  • Remove unneeded temp incref of arguments

Copy link

✔️ 0ddcaa4 -> Azure artifacts URL

@bbpbuildbot

This comment has been minimized.

@ferdonline ferdonline requested a review from 1uc July 31, 2024 13:09
@ferdonline ferdonline changed the title Use more nanbind API Use more nanbind API. Fix ref-count issue Jul 31, 2024
@ferdonline ferdonline marked this pull request as ready for review July 31, 2024 13:18
@ferdonline ferdonline closed this Jul 31, 2024
@ferdonline ferdonline reopened this Jul 31, 2024
src/nrnpython/nrnpy_nrn.cpp Outdated Show resolved Hide resolved
Copy link

✔️ 1aa2de8 -> Azure artifacts URL

@bbpbuildbot

This comment has been minimized.

@ferdonline ferdonline changed the title Use more nanbind API. Fix ref-count issue Use more nanobind API Jul 31, 2024
Copy link

✔️ 7dc294a -> Azure artifacts URL

Copy link

codecov bot commented Jul 31, 2024

Codecov Report

Attention: Patch coverage is 76.92308% with 3 lines in your changes missing coverage. Please review.

Project coverage is 67.27%. Comparing base (35823e6) to head (c526b7f).

Files Patch % Lines
src/nrnpython/nrnpy_nrn.cpp 76.92% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3024      +/-   ##
==========================================
- Coverage   67.28%   67.27%   -0.01%     
==========================================
  Files         572      572              
  Lines      104945   104939       -6     
==========================================
- Hits        70607    70602       -5     
+ Misses      34338    34337       -1     

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

@bbpbuildbot

This comment has been minimized.

@ferdonline
Copy link
Member Author

🥳

Copy link

✔️ 76305ff -> Azure artifacts URL

@bbpbuildbot

This comment has been minimized.

1uc
1uc previously approved these changes Aug 5, 2024
src/nrnpython/nrnpy_nrn.cpp Outdated Show resolved Hide resolved
src/nrnpython/nrnpy_nrn.cpp Outdated Show resolved Hide resolved
@1uc 1uc dismissed their stale review August 5, 2024 13:14

Wrong button.

Copy link

sonarcloud bot commented Aug 6, 2024

Copy link

✔️ c526b7f -> Azure artifacts URL

@1uc 1uc merged commit 94ee309 into master Aug 7, 2024
38 checks passed
@1uc 1uc deleted the enh/py_bind/nb_api_more branch August 7, 2024 09:41
mgeplf pushed a commit that referenced this pull request Aug 19, 2024
Use nanobind to simplify the implementation of:

* `NpySObj_contains`,
* `NPySecObj_insert`,
* `seg_point_processes`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants