Skip to content

Add .size() to the SectionList object, returns the number of sections in the list#3520

Merged
JCGoran merged 3 commits into
masterfrom
section-list-size
Jul 11, 2025
Merged

Add .size() to the SectionList object, returns the number of sections in the list#3520
JCGoran merged 3 commits into
masterfrom
section-list-size

Conversation

@mgeplf

@mgeplf mgeplf commented Jul 11, 2025

Copy link
Copy Markdown
Collaborator
  • used .size() to match what is in Vector()
  • Took the opportunity to public declarations in headers

mgeplf added 2 commits July 11, 2025 09:44
…ns in the list

* used `.size()` to match what is in Vector()
* Took the opportunity to public declarations in headers
@github-actions

Copy link
Copy Markdown
Contributor

✔️ aaa1001 -> artifacts URL

@github-actions

Copy link
Copy Markdown
Contributor

✔️ cc0e8f9 -> artifacts URL

@azure-pipelines

Copy link
Copy Markdown

✔️ aaa1001 -> Azure artifacts URL

@codecov

codecov Bot commented Jul 11, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 63.63636% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.45%. Comparing base (b1843f7) to head (507b86d).
⚠️ Report is 57 commits behind head on master.

Files with missing lines Patch % Lines
src/nrnoc/seclist.cpp 62.50% 12 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3520   +/-   ##
=======================================
  Coverage   68.44%   68.45%           
=======================================
  Files         683      683           
  Lines      116608   116611    +3     
=======================================
+ Hits        79816    79827   +11     
+ Misses      36792    36784    -8     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mgeplf mgeplf requested review from JCGoran and nrnhines July 11, 2025 11:14

@JCGoran JCGoran left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, some minor comments.

Comment thread src/nrnoc/seclist.cpp
Comment thread src/nrnoc/seclist.cpp Outdated
@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown
Contributor

✔️ 507b86d -> artifacts URL

@azure-pipelines

Copy link
Copy Markdown

✔️ 507b86d -> Azure artifacts URL

@mgeplf

mgeplf commented Jul 11, 2025

Copy link
Copy Markdown
Collaborator Author

@JCGoran I don't have merge permission; can you do it?

@JCGoran JCGoran merged commit 95bd396 into master Jul 11, 2025
43 of 44 checks passed
@JCGoran JCGoran deleted the section-list-size branch July 11, 2025 14:40
@ramcdougal

Copy link
Copy Markdown
Member

Are we sure that this is correct? In particular, normally when we iterate over a list, we also check to see if the sections are still active (have non-null prop). They'd get a null prop if they were deleted from HOC (which doesn't actually remove them from section lists that may contain them).

@mgeplf

mgeplf commented Jul 11, 2025

Copy link
Copy Markdown
Collaborator Author

In particular, normally when we iterate over a list, we also check to see if the sections are still active (have non-null prop). They'd get a null prop if they were deleted from HOC (which doesn't actually remove them from section lists that may contain them).

If that's the case, the previous python __len__ implementation was wrong:

static Py_ssize_t seclist_count(Object* ho) {

I guess it comes down to the desired semantics: should list items that have a null prop be counted?

@mgeplf

mgeplf commented Jul 15, 2025

Copy link
Copy Markdown
Collaborator Author

I guess it comes down to the desired semantics: should list items that have a null prop be counted?

@ramcdougal responded here: #3522

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.

3 participants