-
Notifications
You must be signed in to change notification settings - Fork 119
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
formalization of an API #2357
formalization of an API #2357
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I'll have to figure out why this apparently doesn't build on anything other than my machine, but a mostly complete draft of a formal interface is in I would like suggestions for how to do iterators with C (as opposed to C++) because it feels like this is almost but not reasonable: sli = nrn_new_sectionlist_iterator(nrn_get_sectionlist_data(seclist));
for (;!nrn_sectionlist_iterator_done(sli);) {
auto sec=nrn_sectionlist_iterator_next(sli);
cout << " " << nrn_secname(sec) << endl;
}
nrn_free_sectionlist_iterator(sli); (That's from the sections.cpp test) Other priorities to consider: how consistent is the naming convention? |
This comment has been minimized.
This comment has been minimized.
On some systems (most? but not the one I used for everything else), some files tried to include the wrong nrnapi.h during the "make install" phase.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2357 +/- ##
========================================
Coverage 67.20% 67.20%
========================================
Files 563 569 +6
Lines 104246 104697 +451
========================================
+ Hits 70057 70365 +308
- Misses 34189 34332 +143 ☔ View full report in Codecov by Sentry. |
✔️ e6afbb0 -> Azure artifacts URL |
This comment has been minimized.
This comment has been minimized.
✔️ be7261e -> Azure artifacts URL |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✔️ aed536f -> Azure artifacts URL |
- after RANDOM construct (#2627) was merged, netstim.mod uses Random123 by default - before this, netstim was using scoprand by default and reference results were from the same - now, explicitly use Random123 in the test and update reference results
I did a merge with the master but @ramcdougal: could you take a look at the last few comments and we can close this? 😃 |
✔️ 030985e -> Azure artifacts URL |
This comment has been minimized.
This comment has been minimized.
✔️ 74d66db -> Azure artifacts URL |
This comment has been minimized.
This comment has been minimized.
Quality Gate passedIssues Measures |
✔️ 50d7e68 -> Azure artifacts URL |
This comment has been minimized.
This comment has been minimized.
@ramcdougal I did not have an issue on my Apple M1 (Clang 15.0.0) with |
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.
@ramcdougal If this is working for your Matlab project, it seems worth merging to master when it passes CI. Any improvements can be dealt with in future PRs.
✔️ 7e84d4b -> Azure artifacts URL |
This comment has been minimized.
This comment has been minimized.
Quality Gate passedIssues Measures |
✔️ 9e53b77 -> Azure artifacts URL |
See
src/nrniv/neuronapi.h
for the list of API functions.For examples of C++ code using this, see https://github.com/mcdougallab/neuron-c-api-demos/tree/main/for-proposed-formal-api
In particular, check out the hh_sim.cpp, vclamp.cpp, netcon.cpp, sections.cpp, and introspection.cpp files.
Many of the functions in the API are shallow and directly call a built-in, but this separation allows that to change in the future. Some others are more complicated. Importantly: the API completely hides details of the memory management; that is, users should be able to get and set all relevant properties using functions.