Search found 267 matches
- Mon Jun 01, 2020 1:44 pm
- Forum: OS X
- Topic: Syntax Warning
- Replies: 1
- Views: 14061
Re: Syntax Warning
This is harmless. You can ignore it. Even though you're not using Python explicitly, NEURON will connect to Python to have it available (and Python is needed to enable certain functions). What happened was there was something in the NEURON internals that did not raise a Python warning until a change...
- Mon Jun 01, 2020 1:35 pm
- Forum: Other questions
- Topic: loop structure
- Replies: 3
- Views: 8219
Re: loop structure
You are creating a single file because your file creation is happening once, outside of the for loop. If you look at the Python example, you'll see I'm creating a new file every time with a different filename based on the trial number (trial0.csv, trial1.csv, trial2.csv, ...) You can generate filena...
- Sat May 23, 2020 12:22 pm
- Forum: Other questions
- Topic: loop structure
- Replies: 3
- Views: 8219
Re: loop structure
Python, HOC, and most programming languages use a for loop to run the same code a fixed number of times. e.g. in Python, we'd write for trial in range(100): # do stuff here and in HOC, we might write: for (trial = 0; trial < 100; trial += 1) { // do stuff here } NEURON provides the h.Random (or just...
- Fri May 22, 2020 8:32 pm
- Forum: UNIX/Linux
- Topic: help installing on WSL
- Replies: 1
- Views: 13506
Re: help installing on WSL
Simple work-around: don't compile NEURON yourself. :) BMTK supports all the way back to NEURON 7.4 which is almost 5 years old, and any guidance you're seeing about issues with NEURON and Anaconda (which we now explicitly suggest using in the NEURON quickstart guide ) pertains to old versions of NEU...
- Tue May 12, 2020 1:06 pm
- Forum: NEURON + Python
- Topic: range morphology and mechanism syntax for sections in python
- Replies: 9
- Views: 5874
Re: range morphology and mechanism syntax for sections in python
Oof. My mistake. Ted is right, of course. The key thing I was missing is that the values should be set based on the position of the center of the segment, which means that they must be strictly inside the interval specified. I was effectively interpolating from the center of the first segment to the...
- Tue May 12, 2020 9:08 am
- Forum: NEURON + Python
- Topic: range morphology and mechanism syntax for sections in python
- Replies: 9
- Views: 5874
Re: range morphology and mechanism syntax for sections in python
You'd have to do it with a for loop. Here's a generic function that does this for you: def range_assignment(sec, var, start, stop): """linearly assign values between start and stop to each segment.var in section""" import numpy as np for seg, val in zip(sec, np.linspace...
- Fri May 08, 2020 5:02 pm
- Forum: Other tools
- Topic: convergence failed repeatedly or with |h|=hmin : err=-7
- Replies: 1
- Views: 28191
Re: convergence failed repeatedly or with |h|=hmin : err=-7
The integration advance failed, even when it tried using a really tiny timestep. One possible cause of this is when some of your state variables have found themselves in an invalid place. You could try reducing the atol to see if that helps, because it'll force the system to more carefully track val...
- Wed Apr 29, 2020 6:01 pm
- Forum: Adding new mechanisms and functions to NEURON
- Topic: using compiled mod files from python script in a different direcory
- Replies: 2
- Views: 11058
Re: using compiled mod files from python script in a different direcory
When you run nrnivmodl on macOS (and I assume Linux, but I didn't check), it puts the compiled version of the mod files in the x86_64/.libs/libnrnmech.so file. (You won't see this if you just do an "ls" because macOS and Linux hide file and folder names beginning with a . by default but yo...
- Thu Apr 09, 2020 12:31 am
- Forum: The GUI
- Topic: PlotShape colormap
- Replies: 1
- Views: 9162
Re: PlotShape colormap
The documentation says that colormaps are local by default. If they're not, maybe you could try explicitly setting/unsetting the global flag when you define the size of your colormap before setting its values. For what it's worth, you can change the default colormap for all of your plotshapes by edi...
- Thu Apr 09, 2020 12:13 am
- Forum: NEURON + Python
- Topic: Record from multiple neurons
- Replies: 2
- Views: 2853
Re: Record from multiple neurons
The basic sequence is to: (1) for each location, create a vector and do the record; (2) finitialize (this is done automatically if you use run() (h.run() in Python)); (3) simulate for some time; then (4) store the results as you wish. With respect to (1), you are only ever creating a single vector. ...
- Tue Apr 07, 2020 7:45 am
- Forum: OS X
- Topic: NRNGUI not working from command line after switch to zsh
- Replies: 10
- Views: 21443
Re: NRNGUI not working from command line after switch to zsh
No.
nrngui is actually a script that begins by loading the compiled mod files (that's the x86_64/special file), if any, before giving you a prompt.
nrngui is actually a script that begins by loading the compiled mod files (that's the x86_64/special file), if any, before giving you a prompt.
- Sat Apr 04, 2020 4:55 pm
- Forum: NEURON + Python
- Topic: Copy a nrn object in Python?
- Replies: 5
- Views: 3727
Re: Copy a nrn object in Python?
Here's a simple example of using os.fork() to do the first part of a simulation once and then explore two different options; this launches a new process not a new thread, so the GIL does not apply: from neuron import h from neuron.units import ms, mV import matplotlib.pyplot as plt import os h.load_...
- Fri Apr 03, 2020 5:56 pm
- Forum: NEURON + Python
- Topic: Copy a nrn object in Python?
- Replies: 5
- Views: 3727
Re: Copy a nrn object in Python?
If you're running a single process simulation on Linux or Mac, an alternative strategy is to just do an os.fork() once everything has been run for however long, and have each fork test a different variant afterwards. e.g. You might simulate for a 1000 * ms, then os.fork(), then in one fork simulate ...
- Thu Apr 02, 2020 9:47 am
- Forum: NEURON + Python
- Topic: NetStim and NetCon
- Replies: 3
- Views: 3380
Re: NetStim and NetCon
Yes. If you're specifying each cell's inputs separately, as Ted pointed out, you can use VecStim (defined in vecevent.mod , which you'd have to include in your model and compile like any other mod file). Here's an example, showing three inputs, two of which are able to cause a spike, one of which oc...
- Wed Apr 01, 2020 2:09 pm
- Forum: OS X
- Topic: NRNGUI not working from command line after switch to zsh
- Replies: 10
- Views: 21443
Re: NRNGUI not working from command line after switch to zsh
Looks like you need to recompile the mod files. It remembers the version of NEURON that was used to compile things.