Skip to content

Python 3.13.1 broke [s for s in sl] where sl is a SectionList.#3276

Merged
nrnhines merged 4 commits into
masterfrom
hines/seclist-iter
Dec 9, 2024
Merged

Python 3.13.1 broke [s for s in sl] where sl is a SectionList.#3276
nrnhines merged 4 commits into
masterfrom
hines/seclist-iter

Conversation

@nrnhines

@nrnhines nrnhines commented Dec 7, 2024

Copy link
Copy Markdown
Member

This PR fixes (works around?) the following Python-3.13.1 error:

$ python
Python 3.13.1 (main, Dec  6 2024, 07:50:24) [GCC 13.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from neuron import h
>>> sl = h.SectionList()
>>> [s for s in sl]
Traceback (most recent call last):
  File "<python-input-2>", line 1, in <module>
    [s for s in sl]
                ^^
TypeError: Not an iterable HocObject
>>> 

It also provides the len function, ie. given the above empty sl

>>> len(sl)
0

@nrnhines nrnhines requested a review from JCGoran December 7, 2024 11:04
Comment thread src/nrnpython/nrnpy_hoc.cpp Outdated
@azure-pipelines

Copy link
Copy Markdown

✔️ bf3cc7e -> Azure artifacts URL

@codecov

codecov Bot commented Dec 7, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.05%. Comparing base (47b0359) to head (836a96d).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3276      +/-   ##
==========================================
- Coverage   67.06%   67.05%   -0.01%     
==========================================
  Files         571      571              
  Lines      111072   111080       +8     
==========================================
- Hits        74493    74489       -4     
- Misses      36579    36591      +12     

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

@bbpbuildbot

This comment has been minimized.

@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.

LGTM, nice work!

@JCGoran JCGoran mentioned this pull request Dec 8, 2024
2 tasks
@nrnhines nrnhines enabled auto-merge (squash) December 9, 2024 13:28
@sonarqubecloud

sonarqubecloud Bot commented Dec 9, 2024

Copy link
Copy Markdown

@azure-pipelines

Copy link
Copy Markdown

✔️ 836a96d -> Azure artifacts URL

@nrnhines nrnhines merged commit 00ba007 into master Dec 9, 2024
@nrnhines nrnhines deleted the hines/seclist-iter branch December 9, 2024 15:10
nrnhines added a commit that referenced this pull request Jan 23, 2025
nrnhines added a commit that referenced this pull request Mar 24, 2025
At starting point, jelic/8.2-py313 #3319 had only two CI failures.

Almost the entirety of this PR is to get 8.2 to pass CI.
In addition it supports Python3.13.
Bug fixes adopted from the master are
#3239 Launching nrniv -python with Python 3.13.0 does not allow use of gui.
#3259 On h.quit() terminal settings are same as when neuron.hoc was imported.
#3243 save stdin terminal settings on import hoc and restore on h.quit()
#3276 Python 3.13.1 broke [s for s in sl] where sl is a SectionList. Manual partial cherry-pick.

Other PR attempts at fixing CI failures that can be closed when this PR is merged, are #3329 #3325 #3319 #3317

Many of the CI fixes are backports from #3028 #3040 #3303 #3105 #3278

bldnrnmacpkgcmake.sh was updated. It isolates a change (avoid breaking CI) with -DNRN_MAC_PKG=ON
---------

Co-authored-by: Goran Jelic-Cizmek <goran.jelic-cizmek@epfl.ch>
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