-
Notifications
You must be signed in to change notification settings - Fork 123
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
Replace hocload.sh
with std::filesystem
utils
#3293
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3293 +/- ##
==========================================
- Coverage 67.08% 67.05% -0.03%
==========================================
Files 571 571
Lines 111044 111086 +42
==========================================
Hits 74489 74489
- Misses 36555 36597 +42 ☔ View full report in Codecov by Sentry. |
This comment has been minimized.
This comment has been minimized.
✔️ 6a3f8d8 -> Azure artifacts URL |
Model 150245 from modelDB fails (see https://github.com/neuronsimulator/nrn-modeldb-ci/actions/runs/12369627580/job/34521930207), but I am 99.99% sure it's not related since it fails on the nightly as well (see https://github.com/neuronsimulator/nrn-modeldb-ci/actions/runs/12361469702/job/34498702435). |
✔️ 253637f -> Azure artifacts URL |
✔️ 0bc2c1d -> Azure artifacts URL |
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.
I'm of two minds about this. On the one hand, if the change does not affect behavior, I'm fine with it. On the other hand, I don't want to spend any time on it. This supports an old feature of hoc for the functions load_func
, load_proc
, and load_template
. see, e.g. https://nrn.readthedocs.io/en/latest/hoc/programming/dynamiccode.html#load_func which probably can't be removed but is practically superseded by the less complex, easier to understand, and very commonly used load_file
. My prejudice is not to spend too much time on hoc development (python is so much more useful!) but only to keep it maintained. This pr perhaps simplifies maintenance so I'm approving. But let's first be sure it passes nrn-modeldb-ci
|
✔️ 609d27f -> Azure artifacts URL |
|
✔️ 92de136 -> Azure artifacts URL |
hoc_load
seems to be doing the following:proc
,func
,begintemplate
gargstr
) is a defined symbol in the current scopehocload.sh
with 3 args: the keyword, the symbol name, andhoc_pid
. This script seems togrep
all HOC files in${PWD}
,${HOC_LIBRARY_PATH}
for the patternfunc|proc|begintemplate
, stores them in the temp filenames
, then usessed
to find out whether there is a matching symbol in some file. If there is, it echoes the first match, and returns 0, and if there aren't any matches, it returns 1.hoc_Load_file
I've replaced most of the above using
std::filesystem
, though I am not sure whether the logic of returning the first match is right in the first place, but nevertheless I tried replicating the existing behavior as closely as possible.