Search found 207 matches

by ramcdougal
Mon Jun 01, 2020 1:44 pm
Forum: OS X
Topic: Syntax Warning
Replies: 1
Views: 31

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...
by ramcdougal
Mon Jun 01, 2020 1:35 pm
Forum: Other questions
Topic: loop structure
Replies: 3
Views: 77

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...
by ramcdougal
Sat May 23, 2020 12:22 pm
Forum: Other questions
Topic: loop structure
Replies: 3
Views: 77

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...
by ramcdougal
Fri May 22, 2020 8:32 pm
Forum: UNIX/Linux
Topic: help installing on WSL
Replies: 1
Views: 66

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...
by ramcdougal
Tue May 12, 2020 1:06 pm
Forum: NEURON + Python
Topic: range morphology and mechanism syntax for sections in python
Replies: 9
Views: 298

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...
by ramcdougal
Tue May 12, 2020 9:08 am
Forum: NEURON + Python
Topic: range morphology and mechanism syntax for sections in python
Replies: 9
Views: 298

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(start, stop, sec.nseg)): seta...
by ramcdougal
Fri May 08, 2020 5:02 pm
Forum: Other tools
Topic: convergence failed repeatedly or with |h|=hmin : err=-7
Replies: 1
Views: 144

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...
by ramcdougal
Wed Apr 29, 2020 6:01 pm
Forum: NEURON + Python
Topic: using compiled mod files from python script in a different direcory
Replies: 2
Views: 257

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 you can see ...
by ramcdougal
Thu Apr 09, 2020 12:31 am
Forum: The GUI
Topic: PlotShape colormap
Replies: 1
Views: 480

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...
by ramcdougal
Thu Apr 09, 2020 12:13 am
Forum: NEURON + Python
Topic: Record from multiple neurons
Replies: 2
Views: 315

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. ...
by ramcdougal
Tue Apr 07, 2020 7:45 am
Forum: OS X
Topic: NRNGUI not working from command line after switch to zsh
Replies: 10
Views: 912

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.
by ramcdougal
Sat Apr 04, 2020 4:55 pm
Forum: NEURON + Python
Topic: Copy a nrn object in Python?
Replies: 5
Views: 482

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_...
by ramcdougal
Fri Apr 03, 2020 5:56 pm
Forum: NEURON + Python
Topic: Copy a nrn object in Python?
Replies: 5
Views: 482

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 ...
by ramcdougal
Thu Apr 02, 2020 9:47 am
Forum: NEURON + Python
Topic: NetStim and NetCon
Replies: 3
Views: 478

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...
by ramcdougal
Wed Apr 01, 2020 2:09 pm
Forum: OS X
Topic: NRNGUI not working from command line after switch to zsh
Replies: 10
Views: 912

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.