Skip to content

Commit

Permalink
add test script
Browse files Browse the repository at this point in the history
  • Loading branch information
wagdy88 authored and jasmainak committed Mar 7, 2023
1 parent 473942e commit ea46e54
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 47 deletions.
47 changes: 0 additions & 47 deletions hnn_core/viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -555,53 +555,6 @@ def plot_cells(net, ax=None, show=True):
for cell_name in net.cell_types:
if cell_name not in cell_names:
cell_names.append(cell_name)
# import hnn_core
# from hnn_core import jones_2009_model, simulate_dipole
# import matplotlib as plt

# net = jones_2009_model(add_drives_from_params= True)
# params = hnn_core.read_params('/home/mohamed/Desktop/PhD Thesis/auditory_evoked_simulation/HNN-AEF-main/HNN_Parameters/L_Contra.param')

# def martinotti(n_cells):
# from hnn_core.cell import Section, Cell

# cell_name = 'martinotti'
# pos = [(5, 5, 5)] * n_cells
# # pos = net.pos_dict['L5_basket'].copy()

# end_pts = [[0, 0, 0], [0, 0, 39.]]
# soma = Section(L=39., diam=20., cm=0.85,
# Ra=200., end_pts=end_pts)
# soma.syns = ['gabaa', 'nmda']

# synapses = {
# 'gabaa': {
# 'e': -80,
# 'tau1': 0.5,
# 'tau2': 5.
# },
# 'nmda': {
# 'e': 0,
# 'tau1': 1.,
# 'tau2': 20.
# }
# }
# sect_loc = ['proximal']

# return Cell(cell_name, pos,
# sections=soma,
# synapses=synapses,
# topology=None,
# sect_loc=sect_loc,
# gid=0)

# net.plot_cells()
# net._add_cell_type('L5_martinotti', pos='L5_basket' ,cell_template = None)

# simulate_dipole(net, tstop = 100, record_vsec= 'all')

# net.add_connection(src_gids='L5_martinotti', target_gids='L5_pyramidal', loc='apical_tuft', receptor='gabaa', weight= 0.025 , delay=1.0 ,lamtha=70.0 , allow_autapses= False, probability=1)


colors= dict()
markers= dict()
Expand Down
66 changes: 66 additions & 0 deletions test_script.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import hnn_core
from hnn_core import jones_2009_model, simulate_dipole, Network
import numpy as np
import matplotlib as plt

params = hnn_core.read_params('/home/mohamed/Desktop/PhD Thesis/auditory_evoked_simulation/HNN-AEF-main/HNN_Parameters/L_Contra.param')
net = jones_2009_model()


def martinotti_template():
from hnn_core.cell import Section, Cell

cell_name = 'martinotti'
pos = (5, 5, 5)
# pos = net.pos_dict['L5_basket'].copy()

end_pts = [[0, 0, 0], [0, 0, 39.]]
sections = {'soma': Section(L=39., diam=20., cm=0.85,
Ra=200., end_pts=end_pts)}
sections['soma'].syns = ['gabaa', 'nmda']

synapses = {
'gabaa': {
'e': -80,
'tau1': 0.5,
'tau2': 5.
},
'nmda': {
'e': 0,
'tau1': 1.,
'tau2': 20.
}
}
sect_loc = dict(proximal=['soma'], distal=['soma'])

return Cell(cell_name, pos,
sections=sections,
synapses=synapses,
topology=None,
sect_loc=sect_loc,
gid=None)

x1= np.linspace(0, 7, 7)
y1= np.linspace(0, 5, 5)
xv, yv = np.meshgrid(x1, y1)
pos = list()
for (x, y) in zip(xv.ravel(), yv.ravel()):
pos.append((x, y, 0.))

# net._add_cell_type('L5_martinotti', pos= pos, cell_template=martinotti_template())
# net.plot_cells()

weights_nmda_d1 = {'L2_basket': 0.019482, 'L2_pyramidal': 0.004317,
'L5_pyramidal': 0.080074}
synaptic_delays_d1 = {'L2_basket': 0.1, 'L2_pyramidal': 0.1,
'L5_pyramidal': 0.1}
net.add_evoked_drive(
'evdist1', mu=63.53, sigma=3.85, numspikes=1, weights_ampa=None,
weights_nmda=weights_nmda_d1, location='distal',
synaptic_delays=synaptic_delays_d1, event_seed=4)

simulate_dipole(net, tstop = 100, record_vsec=False)

# net.add_connection(src_gids='L5_martinotti', target_gids='L5_pyramidal', loc='apical_tuft', receptor='gabaa', weight= 0.025 , delay=1.0 ,lamtha=70.0 , allow_autapses= False, probability=1)


0 comments on commit ea46e54

Please sign in to comment.