Search found 39 matches

by sec6
Thu Aug 07, 2008 7:09 pm
Forum: NEURON + Python
Topic: Numpy?
Replies: 19
Views: 9952

Re: Numpy?

Wow that was fast.
I realize, now, that, by making the suggestion, I've sort of incurred a moral obligation to download the latest source & try it out. I'm embarrassed to say that it's going to take me longer to do that than it took to implement the feature.
by sec6
Thu Aug 07, 2008 10:59 am
Forum: Adding new mechanisms and functions to NEURON
Topic: Race condition with multiple artificial cell instances acces
Replies: 7
Views: 4502

Re: Race condition with multiple artificial cell instances acces

I'm pleased to hear that I've been beta-testing the documentation, rather than wasting your time with silly questions, as I had begun to think. I don't think there's a *general* solution here. Personally, I prefer very dry, "language definition" style documentation -- it may be hard to read, but it'...
by sec6
Wed Aug 06, 2008 7:16 pm
Forum: Adding new mechanisms and functions to NEURON
Topic: Race condition with multiple artificial cell instances acces
Replies: 7
Views: 4502

Re: Race condition with multiple artificial cell instances acces

What does the Programmer's Reference documentation of the NetCon class say? It says: section netcon = new NetCon(&v(x), target) netcon = new NetCon(source, target) section netcon = new NetCon(&v(x), target, threshold, delay, weight) netcon = new NetCon(source, target, threshold, delay, weight) i.e....
by sec6
Tue Aug 05, 2008 6:41 pm
Forum: NEURON + Python
Topic: Numpy?
Replies: 19
Views: 9952

Re: Numpy?

For large arrays, copying between numpy and the hoc Vector is not only time-inefficient, it is also memory inefficient. (There are, at least transiently, two copies of the same data in memory, one as numpy.array, the other as hoc Vector.) Eventually, I hope, Vector.from_python() will allow hoc Vecto...
by sec6
Tue Aug 05, 2008 5:32 pm
Forum: Adding new mechanisms and functions to NEURON
Topic: Race condition with multiple artificial cell instances acces
Replies: 7
Views: 4502

Re: Race condition with multiple artificial cell instances acces

Thanks. I should have known there was a simpler way to do it. (My questions are now moot, but I'm still curious about the answer to the first one, i.e. how to prevent race conditions between multiple instances of artificial cells sharing a common resource (like a file). Does anyone know an answer?) ...
by sec6
Mon Aug 04, 2008 4:52 pm
Forum: Adding new mechanisms and functions to NEURON
Topic: Race condition with multiple artificial cell instances acces
Replies: 7
Views: 4502

Race condition with multiple artificial cell instances acces

I've written an artificial cell which generates spikes at times specified by an input data file. The NMODL code just reads spike times out of a file, and calls net_send() once for each spike. All of this happens at initialization time -- there's no actual NMODL code that executes during the simulati...
by sec6
Wed Jul 16, 2008 5:50 pm
Forum: NEURON + Python
Topic: NetCon and artificial cell; sec parameter
Replies: 2
Views: 1698

Re: NetCon and artificial cell; sec parameter

The 'sec' argument is *always* redundant, as far as I can tell, not just when the presynaptic cell is an artificial cell. The sec argument should probably be abolished in some future release (I think I heard Michael Hines say that was his intention) and the present example can be considered further ...
by sec6
Sun Jul 13, 2008 2:33 pm
Forum: NEURON + Python
Topic: NetCon and artificial cell; sec parameter
Replies: 2
Views: 1698

NetCon and artificial cell; sec parameter

I'm trying -- in Python -- to make a NetCon connection where the presynaptic cell is an artificial neuron. The normal syntax for creating a NetCon would be something like: nc = h.NetCon(preCell.soma(0.5)._ref_v,postMech,sec=preCell.soma) The artificial cell, however has no '.soma' (nor any other sec...
by sec6
Sun Jun 29, 2008 10:12 pm
Forum: NEURON + Python
Topic: Python + NetCon = KERN_PROTECTION_FAILURE
Replies: 1
Views: 2237

Python + NetCon = KERN_PROTECTION_FAILURE

I'm getting "bus errors" (KERN_PROTECTION_FAILURE) when I try to use NetCons from Python. [1] neuron -python NEURON -- VERSION 6.2.1028 (2151) 2008-06-18 Duke, Yale, and the BlueBrain Project -- Copyright 1984-2007 See http://www.neuron.yale.edu/credits.html >>> import neuron >>> h = neuron.h >>> im...
by sec6
Mon Apr 28, 2008 5:09 pm
Forum: Adding new mechanisms and functions to NEURON
Topic: WATCHing arrays
Replies: 2
Views: 1606

You will have to avoid arrays. The implementation can only work when a WATCH variable is a scalar. OK. For the benefit of anyone else who runs into this, my workaround was as follows: ... INITIAL { ... net_send(0,99) ... } ... BREAKPOINT { ... myArrayMin = 0 FROM i = 0 TO N-1 { if (myArray[i] < myA...
by sec6
Sat Apr 26, 2008 7:22 pm
Forum: Adding new mechanisms and functions to NEURON
Topic: WATCHing arrays
Replies: 2
Views: 1606

WATCHing arrays

The following seems to be illegal: NET_RECEIVE (weight) { ... FROM i = 0 TO N - 1 { WATCH (myArray[i] < 0) 1 } ... } It fails with the following error message: In function '_watch3_cond': error: '_li' undeclared (first use in this function) Here is the C sourcecode which NMODL generated for _watch3_...
by sec6
Sat Apr 26, 2008 9:02 am
Forum: Adding new mechanisms and functions to NEURON
Topic: Aborting a simulation run from within NMODL
Replies: 2
Views: 1833

abort() is a good way to stop immediately. And is what I use when I am using gdb and want to get control at a specific location (usually before an assert error). If you want to return immediately to the interpreter use hoc_execerror("message1", "message2") if you want to stop at the end of the curr...
by sec6
Thu Apr 24, 2008 2:20 pm
Forum: Adding new mechanisms and functions to NEURON
Topic: Aborting a simulation run from within NMODL
Replies: 2
Views: 1833

Aborting a simulation run from within NMODL

Is there a way to abort a NEURON simulation (i.e. terminate computation prior to t == tstop) from within a NMODL mechanism? I'm wanting to do this for debugging purposes, i.e. something like: IF (fooBar > maxLegalValue) { printf ("Variable fooBar has been assigned an illegal value: %g\n",fooBar) dum...
by sec6
Thu Apr 24, 2008 2:08 pm
Forum: Adding new mechanisms and functions to NEURON
Topic: STATEs which are arrays
Replies: 18
Views: 6045

Hmm. Both suggestions would be a bit difficult, but it's the right kind of difficult, i.e. worth the effort and teaches me something useful. The kinetic scheme is tempting ('cause I can keep my hands off the C code) but would require rethinking the model at a conceptual level. If I do that, can I 1...
by sec6
Sun Apr 06, 2008 8:38 am
Forum: Adding new mechanisms and functions to NEURON
Topic: STATEs which are arrays
Replies: 18
Views: 6045

Hmm. Both suggestions would be a bit difficult, but it's the right kind of difficult, i.e. worth the effort and teaches me something useful. The kinetic scheme is tempting ('cause I can keep my hands off the C code) but would require rethinking the model at a conceptual level. If I do that, can I 1)...