Skip to content

Commit

Permalink
Make sure all examples work
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcel Stimberg committed Jul 22, 2013
1 parent e3577f2 commit 1a93613
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 8 deletions.
8 changes: 3 additions & 5 deletions examples/I-F_curve_Hodgkin_Huxley.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@

BrianLogger.log_level_info()

language = PythonLanguage()
#language = CPPLanguage()
#brian_prefs.codegen.target = 'weave'

N = 100

Expand All @@ -38,9 +37,8 @@
I : amp
''')
# Threshold and refractoriness are only used for spike counting
group = NeuronGroup(N, model=eqs, threshold='is_active * (v > -40*mV)',
language=language)
group.refractory = 1*ms
group = NeuronGroup(N, model=eqs, threshold='not_refractory and (v > -40*mV)',
refractory='v > -40*mV')
group.v = El
group.I = linspace(0 * nA, 0.7 * nA, N)

Expand Down
2 changes: 2 additions & 0 deletions examples/I-F_curve_LIF.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
from pylab import *
from brian2 import *

#brian_prefs.codegen.target = 'weave'

N = 1000
tau = 10 * ms
eqs = '''
Expand Down
2 changes: 2 additions & 0 deletions examples/non_reliability.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
from pylab import *
from brian2 import *

#brian_prefs.codegen.target = 'weave'

N = 25
tau = 20 * ms
sigma = .015
Expand Down
2 changes: 2 additions & 0 deletions examples/phase_locking.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
from pylab import *
from brian2 import *

#brian_prefs.codegen.target = 'weave'

tau = 20 * ms
N = 100
b = 1.2 # constant current mean, the modulation varies
Expand Down
3 changes: 2 additions & 1 deletion examples/synapses.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import numpy as np
import matplotlib.pyplot as plt

from brian2 import *

#brian_prefs.codegen.target = 'weave'

G1 = NeuronGroup(10, 'dv/dt = -v / (10*ms) : 1',
threshold='v > 1',
reset='v=0.')
Expand Down
2 changes: 2 additions & 0 deletions examples/synapses_STDP.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
import matplotlib.pyplot as plt
from time import time

#brian_prefs.codegen.target = 'weave'

N = 1000
taum = 10 * ms
taupre = 20 * ms
Expand Down
2 changes: 2 additions & 0 deletions examples/synapses_gapjunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

from brian2 import *

#brian_prefs.codegen.target = 'weave'

N = 10
v0 = 1.05
tau = 10*ms
Expand Down
6 changes: 4 additions & 2 deletions examples/synapses_licklider.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@
from pylab import *
from brian2 import *

#brian_prefs.codegen.target = 'weave'

defaultclock.dt = .02 * ms

# Ear and sound
max_delay = 20 * ms # 50 Hz
tau_ear = 1 * ms
sigma_ear = .1
sigma_ear = .0
eqs_ear = '''
dx/dt=(sound-x)/tau_ear+sigma_ear*(2./tau_ear)**.5*xi : 1 (unless-refractory)
dx/dt=(sound-x)/tau_ear+0.1*(2./tau_ear)**.5*xi : 1 (unless-refractory)
sound=5*sin(2*pi*frequency*t)**3 : 1 # nonlinear distorsion
#sound=5*(sin(4*pi*frequency*t)+.5*sin(6*pi*frequency*t)) : 1 # missing fundamental
frequency=(200+200*t*Hz)*Hz : Hz # increasing pitch
Expand Down
2 changes: 2 additions & 0 deletions examples/synapses_nonlinear.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
"""
from brian2 import *

brian_prefs.codegen.target = 'weave'

a=1/(10*ms)
b=1/(10*ms)
c=1/(10*ms)
Expand Down
2 changes: 2 additions & 0 deletions examples/synapses_state_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
from brian2 import *
import numpy as np

#brian_prefs.codegen.target = 'weave'

G = NeuronGroup(100, 'v:volt')
G.v = '(sin(2*pi*i/_num_neurons) - 70 + 0.25*randn()) * mV'
S = Synapses(G, G, 'w:volt', pre='v+=w')
Expand Down

0 comments on commit 1a93613

Please sign in to comment.