-
Notifications
You must be signed in to change notification settings - Fork 118
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
Fix h.Vector[0] : TypeError: type 'hoc.Vector' is not subscriptable #2862
Conversation
✔️ baba6fe -> Azure artifacts URL |
This comment has been minimized.
This comment has been minimized.
Quality Gate passedIssues Measures |
This comment has been minimized.
This comment has been minimized.
✔️ c37983f -> Azure artifacts URL |
Quality Gate passedIssues Measures |
✔️ 0a7baa2 -> Azure artifacts URL |
This comment has been minimized.
This comment has been minimized.
✔️ 8178114 -> Azure artifacts URL |
This comment has been minimized.
This comment has been minimized.
Supports h.File[index], etc via hocclass_getitem
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✔️ eb3088d -> Azure artifacts URL |
This comment has been minimized.
This comment has been minimized.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2862 +/- ##
=======================================
Coverage 67.26% 67.27%
=======================================
Files 571 572 +1
Lines 104867 104943 +76
=======================================
+ Hits 70542 70596 +54
- Misses 34325 34347 +22 ☔ View full report in Codecov by Sentry. |
✔️ c1d7fae -> Azure artifacts URL |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One small comment:
- the PR mixes
NULL
andnullptr
.
✔️ 47212cc -> Azure artifacts URL |
✔️ 8501922 -> Azure artifacts URL |
Quality Gate passedIssues Measures |
✔️ 7a5fe7e -> Azure artifacts URL |
Closes #2860
PyType_FromMetaClass
resolves the issue but requires python version >= 3.12. The function is wrapped bynrn_type_from_metaclass
in nrn_metaclass.cpp and for python version < 3.12 it contains a "cursed" implementation that seems to work but required some tweaking on my part.[x] In particular <3.12 seems to be missing the
__module__
field. E.g we would like to seeOtherwise, for the most part, things are looking pretty good...
[x] Perhaps test/hoctests/tests/test_hoc_class_instance.py should be augmented with more extensive tests.
[x] At the moment, the implementation of hocclass_getitem is not very efficient. It may be worthwhile to give that object a
Symbol*
field (filled in at construction time) for immediate searching ofsym->u.ctemplate->olist
[x] It is not clear at the moment that
hocobject_type
needs the custom_hocclass metaclass.[ ] Should user defined hoc classes participate in this PR? Their type is old style...
[ ] The
nrnpy_hoc.cpp
implementation is somewhat unclean. Error handling is inconsistent innrnpy_hoc()