Skip to content
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

Loading import3d before loading modfile create an execption (only in Neruon 7.6) #130

Closed
orena1 opened this issue Dec 11, 2018 · 3 comments

Comments

@orena1
Copy link
Contributor

orena1 commented Dec 11, 2018

It seems that only in Neuron 7.6 loading import3d.hoc before loading the modfiles will create an exception:
Code for running the example

from neuron import h, gui

h.load_file("import3d.hoc")  ## THIS LINE
h.nrn_load_dll("x86_64_temp/.libs/libnrnmech.so")


MODEL_FILE = 'cNAC187_L23_LBC_3_C230300D1_new_new_fit.hoc'
model_obj_name = 'cNAC187_L23_LBC_3_C230300D1_new_new_fit'

h.load_file(MODEL_FILE)

cell = h.cNAC187_L23_LBC_3_C230300D1_new_new_fit(1,'C230300D1.asc')

Running the code above will create this exception in Neuron 7.6

bad stack access: expecting (double); really (Object *)
NEURON: interpreter stack type error
 near line 0
 {forall all.append}
                    ^
        Import3d_GUI[0].instantiate(Cell[0])
      Cell[0].AddMorph("C230300D1.asc")
    Cell[0].init(1, "C230300D1.asc")
  cNAC187_L23_LBC_3_C230300D1_new_new_fit[0].init(1, "C230300D1.asc")
oc_restore_code tobj_count=2 should be 1
Traceback (most recent call last):
  File "/_____/nrn/lib/python/neuron/__init__.py", line 494, in _declare_contour
    center_vec = secobj.contourcenter(secobj.raw.getrow(0), secobj.raw.getrow(1), secobj.raw.getrow(2))
RuntimeError: hoc error

If you suspect this is an IPython bug, please report it at:
    https://github.com/ipython/ipython/issues
or send an email to the mailing list at [email protected]

You can print a more detailed traceback right now with "%tb", or use "%debug"
to interactively debug it.

Extra-detailed tracebacks for bug-reporting purposes can be enabled via:
    %config Application.verbose_crash=True

NEURON: PyObject method call failed: _declare_contour
 near line 0
 ^
        Import3d_GUI[0].instantiate(Cell[0])
      Cell[0].AddMorph("C230300D1.asc")
    Cell[0].init(1, "C230300D1.asc")
  cNAC187_L23_LBC_3_C230300D1_new_new_fit[0].init(1, "C230300D1.asc")
oc_restore_code tobj_count=2 should be 0
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
/_____/one_file_test.py in <module>()
     10 h.load_file(MODEL_FILE)
     11 
---> 12 cell = h.cNAC187_L23_LBC_3_C230300D1_new_new_fit(1,'C230300D1.asc')
     13 
     14 

RuntimeError: hoc error

but it works well in Neuron 7.4. The main problem is the line marked with a comment (EDIT: which is sometimes needed)

Might also be related to this issue: CINPLA/NeuroCNN#2

In order to test the attached code, you need to compile the mod files and then rename x86_64 to x86_64_temp

@nrnhines
Copy link
Member

I'd like to work on this problem but don't have C230300D1.asc or cNAC187_L23_LBC_3_C230300D1_new_new_fit.hoc or probably anything those depend on.

@orena1 orena1 changed the title Loading import3d before loading modfile create an execption (only in Neruon 7.6)) Loading import3d before loading modfile create an execption (only in Neruon 7.6) Dec 11, 2018
@orena1
Copy link
Contributor Author

orena1 commented Dec 11, 2018

All the files are in the attached zip, in the first line of the issue. Also here:
Code for running the example

@nrnhines
Copy link
Member

This bug is fixed by changeset f837b5c and was introduced by changeset 31493b9.
The effect of the bug was that if new POINT_PROCESSES were registered after user defined
hoc templates were created, then the use of the latter could in some circumstances be thought to have
returned a bad return type code when in fact, user methods know nothing about return type codes (for python boolean, int, and float).

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

No branches or pull requests

2 participants