Search found 110 matches

by pascal
Fri May 31, 2024 4:47 pm
Forum: MSWin
Topic: Python cannot import neuron library on Windows install
Replies: 7
Views: 18507

Re: Python cannot import neuron library on Windows install

I just had this issue crop up again as well. Good catch with the Python version number. Like you, with Python 3.12 I could not import neuron. But then I reverted to Python 3.9, and this solved the problem. Are you able to simply go back to an earlier Python version, at least until they update NEURON...
by pascal
Wed May 29, 2024 5:06 pm
Forum: Modeling networks
Topic: Incorporating STDP in a network
Replies: 1
Views: 155

Re: Incorporating STDP in a network

I found the answer to my second question. In section 10.1.7.5 of The NEURON Book (describing the NET_RECEIVE block of a mod file), it states, "every event has an implicit argument called flag, the value of which is automatically 0 for an external event." It would still be very nice if some...
by pascal
Tue May 28, 2024 8:05 pm
Forum: Modeling networks
Topic: Incorporating STDP in a network
Replies: 1
Views: 155

Incorporating STDP in a network

I am attempting to incorporate STDP in a network model, and I am starting with a two-neuron network in which I want to incorporate a very simple STDP model. Reading around, I see various references to a mod file for STDP written ages ago by Michael Hines (e.g., https://www.neuron.yale.edu/phpbb/view...
by pascal
Fri May 24, 2024 3:23 pm
Forum: Adding new mechanisms and functions to NEURON
Topic: Recording variables from ARTIFICIAL_CELL
Replies: 14
Views: 1458

Re: Recording variables from ARTIFICIAL_CELL

I am just starting out using artificial cells, so I found this post very helpful. In case anyone is interested, below is a very basic program that implements a version of Ted's pseudocode in Python. Note that I did not have to update intfire1.mod, as it appears to already have the code for calculati...
by pascal
Wed Dec 13, 2023 5:15 pm
Forum: NEURON hacks
Topic: Conditional termination of simulation
Replies: 10
Views: 90348

Re: Conditional termination of simulation

Thanks, Ted, that makes sense that this would be useful for the purposes of a GUI. Maybe Robert can help with the other question...
by pascal
Thu Dec 07, 2023 7:31 pm
Forum: NEURON hacks
Topic: Conditional termination of simulation
Replies: 10
Views: 90348

Re: Conditional termination of simulation

I decided I couldn't live with myself if I didn't try to implement the more acceptable approach you suggested (passing all variables as arguments, and then returning them). However, I'm running into some trouble with syntax. I can change spikehappened to the following: def spikehappened(tsp, count, ...
by pascal
Tue Dec 05, 2023 4:09 pm
Forum: NEURON + Python
Topic: Issue with SaveState
Replies: 2
Views: 21442

Re: Issue with SaveState

Okay, I guess I'll just be more careful in using SaveState. And this actually cleared up my other question, too. Thanks, Ted!
by pascal
Fri Nov 17, 2023 7:42 pm
Forum: NEURON + Python
Topic: Issue with SaveState
Replies: 2
Views: 21442

Issue with SaveState

I am having a few issues using h.SaveState(). First, I've found that switching the order of recording vector statements results in the program crashing when trying to restore. Here is my code (which the BallandStick class from https://neuron.yale.edu/neuron/docs/ball-and-stick-model-part-1 ), which ...
by pascal
Fri Nov 17, 2023 7:32 pm
Forum: NEURON hacks
Topic: Conditional termination of simulation
Replies: 10
Views: 90348

Re: Conditional termination of simulation

Thanks, Ted, that worked like a charm! I hadn't thought to use global variables, and that is a perfectly acceptable solution for my purposes. Appreciate the help.
by pascal
Wed Nov 08, 2023 11:45 pm
Forum: NEURON hacks
Topic: Conditional termination of simulation
Replies: 10
Views: 90348

Re: Conditional termination of simulation

I got this working, but the code is terribly ugly, and I'd appreciate any insight into how to clean it up. First, I defined a very simple mechanism with the following mod file: NEURON { SUFFIX sp RANGE spike_count, tnow, isinow, isiprev } ASSIGNED { spike_count tnow isinow isiprev } In the Cell temp...
by pascal
Tue Nov 07, 2023 5:04 pm
Forum: NEURON hacks
Topic: Conditional termination of simulation
Replies: 10
Views: 90348

Re: Conditional termination of simulation

If I change the function to FInitializeHandler to def set_spike_count(spike_count=0): print('set_spike_count: spike_count = %d' % spike_count) and then replace nc.record(spike_callback) with spike_count = 0 nc.record((spike_callback, spike_count)) then the program runs without error. But it doesn't ...
by pascal
Mon Nov 06, 2023 6:02 pm
Forum: NEURON hacks
Topic: Conditional termination of simulation
Replies: 10
Views: 90348

Re: Conditional termination of simulation

Thanks for the help, Ted. I have to admit I don't understand FInitializeHandler very well even after reading its documentation page. In particular, I can't figure out how to initialize a variable 'spike_count' that is associated with the NetCon, and then connect the 'spike_count' variable defined fo...
by pascal
Fri Nov 03, 2023 2:35 pm
Forum: NEURON hacks
Topic: Conditional termination of simulation
Replies: 10
Views: 90348

Conditional termination of simulation

I am simulating a single neuron with adaptation currents, and I would like to run a simulation until the most recent inter-spike interval differs from the second-most-recent inter-spike interval by less than some prescribed threshold. I have basic code that records spike times, so I'm wondering abou...
by pascal
Wed Aug 09, 2023 11:00 pm
Forum: Adding new mechanisms and functions to NEURON
Topic: NMODL code no longer works in version 8.2
Replies: 7
Views: 20138

Re: NMODL code no longer works in version 8.2

That did it...thank you very much for all your help!
by pascal
Wed Aug 09, 2023 5:21 pm
Forum: Adding new mechanisms and functions to NEURON
Topic: NMODL code no longer works in version 8.2
Replies: 7
Views: 20138

Re: NMODL code no longer works in version 8.2

Thanks, that makes sense. Also, I stumbled on one more issue: my mod files are now compiling fine using the Linux distribution, but in Windows I receive the following error message: Ih.c:7:10: fatal error: scoplib_ansi.h: No such file or directory 7 | #include "scoplib_ansi.h" | ^~~~~~~~~~...