Giter Site home page Giter Site logo

projectpyrho / pyrho Goto Github PK

View Code? Open in Web Editor NEW
34.0 3.0 7.0 3.89 MB

A virtual optogenetics laboratory

License: BSD 3-Clause "New" or "Revised" License

Jupyter Notebook 1.61% Python 90.04% AMPL 5.18% Shell 2.86% Dockerfile 0.30%
python optogenetics opsin jupyter-widget computational-neuroscience neuron brian2 neuroscience brain brainweb

pyrho's People

Contributors

apdavison avatar bdevans avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pyrho's Issues

Error while running modified example

Hello:-)

Thank you for a nice software package!

I tried to modify the code from the example notebook for my purposes but I get the following error:

BrianObjectException: Error encountered with object named "statemonitor_3".
Object was created here (most recent call only, full details in debug log):
File "", line 35, in
monitors={'states' : StateMonitor(neuron_rho, RhO.brianStateVars, record=0), 'I': StateMonitor(neuron_rho, 'I', record=0), # Record current

Here's my code

from brian2 import *
start=time.time()
defaultclock.dt = 0.1*ms
tau = 10*ms
vr = -70*mV
vt = -60*mV
eqs = '''
dv/dt = I_ampa/Cm : volt
I_ampa=-g_ext_ampa*s_ext*(v-E_ampa) : amp
ds_ext/dt=-s_ext/t_ampa : 1
'''
eqs_rho = '''
dv/dt = I_ampa/Cm +((-I*R_m)+E_m-v)/tau_m : volt
I_ampa=-g_ext_ampa*s_ext*(v-E_ampa) : amp
ds_ext/dt=-s_ext/t_ampa : 1
'''+ RhO.brian_phi_t
netParams = {'t_ampa':2*ms, 'Cm':0.5*nF, 'E_ampa':0.0*mV, 'g_ext_ampa':3.1*nS,'vt':-60*mV,'vr':-70*mV,'w':1,'E_m':-70*mV,'tau_m':10*ms, 'R_m':70*Mohm}
E_ampa=0.0*mV
neuron = NeuronGroup(100, eqs, threshold='v>vt', reset='v=vr')
neuron_rho=NeuronGroup(100,eqs_rho,threshold='v>vt',reset='v=vr',name='Inputs')
neuron.v = -10*mV
neuron.s_ext = 0
spikes_gen=SpikeGeneratorGroup(1000,list(cell_identity),spikes*1000*ms)
w = 1
S = Synapses(spikes_gen, neuron, on_pre='s_ext += w')
S.connect(p=0.1)
S = Synapses(spikes_gen, neuron_rho, on_pre='s_ext += w')
S.connect(p=0.1)
S = Synapses(neuron_rho, neuron, on_pre='s_ext += w')
S.connect(p=0.5)
# Record the spikes
Mgp = SpikeMonitor(neuron)
Mgp_rho = SpikeMonitor(neuron_rho)
Minput = SpikeMonitor(spikes_gen)
monitors={'states' : StateMonitor(neuron_rho, RhO.brianStateVars, record=0), 'I': StateMonitor(neuron_rho, 'I', record=0),                  # Record current
            'spikes':[Mgp,Mgp_rho,Minput]}
import time
start=time.time()
import brian2 as br
net = br.Network(br.collect())
net.add(monitors.values())
Sim = simulators['Brian'](Prot, RhO, simParams['Brian'], net, netParams, monitors)
Sim.run()
Sim.plot()
end=time.time()
print(end-start)

Any help would be appreciated! No idea really what's going on!

All the very best,
Maria

Spines and ticks are not drawn properly

This affects all photocurrent plots with centred axes except rectifier.
Either the ylims are not set properly (when max(pc.I) == 0) or the left (y-axis) spines and ticks are not drawn up to ymax.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.