Search found 16 matches

by romain.caze
Mon Jul 06, 2015 8:43 am
Forum: NEURON + Python
Topic: uninsert python
Replies: 6
Views: 10887

Re: uninsert python

Dear Oren,

There is no uninsert procedure in NEURON (to my knowledge). It explains the error message (Section has no attribute "uninsert"). A solution might be to create a new section and insert only the things you want in it and not insert the "hh".

Best,
R.
by romain.caze
Tue Jun 30, 2015 4:44 am
Forum: NEURON + Python
Topic: Installing NEURON with Python using pip
Replies: 1
Views: 10093

Installing NEURON with Python using pip

Dear All, I installed the last version of 7.4. But I still have to modify my python path to be able to import neuron in Python. Exactly I have to add to my .bashrc export PYTHONPATH=/usr/local/nrn/lib/python/ So that I do not have an error when I am importing neuron (so python knows where to find ne...
by romain.caze
Tue Jun 30, 2015 3:54 am
Forum: NEURON + Python
Topic: More NEURON + Python documentation
Replies: 6
Views: 22281

Re: More NEURON + Python documentation

Hi All,

Thank you Tom for the new link as Philipp's tuto is great.
Here is a link to another NEURON + Python tutorial. https://romaincaze.wordpress.com/2015/0 ... -tutorial/

Cheers,
R.
by romain.caze
Fri Feb 28, 2014 12:17 pm
Forum: NEURON + Python
Topic: reset NEURON
Replies: 10
Views: 5308

Re: reset NEURON

I am using a single top level cell and I'm having trouble clearing the hoc interpreter. I tried executing h("forall delete_section()") but with no success (h.allsec() still returns the same sections). I also tried looping through the sections in python's end (using for a in h.allsec()) and trying t...
by romain.caze
Tue Feb 18, 2014 6:26 am
Forum: NEURON + Python
Topic: Obtaining a segmentation fault using neuron
Replies: 11
Views: 5032

Re: Obtaining a segmentation fault using neuron

Hi Ted, Thank you for your answer, you gave the cause of the segmentation fault (nrn.Section), and I agree the method you propose (that we discussed previously with robert) seems the most natural. But: Anyway, if all you want is to avoid typeing the 'h.' when you use the section in python and you al...
by romain.caze
Mon Feb 17, 2014 11:58 am
Forum: NEURON + Python
Topic: Obtaining a segmentation fault using neuron
Replies: 11
Views: 5032

Re: Obtaining a segmentation fault using neuron

Dear All, Thank you for your posts Robert. It helped to better define the questions but it did not answer the first question: "How come there is a segmentation fault using the example code?" nor the second: "How come a section object created with python is not in the h namspace?". I reinstantiate he...
by romain.caze
Mon Feb 17, 2014 11:51 am
Forum: NEURON + Python
Topic: Section object created in python partially existing in hoc
Replies: 1
Views: 2078

Section object created in python partially existing in hoc

Dear all, One can wrap a section object within a python class from neuron import h, nrn class NewSection(nrn.Section): """ Should wrap a NEURON section """ def __init__(self, name="fault"): """Initialize the section """ nrn.Section.__init__(self, name=name) It seems to work beautifully. For instance...
by romain.caze
Mon Feb 17, 2014 7:26 am
Forum: NEURON + Python
Topic: Obtaining a segmentation fault using neuron
Replies: 11
Views: 5032

Re: Obtaining a segmentation fault using neuron

Dear Robert, When you say the "code works fine for me" you mean you obtain the same kind of error, don't you? This is exactly the problem: "the object newSec does not exit in the hoc object namespace". Is there a purpose to that, because it looks like an problematic bug to me. Obviously I am doing t...
by romain.caze
Tue Feb 11, 2014 11:35 am
Forum: NEURON + Python
Topic: Obtaining a segmentation fault using neuron
Replies: 11
Views: 5032

Re: Obtaining a segmentation fault using neuron

I forgot something.
Even more puzzling, if after creating the section using the previous method you type

Code: Select all

h.newS
And use the tab autocompletion in ipython it turns it into

Code: Select all

h.newSec
But when you type enter it returns

Code: Select all

AttributeError: 'hoc.HocObject' object has no attribute 'newSec'
???
by romain.caze
Tue Feb 11, 2014 11:30 am
Forum: NEURON + Python
Topic: Obtaining a segmentation fault using neuron
Replies: 11
Views: 5032

Re: Obtaining a segmentation fault using neuron

Thank you Robert for you quick answer. I am happy you propose this solution as it was the first thing I did. I was really happy until I typed (assuming that you runned the code your put in your response before) from neuron import h h("print newSec.L") This strangely returns an error message as if th...
by romain.caze
Tue Feb 11, 2014 5:17 am
Forum: NEURON + Python
Topic: Obtaining a segmentation fault using neuron
Replies: 11
Views: 5032

Obtaining a segmentation fault using neuron

Dear all, The following python code snippet creates a segmentation fault (making the ipython kernel crashes). from neuron import nrn, h def section_print(): """Print the different sections in the NEURON namespace""" for sec in h.allsec(): print sec.name() class Segfault(nrn.Section): """ Should wrap...
by romain.caze
Tue Sep 03, 2013 11:05 am
Forum: NEURON + Python
Topic: Recoding NEURON in Python
Replies: 5
Views: 2904

Re: Recoding NEURON in Python

Dear Ted and Vellamike, I agree with Ted; removing the GUI would be a mistake, I still remember my marvel when I saw the first spike generated by a NEURON model (a souvenir almost as sweet as the first time I witnessed a real spike). But Vellamike is right, the NEURON GUI despite its richness is und...
by romain.caze
Tue Sep 03, 2013 10:29 am
Forum: NEURON + Python
Topic: Playing a vector
Replies: 12
Views: 6929

Re: Playing a vector

Dear all, I am using VecStim regularly to stimulate NEURON models with a (or multiple) train of presynaptic activity. This could be, without python wrapping, a tedious process import numpy as np from neuron import h """There should be some code here to create a neuron model with a soma""" #To create...
by romain.caze
Fri Mar 22, 2013 8:45 am
Forum: NEURON + Python
Topic: Recoding NEURON in Python
Replies: 5
Views: 2904

Recoding NEURON in Python

Dear all, I used NEURON+Python a lot during my PhD, I am using it a lot, I will keep using it a lot and I like this combination. But I also love to deconstruct/reconstruct things, so I am wondering how NEURON could be completly recoded in pure python or cython. How would you start such a project? Do...
by romain.caze
Tue Nov 09, 2010 10:47 am
Forum: NEURON + Python
Topic: access the section after loading a morphology file
Replies: 6
Views: 3075

Re: access the section after loading a morphology file

To insert a mechanism I tried h.axon.insert('hh') and it worked well, it had also worked for pointprocesses.
I also want to thanks for the fast posted responses and for this great software !
Romain