Skip to content

Commit

Permalink
Merge pull request #27 from OpenSourceBrain/dev_pg
Browse files Browse the repository at this point in the history
Dev pg
  • Loading branch information
JessyD authored Jul 13, 2019
2 parents c549d17 + 086b615 commit 71b06f7
Show file tree
Hide file tree
Showing 31 changed files with 44,904 additions and 223 deletions.
12 changes: 10 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ NeuroML2/*mod
NeuroML2/*nrn.py
NeuroML2/*dat
NeuroML2/*gv*
NeuroML2/*json
NeuroML2/x86_64

NeuroML2/LEMS_SimMejiasFig2.xml
NeuroML2/MERetal14_on_F99.tsv
NeuroML2/MejiasFig2.net.nml
NeuroML2/Neuron_2015_Table.csv
NeuroML2/report.*.txt
Expand Down Expand Up @@ -38,3 +36,13 @@ Matlab/*.png
/NeuroML2/subgraphData30.mat
/NeuroML2/clean.sh
/NeuroML2/*.pov
/NeuroML2/*.ini
/NeuroML2/LEMS_SimInterareal_0.xml
/NeuroML2/LEMS_SimInterareal_3_0.xml
/NeuroML2/*.pov-state
/tests.log
/NeuroML2/main.py
/NeuroML2/results
/NeuroML2/temp
/NeuroML2/SimMejiasFig2_0.json
/NeuroML2/MejiasFig2.json
18 changes: 14 additions & 4 deletions NeuroML2/GenerateNetwork.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
import random


def hex_to_pop_color(hex):

r = int('0x%s'%hex[0:2],16)/255.
g = int('0x%s'%hex[2:4],16)/255.
b = int('0x%s'%hex[4:],16)/255.
c = '%s %s %s'%(r,g,b)
print('%s -> %s'%(hex, c))
return c


def generate(wee = 1.5, wei = -3.25, wie = 3.5, wii = -2.5, interlaminar1=0,
interlaminar2=0, sigma23=.3, sigma56=.45,
Expand All @@ -23,7 +32,7 @@ def generate(wee = 1.5, wei = -3.25, wie = 3.5, wii = -2.5, interlaminar1=0,
################################################################################
### Build a new network

net = Network(id='MejiasNetwork')
net = Network(id='TestNetwork')
net.notes = "...."
net.parameters = {}

Expand Down Expand Up @@ -102,12 +111,13 @@ def generate(wee = 1.5, wei = -3.25, wie = 3.5, wii = -2.5, interlaminar1=0,

r = RectangularRegion(id='Region_%s'%used_ids[pop_id], x=p[0],y=p[1],z=p[2],width=1,height=1,depth=1)
net.regions.append(r)

color_hex = colors[repl]
p0 = Population(id=used_ids[pop_id],
size=1,
component=l23ecell.id,
properties={'color':'%s %s %s'%(random.random(),random.random(),random.random()),
'radius':scale},
properties={'color':hex_to_pop_color(color_hex),
'radius':scale,
'color_hex':color_hex},
random_layout = RandomLayout(region=r.id))

net.populations.append(p0)
Expand Down
Loading

0 comments on commit 71b06f7

Please sign in to comment.