Skip to content

Commit b190b5c

Browse files
committed
More ruff formatting
1 parent 7ca7f5d commit b190b5c

File tree

10 files changed

+10708
-5962
lines changed

10 files changed

+10708
-5962
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@ jobs:
1818

1919
steps:
2020
- uses: actions/checkout@v4
21+
2122
- name: Set up Python ${{ matrix.python-version }}
2223
uses: actions/setup-python@v5
2324
with:
2425
python-version: ${{ matrix.python-version }}
26+
2527
- name: Install OMV
2628
run: |
2729
pip install git+https://github.com/OpenSourceBrain/osb-model-validation
@@ -30,6 +32,7 @@ jobs:
3032
- name: Run OMV tests on engine ${{ matrix.engine }}
3133
run: |
3234
omv all -V --engine=${{ matrix.engine }}
35+
3336
- name: OMV final version info
3437
run: |
3538
omv list -V # list installed engines

.github/workflows/non_omv.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,17 @@ jobs:
1717

1818
steps:
1919
- uses: actions/checkout@v4
20+
2021
- name: Set up Python ${{ matrix.python-version }}
2122
uses: actions/setup-python@v5
2223
with:
2324
python-version: ${{ matrix.python-version }}
25+
2426
- name: Install OpenCortex
2527
run: |
2628
pip install .
29+
pip install ruff
30+
2731
- name: Run some examples
2832
run: |
2933
echo "Running non OMV tests..."

examples/neuromllite/SimpleNet.py

Lines changed: 42 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,76 @@
1-
from neuromllite import Network, Cell, InputSource, Population, Synapse, RectangularRegion, RandomLayout
1+
from neuromllite import (
2+
Network,
3+
Cell,
4+
InputSource,
5+
Population,
6+
Synapse,
7+
RectangularRegion,
8+
RandomLayout,
9+
)
210
from neuromllite import Projection, RandomConnectivity, Input, Simulation
311
from neuromllite.NetworkGenerator import generate_and_run
412
import sys
513

614
################################################################################
715
### Build new network
816

9-
net = Network(id='SimpleNet')
10-
net.notes = 'Simple network with single population'
17+
net = Network(id="SimpleNet")
18+
net.notes = "Simple network with single population"
1119
net.temperature = 32.0
1220

13-
cell = Cell(id='RS', neuroml2_source_file='../../NeuroML2/prototypes/izhikevich/RS.cell.nml')
21+
cell = Cell(
22+
id="RS", neuroml2_source_file="../../NeuroML2/prototypes/izhikevich/RS.cell.nml"
23+
)
1424
net.cells.append(cell)
1525

16-
syn = Synapse(id='ampa', neuroml2_source_file='../../NeuroML2/prototypes/synapses/ampa.synapse.nml')
26+
syn = Synapse(
27+
id="ampa",
28+
neuroml2_source_file="../../NeuroML2/prototypes/synapses/ampa.synapse.nml",
29+
)
1730
net.synapses.append(syn)
1831

19-
input_source = InputSource(id='poissonFiringSyn',
20-
neuroml2_input='poissonFiringSynapse',
21-
parameters={'average_rate':"50Hz", 'synapse':syn.id, 'spike_target':"./ampa"})
32+
input_source = InputSource(
33+
id="poissonFiringSyn",
34+
neuroml2_input="poissonFiringSynapse",
35+
parameters={"average_rate": "50Hz", "synapse": syn.id, "spike_target": "./ampa"},
36+
)
2237
net.input_sources.append(input_source)
2338

24-
r1 = RectangularRegion(id='region1', x=0,y=0,z=0,width=100,height=100,depth=100)
39+
r1 = RectangularRegion(id="region1", x=0, y=0, z=0, width=100, height=100, depth=100)
2540
net.regions.append(r1)
2641

27-
p0 = Population(id='RS_pop', size=3, component=cell.id, properties={'color':'0 .8 0'},random_layout = RandomLayout(region=r1.id))
42+
p0 = Population(
43+
id="RS_pop",
44+
size=3,
45+
component=cell.id,
46+
properties={"color": "0 .8 0"},
47+
random_layout=RandomLayout(region=r1.id),
48+
)
2849

2950
net.populations.append(p0)
3051

31-
net.inputs.append(Input(id='Stim0',
32-
input_source=input_source.id,
33-
population=p0.id,
34-
percentage=100))
52+
net.inputs.append(
53+
Input(id="Stim0", input_source=input_source.id, population=p0.id, percentage=100)
54+
)
3555

3656
print(net.to_json())
37-
new_file = net.to_json_file('%s.json'%net.id)
57+
new_file = net.to_json_file("%s.json" % net.id)
3858

3959

4060
################################################################################
4161
### Build Simulation object & save as JSON
4262

43-
sim = Simulation(id='SimSimpleNet',
44-
network=new_file,
45-
duration='1000',
46-
dt='0.025',
47-
record_traces={'all':'*'})
63+
sim = Simulation(
64+
id="SimSimpleNet",
65+
network=new_file,
66+
duration="1000",
67+
dt="0.025",
68+
record_traces={"all": "*"},
69+
)
4870

4971
sim.to_json_file()
5072

5173

52-
5374
################################################################################
5475
### Run in some simulators
5576

0 commit comments

Comments
 (0)