Search found 269 matches

by ramcdougal
Wed Sep 11, 2024 12:32 pm
Forum: NEURON + Python
Topic: Type annotation of NEURON objects
Replies: 3
Views: 2126

Re: Type annotation of NEURON objects

@urid's advice is good. The development version (on linux: pip install neuron-nightly) provides types (and thus allows type annotation) for the different types of NEURON objects; e.g.: >>> import neuron >>> neuron.__version__ '9.0a-336-g8e3de3305+' >>> from neuron import h, hoc >>> vec = h.Vector() ...
by ramcdougal
Mon Aug 12, 2024 10:05 pm
Forum: NEURON + Python
Topic: h.frecord_init() and Python Multiprocessing
Replies: 7
Views: 2692

Re: h.frecord_init() and Python Multiprocessing

I think your hypothesis is correct: apply_async does a task in parallel with whatever happens after that, which in your case is to reset the recording vectors. as_numpy is a O(1) method because all it does is create a new data structure referring to the same memory locations as the Vector. Effective...
by ramcdougal
Tue Feb 20, 2024 3:33 pm
Forum: OS X
Topic: can't open DISPLAY
Replies: 14
Views: 13840

Re: can't open DISPLAY

I'm not saying you should do this, but just to double-check, do NEURON's graphics work when NEURON is launched from an xterminal?
by ramcdougal
Tue Feb 20, 2024 12:23 pm
Forum: OS X
Topic: can't open DISPLAY
Replies: 14
Views: 13840

Re: can't open DISPLAY

Do any other X11 applications work?

e.g. what happens if you run "xeyes" from the terminal?
by ramcdougal
Fri Oct 27, 2023 11:11 am
Forum: Employment and educational opportunities
Topic: Postdoctoral position in computational neuroscience methods (NEURON simulator)
Replies: 0
Views: 241399

Postdoctoral position in computational neuroscience methods (NEURON simulator)

The McDougal lab at Yale University seeks one or two highly motivated Postdoctoral Associates to advance the frontiers of neuroscience simulation. In addition to papers, etc, this work will be shared with the community in the form of enhancements to the NEURON simulator. Related lab projects include...
by ramcdougal
Sun Oct 01, 2023 2:01 pm
Forum: NEURON + Python
Topic: Different total area from python and hoc cell class
Replies: 5
Views: 22274

Re: Different total area from python and hoc cell class

tl;dr: a difference of this magnitude is expected and should not meaningfully change your results. The Python version is ever so slightly more accurate. There is a subtle difference in the implementation between HOC and Python that can create these tiny differences (here less than 0.001 µm^2): In HO...
by ramcdougal
Sun Sep 03, 2023 4:36 pm
Forum: Anatomically detailed models
Topic: Voltage gradient and color scale in anatomically detailed model in Python
Replies: 1
Views: 23268

Re: Voltage gradient and color scale in anatomically detailed model in Python

The trick here is that calling ps.plot(plotly) returns a go.Figure. And then anything you can do with regular plotly graphs, you can do with that... I don't particularly like the below solution, but one way is to create a hidden 2D graph that has a colorbar: A full, working example is at: https://co...
by ramcdougal
Sun Sep 03, 2023 3:48 pm
Forum: Reaction-diffusion in NEURON
Topic: Setting ion specifications in rxd leads to region overlap error
Replies: 2
Views: 25745

Re: Setting ion specifications in rxd leads to region overlap error

Perhaps there was a Python session where code was ran and then those lines were reran in the same session?

If you run as a script or just restart your session everything should just work.

For parameter sweeps, the model doesn't need to be redefined each time, only the parameter needs to be changed.
by ramcdougal
Tue Aug 22, 2023 6:44 pm
Forum: MSWin
Topic: MSWin11 + Anaconda, Neuron 8.2.2
Replies: 6
Views: 28642

Re: MSWin11 + Anaconda, Neuron 8.2.2

For what it's worth, I always use a regular windows terminal (cmd) and not bash on Windows.

Bash is historically more of a linux/mac thing.
by ramcdougal
Mon Aug 07, 2023 5:28 pm
Forum: Adding new mechanisms and functions to NEURON
Topic: NMODL code no longer works in version 8.2
Replies: 7
Views: 27457

Re: NMODL code no longer works in version 8.2

I think the main issue you're running into here is that NEURON is trying to be too helpful. You're getting a bunch of "conflicting types" errors because some things are now available directly to NMODL without needing a VERBATIM declaration. What happens if you simply remove the three exter...
by ramcdougal
Fri Jul 28, 2023 10:43 am
Forum: NEURON + Python
Topic: Play a Unique Vector to Each Model Segment
Replies: 1
Views: 22350

Re: Play a Unique Vector to Each Model Segment

Whenever recording a variable or playing into a variable, you must use a pointer ; that is, play into seg.playtest._ref_xx not into .xx . To store different values of xx at different locations, you must declare xx as a RANGE. (If you use GLOBAL, it is the same at all locations.) (POINTERs do not loc...
by ramcdougal
Thu Jun 29, 2023 3:02 pm
Forum: NEURON + Python
Topic: Gap junction network not seeming to conduct
Replies: 3
Views: 23906

Re: Gap junction network not seeming to conduct

Note that vgap in your mod file is supposed to be the voltage of the OTHER half of the gap junction... but here, all the fromCenters are on cones[0] and the other side is also set to be cones[0], so your vgap and v are the same, hence no current flow. Likewise for toCenter. That is, change it to: ga...
by ramcdougal
Thu Jun 29, 2023 11:05 am
Forum: Adding new mechanisms and functions to NEURON
Topic: NameError: Name Not Defined for Distributed Mechanism
Replies: 3
Views: 19517

Re: NameError: Name Not Defined for Distributed Mechanism

@AMaxion's approach works, but for the record, the original was also correct except that it was missing a leading h. . That is, you can do any of the following: h.mathews_KLVA.insert(axon) axon.insert(h.mathews_KLVA) axon.insert('mathews_KLVA') Personally, I like the first one because you can insert...
by ramcdougal
Thu Jun 29, 2023 10:54 am
Forum: NEURON + Python
Topic: h.continuerun() behavior different when cvode is active
Replies: 2
Views: 22950

Re: h.continuerun() behavior different when cvode is active

Anytime you change something in a CVode simulation after initialization, you must run: h.CVode().re_init() to let CVode know. This is true for both time and state variables. from neuron import h h.load_file("stdrun.hoc") soma = h.Section("soma") t = h.Vector().record(h._ref_t) h....
by ramcdougal
Thu Jun 29, 2023 10:39 am
Forum: NEURON + Python
Topic: Unable to access current attribute.
Replies: 1
Views: 22294

Re: Unable to access current attribute.

Double check that the na12 mechanism was inserted in that section. (You can test with e.g. h.cell.soma[0].psection() ) Assuming it has been inserted, then you should be able to access it via either h.cell.soma[0](0.5).na12.ina_ina or h.cell.soma[0]soma(0.5).ina_ina_na12 . I prefer the first way beca...