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

Refactor Py2NRNString. #3249

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Refactor Py2NRNString. #3249

wants to merge 2 commits into from

Conversation

1uc
Copy link
Collaborator

@1uc 1uc commented Nov 26, 2024

The Py2NRNString consisted of (what's now) a unique_cstr. The ctor would create the cstr, and {g,s}et_pyerr were non-static methods. They needed to check if the cstr as a nullptr, but where only ever called after checking that it was a nullptr.

This commit separates several notions:

  • Ownership is handled by unique_cstr.
  • An ASCII string is extracted from a Python object using as_ascii.
  • Both {g,s}et_pyerr were made static an are independent of each other and from converting a Python object to an (ASCII) C-string.
  • The PyErr2NRNString was removed.

Copy link

✔️ 9d6872b -> Azure artifacts URL

@bbpbuildbot

This comment has been minimized.

@1uc 1uc marked this pull request as ready for review November 26, 2024 11:36
Copy link

✔️ c6523a2 -> Azure artifacts URL

@bbpbuildbot

This comment has been minimized.

Base automatically changed from 1uc/unique_cstr to master November 27, 2024 20:55
Copy link

codecov bot commented Nov 28, 2024

Codecov Report

Attention: Patch coverage is 87.69231% with 8 lines in your changes missing coverage. Please review.

Project coverage is 67.07%. Comparing base (925a225) to head (fe213e8).

Files with missing lines Patch % Lines
src/nrnpython/nrnpy_utils.cpp 83.33% 3 Missing ⚠️
src/nrnpython/inithoc.cpp 0.00% 2 Missing ⚠️
src/nrnpython/nrnpy_hoc.cpp 90.00% 2 Missing ⚠️
src/nrnpython/nrnpy_p2h.cpp 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3249      +/-   ##
==========================================
- Coverage   67.08%   67.07%   -0.01%     
==========================================
  Files         571      571              
  Lines      111092   111052      -40     
==========================================
- Hits        74523    74487      -36     
+ Misses      36569    36565       -4     

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

Copy link

✔️ fe213e8 -> Azure artifacts URL

Copy link

sonarcloud bot commented Dec 2, 2024

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