Skip to content

Commit 722eb32

Browse files
committed
Formatted with black
1 parent dcf0c2f commit 722eb32

35 files changed

Lines changed: 427 additions & 532 deletions

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
# space here is important since __version__ is used in generation of
5454
# version_info also
5555
if "__version__ =" in aline:
56-
version = aline.split("\"")[1]
56+
version = aline.split('"')[1]
5757
# The full version, including alpha/beta/rc tags.
5858
release = version
5959

docs/generate.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33

44
if __name__ == "__main__":
5-
65
net = neuromllite.Network(id="net")
76
doc = net.generate_documentation(format="markdown")
87
print(doc)

examples/Example12.py

Lines changed: 37 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
from neuromllite import Network, Cell, InputSource, Population, Synapse
2-
from neuromllite import Projection, RandomConnectivity, Input, Simulation, RectangularRegion, RandomLayout
2+
from neuromllite import (
3+
Projection,
4+
RandomConnectivity,
5+
Input,
6+
Simulation,
7+
RectangularRegion,
8+
RandomLayout,
9+
)
310
import sys
411

512
################################################################################
@@ -11,21 +18,23 @@
1118
net.seed = 1234
1219
net.temperature = 32.0
1320

14-
net.parameters = {"N": 20,
15-
"fractionE": 0.7,
16-
"weightInput": 0.7,
17-
"prob_e_e": 0.1,
18-
"prob_e_i": 0.9,
19-
"prob_i_e": 0.8,
20-
"prob_i_i": 0.3,
21-
"global_delay": 2}
22-
23-
r1 = RectangularRegion(
24-
id="region1", x=0, y=0, z=0, width=1000, height=100, depth=1000
25-
)
21+
net.parameters = {
22+
"N": 20,
23+
"fractionE": 0.7,
24+
"weightInput": 0.7,
25+
"prob_e_e": 0.1,
26+
"prob_e_i": 0.9,
27+
"prob_i_e": 0.8,
28+
"prob_i_i": 0.3,
29+
"global_delay": 2,
30+
}
31+
32+
r1 = RectangularRegion(id="region1", x=0, y=0, z=0, width=1000, height=100, depth=1000)
2633
net.regions.append(r1)
2734

28-
pyr_cell = Cell(id="pyr_4_sym", neuroml2_source_file="test_files/acnet2/pyr_4_sym.cell.nml")
35+
pyr_cell = Cell(
36+
id="pyr_4_sym", neuroml2_source_file="test_files/acnet2/pyr_4_sym.cell.nml"
37+
)
2938
net.cells.append(pyr_cell)
3039
bask_cell = Cell(id="bask", neuroml2_source_file="test_files/acnet2/bask.cell.nml")
3140
net.cells.append(bask_cell)
@@ -61,17 +70,24 @@
6170
net.populations.append(pE)
6271
net.populations.append(pI)
6372

64-
syn_e_e = Synapse(id="AMPA_syn", neuroml2_source_file="test_files/acnet2/AMPA_syn.synapse.nml")
73+
syn_e_e = Synapse(
74+
id="AMPA_syn", neuroml2_source_file="test_files/acnet2/AMPA_syn.synapse.nml"
75+
)
6576
net.synapses.append(syn_e_e)
66-
syn_e_i = Synapse(id="AMPA_syn_inh", neuroml2_source_file="test_files/acnet2/AMPA_syn_inh.synapse.nml")
77+
syn_e_i = Synapse(
78+
id="AMPA_syn_inh", neuroml2_source_file="test_files/acnet2/AMPA_syn_inh.synapse.nml"
79+
)
6780
net.synapses.append(syn_e_i)
68-
syn_i_e = Synapse(id="GABA_syn", neuroml2_source_file="test_files/acnet2/GABA_syn.synapse.nml")
81+
syn_i_e = Synapse(
82+
id="GABA_syn", neuroml2_source_file="test_files/acnet2/GABA_syn.synapse.nml"
83+
)
6984
net.synapses.append(syn_i_e)
70-
syn_i_i = Synapse(id="GABA_syn_inh", neuroml2_source_file="test_files/acnet2/GABA_syn_inh.synapse.nml")
85+
syn_i_i = Synapse(
86+
id="GABA_syn_inh", neuroml2_source_file="test_files/acnet2/GABA_syn_inh.synapse.nml"
87+
)
7188
net.synapses.append(syn_i_i)
7289

7390

