Search found 14 matches

by apdavison
Wed Oct 14, 2015 4:42 am
Forum: NEURON + Python
Topic: Problem with hclass in NEURON 7.4
Replies: 5
Views: 4182

Re: Problem with hclass in NEURON 7.4

Do you expect to update the tar.gz package at http://www.neuron.yale.edu/ftp/neuron/v ... 7.4.tar.gz soon?
by apdavison
Mon Oct 05, 2015 8:41 am
Forum: NEURON + Python
Topic: Problem with hclass in NEURON 7.4
Replies: 5
Views: 4182

Re: Problem with hclass in NEURON 7.4

Many thanks!
by apdavison
Fri Oct 02, 2015 4:44 am
Forum: NEURON + Python
Topic: Problem with hclass in NEURON 7.4
Replies: 5
Views: 4182

Re: Problem with hclass in NEURON 7.4

Thanks for the quick reply. The fix solved the problem with the example I showed, but if I change the last line to:

Code: Select all

stim = SpikeArray(spike_times=[1, 2, 3, 4, 5])
the error reappears.
by apdavison
Thu Oct 01, 2015 11:10 am
Forum: NEURON + Python
Topic: Problem with hclass in NEURON 7.4
Replies: 5
Views: 4182

Problem with hclass in NEURON 7.4

I'm getting an error with NEURON 7.4 for code which worked fine in versions 7.0-7.3. An example: from neuron import h, hclass class SpikeArray(hclass(h.VecStim)): def __init__(self, spike_times=[]): self.spike_times = h.Vector(spike_times) self.play(self.spike_times) stim = SpikeArray([1, 2, 3, 4, 5...
by apdavison
Tue Sep 01, 2009 10:11 am
Forum: NEURON + Python
Topic: possible section syntax
Replies: 10
Views: 12063

Re: possible section syntax

Here is one way to do what you want: import neuron soma = neuron.h.Section() soma.nseg = 10 first_segments = [] first_segments.append(soma.__iter__()) def list_segments(seg): while True: yield seg.next() for first_seg in first_segments: for seg in list_segments(first_seg): print seg.x
by apdavison
Thu Nov 27, 2008 6:28 pm
Forum: NEURON + Python
Topic: the `-' in a prompt
Replies: 3
Views: 2720

Re: the `-' in a prompt

Code: Select all

python -i file.py
by apdavison
Fri Aug 29, 2008 6:48 am
Forum: NEURON + Python
Topic: Neuron GUI with python?
Replies: 7
Views: 5790

Re: Neuron GUI with python?

I find that the GUI works if launching the Python interpreter via

nrngui -python

but not with plain "python"

(this is on Linux and Darwin, don't know about Windows)
by apdavison
Wed Jul 12, 2006 4:30 am
Forum: NEURON + Python
Topic: Tip of the day
Replies: 11
Views: 15850

nrnpython is in 5.8

You don't need the CVS version for the example I posted above.
nrnpython was certainly in version 5.8, and I imagine it is in 5.9.
by apdavison
Tue Jul 11, 2006 4:38 am
Forum: NEURON + Python
Topic: Tip of the day
Replies: 11
Views: 15850

hoc python module

To get the hoc module, you have to run nrniv -python This starts NEURON with the python interpreter (assuming NEURON has been compiled with the --with-nrnpython configure option). You should then be able to >>> import hoc >>> import nrn At the moment, the hoc module only provides one function: execu...
by apdavison
Mon May 22, 2006 5:06 am
Forum: NEURON + Python
Topic: Tip of the day
Replies: 11
Views: 15850

Tip of the day

This will become obsolete as the functionality of the python interface increases, but I have created a class HocToPy, with a static method get(), to make getting variables from hoc into python easier: import hoc class HocToPy: """Static class to simplify getting variables from hoc.&qu...
by apdavison
Sat Apr 29, 2006 2:23 am
Forum: NEURON + Python
Topic: possible section syntax
Replies: 10
Views: 12063

Re: Assigning to multiple segments at once

My original idea was that it would raise an Exception if the size of the tuple or list did not match the number of segments. If you would prefer it to fail gracefully, then either the relationship you suggest or some sort of interpolation would be possible. Alternatively, nseg could be automatically...
by apdavison
Thu Apr 27, 2006 12:39 pm
Forum: NEURON + Python
Topic: possible section syntax
Replies: 10
Views: 12063

Assigning to multiple segments at once

I like the syntax very much. It actually seems to make more sense than the equivalent hoc syntax, since "x" relates to the section and not to the mechanism variable and so is closer to the object it relates to. What I would not like to see lost is the ability to assign the same value to al...
by apdavison
Thu Mar 23, 2006 10:21 pm
Forum: Other questions
Topic: Plotting 3D figures?
Replies: 3
Views: 6631

Creating movies from NEURON

Alain Destexhe has a demonstration of how to create movies from NEURON here:

http://cns.iaf.cnrs-gif.fr/alain_demos.html#mpeg

(Unix/Linux only, although it would probably work with Mac OS X or Windows with Cygwin).
by apdavison
Thu Mar 23, 2006 12:38 am
Forum: NEURON + Python
Topic: request for comments
Replies: 13
Views: 19629

If I ventured an idea I would suggest that one range variable would be implemented as a method for each "section" object. This class method accepts one argument which may be any float in [0,1], and return the value it found in the closest segment. Unfortunately, this works fine for print ...