74-
7591
net.projections.append(
7692
Projection(
7793
id="projEE",
@@ -94,7 +110,6 @@
94110
)
95111

96112

97-
98113
net.projections.append(
99114
Projection(
100115
id="projIE",
@@ -136,7 +151,7 @@
136151
### Build Simulation object & save as JSON
137152

138153
sim = Simulation(
139-
id="Sim%s"%net.id,
154+
id="Sim%s" % net.id,
140155
network=new_file,
141156
duration="1000",
142157
seed="1111",
@@ -145,7 +160,7 @@
145160
record_spikes={
146161
pE.id: "*",
147162
pI.id: "*",
148-
}
163+
},
149164
)
150165

151166
sim.to_json_file()

examples/Example4.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@
125125

126126
sim.to_json_file()
127127
sim.network = net_yaml_file
128-
sim.to_yaml_file('%s.yaml'%sim.id)
128+
sim.to_yaml_file("%s.yaml" % sim.id)
129129

130130
sim.network = net_json_file # reverting, for call below...
131131

examples/Example6.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77

88
def generate(ref="Example6_PyNN", add_inputs=True):
9-
109
################################################################################
1110
### Build new network
1211

@@ -69,7 +68,6 @@ def generate(ref="Example6_PyNN", add_inputs=True):
6968
layers = ["L23", "L4", "L5", "L6"]
7069

7170
for l in layers:
72-
7371
i = 3 - layers.index(l)
7472
r = RectangularRegion(
7573
id=l,
@@ -83,7 +81,6 @@ def generate(ref="Example6_PyNN", add_inputs=True):
8381
net.regions.append(r)
8482

8583
for t in ["E", "I"]:
86-
8784
try:
8885
import opencortex.utils.color as occ
8986

@@ -223,7 +220,6 @@ def generate(ref="Example6_PyNN", add_inputs=True):
223220

224221

225222
if __name__ == "__main__":
226-
227223
if "-noinputs" in sys.argv:
228224
sim, net = generate("Example6_PyNN_noinputs", False)
229225
else:

examples/Example7.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515

1616
def generate():
17-
1817
dt = 0.025
1918
simtime = 1000
2019

@@ -228,9 +227,7 @@ def generate():
228227

229228

230229
if __name__ == "__main__":
231-
232230
if "-sweep" in sys.argv:
233-
234231
from neuromllite.sweep.ParameterSweep import *
235232

236233
sim, net = generate()
@@ -298,7 +295,6 @@ def generate():
298295
plt.show()
299296

300297
if "-sweep2" in sys.argv:
301-
302298
sim, net = generate()
303299
sim.record_traces = {}
304300

@@ -372,7 +368,6 @@ def generate():
372368
plt.show()
373369

374370
else:
375-
376371
sim, net = generate()
377372

378373
################################################################################

examples/arbor/ArborExample.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103

104104
net.projections[0].random_connectivity = RandomConnectivity(probability=0.5)
105105

106-
'''
106+
"""
107107
net.synapses.append(Synapse(id='gabaSyn',
108108
pynn_receptor_type='inhibitory',
109109
pynn_synapse_type='cond_alpha',
@@ -116,10 +116,10 @@
116116
synapse='gabaSyn',
117117
delay=2,
118118
weight=0.01))
119-
net.projections[1].random_connectivity=RandomConnectivity(probability=1)'''
119+
net.projections[1].random_connectivity=RandomConnectivity(probability=1)"""
120120

121121
net.inputs.append(
122-
Input(id="stim", input_source=input_source.id, population=p0.id, cell_ids=[1,2])
122+
Input(id="stim", input_source=input_source.id, population=p0.id, cell_ids=[1, 2])
123123
)
124124

125125
print(net.to_json())
@@ -141,7 +141,7 @@
141141

142142
sim.to_json_file()
143143
sim.network = new_file_yaml
144-
sim.to_yaml_file('%s.yaml'%sim.id)
144+
sim.to_yaml_file("%s.yaml" % sim.id)
145145

146146

147147
################################################################################

examples/sonatatest/analyze_output.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from analyze_output_utils import plot_data
66

77
if __name__ == "__main__":
8-
98
plot_data(
109
"output/membrane_potential.h5", "mV", "Membrane Potential", show_already=True
1110
)

examples/sonatatest/analyze_output_utils.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ def plot_data(reports_file, y_axis, title, show_already=True, max_num_traces=Non
1616
pop_prefixes = {pop: "/report/%s/" % pop}
1717

1818
for pop in pop_prefixes:
19-
2019
gids = np.array(cellvar_h5["%smapping/gids" % pop_prefixes[pop]])
2120

2221
soma_locs = np.array(

examples/sonatatest/run_bmtk.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55

66
def run(config_file, simulator):
7-
87
if simulator == "NEURON":
98
from bmtk.simulator import bionet
109

@@ -25,5 +24,4 @@ def run(config_file, simulator):
2524

2625

2726
if __name__ == "__main__":
28-
2927
run("config.json", "NEST")

0 commit comments

Comments
 (0)