bluecellulab 1.8.1__py3-none-any.whl → 1.8.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of bluecellulab might be problematic. Click here for more details.
- bluecellulab/cell/core.py +20 -15
- bluecellulab/cell/injector.py +5 -5
- bluecellulab/connection.py +4 -3
- bluecellulab/graph.py +85 -0
- bluecellulab/simulation/simulation.py +1 -1
- bluecellulab/ssim.py +2 -6
- bluecellulab/synapse/synapse_factory.py +3 -3
- bluecellulab/synapse/synapse_types.py +11 -10
- {bluecellulab-1.8.1.dist-info → bluecellulab-1.8.2.dist-info}/METADATA +2 -1
- {bluecellulab-1.8.1.dist-info → bluecellulab-1.8.2.dist-info}/RECORD +14 -13
- {bluecellulab-1.8.1.dist-info → bluecellulab-1.8.2.dist-info}/AUTHORS.txt +0 -0
- {bluecellulab-1.8.1.dist-info → bluecellulab-1.8.2.dist-info}/LICENSE +0 -0
- {bluecellulab-1.8.1.dist-info → bluecellulab-1.8.2.dist-info}/WHEEL +0 -0
- {bluecellulab-1.8.1.dist-info → bluecellulab-1.8.2.dist-info}/top_level.txt +0 -0
bluecellulab/cell/core.py
CHANGED
|
@@ -51,10 +51,12 @@ logger = logging.getLogger(__name__)
|
|
|
51
51
|
class Cell(InjectableMixin, PlottableMixin):
|
|
52
52
|
"""Represents a Cell object."""
|
|
53
53
|
|
|
54
|
+
max_id = 0
|
|
55
|
+
|
|
54
56
|
def __init__(self,
|
|
55
57
|
template_path: str | Path,
|
|
56
58
|
morphology_path: str | Path,
|
|
57
|
-
|
|
59
|
+
cell_id: Optional[CellId] = None,
|
|
58
60
|
record_dt: Optional[float] = None,
|
|
59
61
|
template_format: str = "v5",
|
|
60
62
|
emodel_properties: Optional[EmodelProperties] = None,
|
|
@@ -75,6 +77,10 @@ class Cell(InjectableMixin, PlottableMixin):
|
|
|
75
77
|
object used by the Cell. Defaults to None.
|
|
76
78
|
"""
|
|
77
79
|
super().__init__()
|
|
80
|
+
if cell_id is None:
|
|
81
|
+
cell_id = CellId("", Cell.max_id)
|
|
82
|
+
Cell.max_id += 1
|
|
83
|
+
self.cell_id = cell_id
|
|
78
84
|
# Persistent objects, like clamps, that exist as long
|
|
79
85
|
# as the object exists
|
|
80
86
|
self.persistent: list[HocObjectType] = []
|
|
@@ -84,7 +90,7 @@ class Cell(InjectableMixin, PlottableMixin):
|
|
|
84
90
|
# Load the template
|
|
85
91
|
neuron_template = NeuronTemplate(template_path, morphology_path)
|
|
86
92
|
self.template_id = neuron_template.template_name # useful to map NEURON and python objects
|
|
87
|
-
self.cell = neuron_template.get_cell(template_format,
|
|
93
|
+
self.cell = neuron_template.get_cell(template_format, self.cell_id.id, emodel_properties)
|
|
88
94
|
self.soma = public_hoc_cell(self.cell).soma[0]
|
|
89
95
|
# WARNING: this finitialize 'must' be here, otherwhise the
|
|
90
96
|
# diameters of the loaded morph are wrong
|
|
@@ -93,8 +99,7 @@ class Cell(InjectableMixin, PlottableMixin):
|
|
|
93
99
|
self.cellname = neuron.h.secname(sec=self.soma).split(".")[0]
|
|
94
100
|
|
|
95
101
|
# Set the gid of the cell
|
|
96
|
-
|
|
97
|
-
self.gid = gid
|
|
102
|
+
self.cell.getCell().gid = self.cell_id.id
|
|
98
103
|
|
|
99
104
|
if rng_settings is None:
|
|
100
105
|
self.rng_settings = RNGSettings("Random123") # SONATA value
|
|
@@ -213,17 +218,17 @@ class Cell(InjectableMixin, PlottableMixin):
|
|
|
213
218
|
for section in self.somatic:
|
|
214
219
|
for seg in section:
|
|
215
220
|
neuron.h.setdata_StochKv(seg.x, sec=section)
|
|
216
|
-
neuron.h.setRNG_StochKv(channel_id, self.
|
|
221
|
+
neuron.h.setRNG_StochKv(channel_id, self.cell_id.id)
|
|
217
222
|
channel_id += 1
|
|
218
223
|
for section in self.basal:
|
|
219
224
|
for seg in section:
|
|
220
225
|
neuron.h.setdata_StochKv(seg.x, sec=section)
|
|
221
|
-
neuron.h.setRNG_StochKv(channel_id, self.
|
|
226
|
+
neuron.h.setRNG_StochKv(channel_id, self.cell_id.id)
|
|
222
227
|
channel_id += 1
|
|
223
228
|
for section in self.apical:
|
|
224
229
|
for seg in section:
|
|
225
230
|
neuron.h.setdata_StochKv(seg.x, sec=section)
|
|
226
|
-
neuron.h.setRNG_StochKv(channel_id, self.
|
|
231
|
+
neuron.h.setRNG_StochKv(channel_id, self.cell_id.id)
|
|
227
232
|
channel_id += 1
|
|
228
233
|
else:
|
|
229
234
|
self.cell.re_init_rng()
|
|
@@ -445,7 +450,7 @@ class Cell(InjectableMixin, PlottableMixin):
|
|
|
445
450
|
|
|
446
451
|
self.synapses[synapse_id] = synapse
|
|
447
452
|
|
|
448
|
-
logger.debug(f'Added synapse to cell {self.
|
|
453
|
+
logger.debug(f'Added synapse to cell {self.cell_id.id}')
|
|
449
454
|
|
|
450
455
|
def add_replay_delayed_weight(
|
|
451
456
|
self, sid: tuple[str, int], delay: float, weight: float
|
|
@@ -591,10 +596,10 @@ class Cell(InjectableMixin, PlottableMixin):
|
|
|
591
596
|
+ self.rng_settings.minis_seed
|
|
592
597
|
self.ips[synapse_id].setRNGs(
|
|
593
598
|
sid + 200,
|
|
594
|
-
self.
|
|
599
|
+
self.cell_id.id + 250,
|
|
595
600
|
seed2 + 300,
|
|
596
601
|
sid + 200,
|
|
597
|
-
self.
|
|
602
|
+
self.cell_id.id + 250,
|
|
598
603
|
seed2 + 350)
|
|
599
604
|
else:
|
|
600
605
|
exprng = bluecellulab.neuron.h.Random()
|
|
@@ -605,18 +610,18 @@ class Cell(InjectableMixin, PlottableMixin):
|
|
|
605
610
|
|
|
606
611
|
if self.rng_settings.mode == 'Compatibility':
|
|
607
612
|
exp_seed1 = sid * 100000 + 200
|
|
608
|
-
exp_seed2 = self.
|
|
613
|
+
exp_seed2 = self.cell_id.id + 250 + base_seed + \
|
|
609
614
|
self.rng_settings.minis_seed
|
|
610
615
|
uniform_seed1 = sid * 100000 + 300
|
|
611
|
-
uniform_seed2 = self.
|
|
616
|
+
uniform_seed2 = self.cell_id.id + 250 + base_seed + \
|
|
612
617
|
self.rng_settings.minis_seed
|
|
613
618
|
elif self.rng_settings.mode == "UpdatedMCell":
|
|
614
619
|
exp_seed1 = sid * 1000 + 200
|
|
615
|
-
exp_seed2 = source_popid * 16777216 + self.
|
|
620
|
+
exp_seed2 = source_popid * 16777216 + self.cell_id.id + 250 + \
|
|
616
621
|
base_seed + \
|
|
617
622
|
self.rng_settings.minis_seed
|
|
618
623
|
uniform_seed1 = sid * 1000 + 300
|
|
619
|
-
uniform_seed2 = source_popid * 16777216 + self.
|
|
624
|
+
uniform_seed2 = source_popid * 16777216 + self.cell_id.id + 250 \
|
|
620
625
|
+ base_seed + \
|
|
621
626
|
self.rng_settings.minis_seed
|
|
622
627
|
else:
|
|
@@ -789,7 +794,7 @@ class Cell(InjectableMixin, PlottableMixin):
|
|
|
789
794
|
spike_location=spike_location,
|
|
790
795
|
)
|
|
791
796
|
logger.debug(
|
|
792
|
-
f"Added synapse replay from {pre_gid} to {self.
|
|
797
|
+
f"Added synapse replay from {pre_gid} to {self.cell_id.id}, {synapse_id}"
|
|
793
798
|
)
|
|
794
799
|
|
|
795
800
|
self.connections[synapse_id] = connection
|
bluecellulab/cell/injector.py
CHANGED
|
@@ -156,20 +156,20 @@ class InjectableMixin:
|
|
|
156
156
|
def _get_noise_step_rand(self, noisestim_count):
|
|
157
157
|
"""Return rng for noise step stimulus."""
|
|
158
158
|
if self.rng_settings.mode == "Compatibility":
|
|
159
|
-
rng = bluecellulab.neuron.h.Random(self.
|
|
159
|
+
rng = bluecellulab.neuron.h.Random(self.cell_id.id + noisestim_count)
|
|
160
160
|
elif self.rng_settings.mode == "UpdatedMCell":
|
|
161
161
|
rng = bluecellulab.neuron.h.Random()
|
|
162
162
|
rng.MCellRan4(
|
|
163
163
|
noisestim_count * 10000 + 100,
|
|
164
164
|
self.rng_settings.base_seed +
|
|
165
165
|
self.rng_settings.stimulus_seed +
|
|
166
|
-
self.
|
|
166
|
+
self.cell_id.id * 1000)
|
|
167
167
|
elif self.rng_settings.mode == "Random123":
|
|
168
168
|
rng = bluecellulab.neuron.h.Random()
|
|
169
169
|
rng.Random123(
|
|
170
170
|
noisestim_count + 100,
|
|
171
171
|
self.rng_settings.stimulus_seed + 500,
|
|
172
|
-
self.
|
|
172
|
+
self.cell_id.id + 300)
|
|
173
173
|
|
|
174
174
|
self.persistent.append(rng)
|
|
175
175
|
return rng
|
|
@@ -235,7 +235,7 @@ class InjectableMixin:
|
|
|
235
235
|
if self.rng_settings.mode == "Random123":
|
|
236
236
|
seed1 = stim_count + 2997 # stimulus block
|
|
237
237
|
seed2 = self.rng_settings.stimulus_seed + 291204 # stimulus type
|
|
238
|
-
seed3 = self.
|
|
238
|
+
seed3 = self.cell_id.id + 123 if seed is None else seed # GID
|
|
239
239
|
logger.debug("Using ornstein_uhlenbeck process seeds %d %d %d" %
|
|
240
240
|
(seed1, seed2, seed3))
|
|
241
241
|
rng = bluecellulab.neuron.h.Random()
|
|
@@ -251,7 +251,7 @@ class InjectableMixin:
|
|
|
251
251
|
if self.rng_settings.mode == "Random123":
|
|
252
252
|
seed1 = shotnoise_stim_count + 2997
|
|
253
253
|
seed2 = self.rng_settings.stimulus_seed + 19216
|
|
254
|
-
seed3 = self.
|
|
254
|
+
seed3 = self.cell_id.id + 123 if seed is None else seed
|
|
255
255
|
logger.debug("Using shot noise seeds %d %d %d" %
|
|
256
256
|
(seed1, seed2, seed3))
|
|
257
257
|
rng = bluecellulab.neuron.h.Random()
|
bluecellulab/connection.py
CHANGED
|
@@ -18,6 +18,7 @@ from typing import Optional
|
|
|
18
18
|
import numpy as np
|
|
19
19
|
|
|
20
20
|
import bluecellulab
|
|
21
|
+
from bluecellulab.cell.core import Cell
|
|
21
22
|
from bluecellulab.circuit import SynapseProperty
|
|
22
23
|
|
|
23
24
|
|
|
@@ -28,7 +29,7 @@ class Connection:
|
|
|
28
29
|
self,
|
|
29
30
|
post_synapse,
|
|
30
31
|
pre_spiketrain: Optional[np.ndarray] = None,
|
|
31
|
-
pre_cell=None,
|
|
32
|
+
pre_cell: Optional[Cell] = None,
|
|
32
33
|
stim_dt=None,
|
|
33
34
|
parallel_context=None,
|
|
34
35
|
spike_threshold: float = -30.0,
|
|
@@ -76,7 +77,7 @@ class Connection:
|
|
|
76
77
|
self.post_netcon = self.pre_cell.create_netcon_spikedetector(
|
|
77
78
|
self.post_synapse.hsynapse, location=spike_location,
|
|
78
79
|
threshold=spike_threshold) if self.pc is None else \
|
|
79
|
-
self.pc.gid_connect(self.pre_cell.
|
|
80
|
+
self.pc.gid_connect(self.pre_cell.cell_id.id, self.post_synapse.hsynapse)
|
|
80
81
|
self.post_netcon.weight[0] = self.post_netcon_weight
|
|
81
82
|
self.post_netcon.delay = self.post_netcon_delay
|
|
82
83
|
self.post_netcon.threshold = spike_threshold
|
|
@@ -94,7 +95,7 @@ class Connection:
|
|
|
94
95
|
connection_dict = {}
|
|
95
96
|
|
|
96
97
|
connection_dict['pre_cell_id'] = self.post_synapse.pre_gid
|
|
97
|
-
connection_dict['post_cell_id'] = self.post_synapse.
|
|
98
|
+
connection_dict['post_cell_id'] = self.post_synapse.post_cell_id.id
|
|
98
99
|
connection_dict['post_synapse_id'] = self.post_synapse.syn_id.sid
|
|
99
100
|
|
|
100
101
|
connection_dict['post_netcon'] = {}
|
bluecellulab/graph.py
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"""Graph representation of Cells and Synapses."""
|
|
2
|
+
|
|
3
|
+
from matplotlib.cm import ScalarMappable
|
|
4
|
+
from matplotlib.colors import Normalize
|
|
5
|
+
import matplotlib.pyplot as plt
|
|
6
|
+
import networkx as nx
|
|
7
|
+
import numpy as np
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
from bluecellulab.cell.cell_dict import CellDict
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def build_graph(cells: CellDict) -> nx.DiGraph:
|
|
14
|
+
G = nx.DiGraph()
|
|
15
|
+
|
|
16
|
+
# Add nodes (cells) to the graph
|
|
17
|
+
for cell_id, cell in cells.items():
|
|
18
|
+
G.add_node(cell_id, label=str(cell_id.id), population=cell_id.population_name)
|
|
19
|
+
|
|
20
|
+
# Extract and add edges (connections) to the graph from each cell
|
|
21
|
+
for cell_id, cell in cells.items():
|
|
22
|
+
for connection in cell.connections.values():
|
|
23
|
+
# Check if pre_cell exists for the connection
|
|
24
|
+
if connection.pre_cell is None:
|
|
25
|
+
continue
|
|
26
|
+
|
|
27
|
+
# Source is the pre_cell from the connection
|
|
28
|
+
source_cell_id = connection.pre_cell.cell_id
|
|
29
|
+
|
|
30
|
+
# Target is the post-synapse cell from the connection
|
|
31
|
+
target_cell_id = connection.post_synapse.post_cell_id
|
|
32
|
+
|
|
33
|
+
# Check if both source and target cells are within the current cell collection
|
|
34
|
+
if source_cell_id in cells and target_cell_id in cells:
|
|
35
|
+
G.add_edge(source_cell_id, target_cell_id, weight=connection.weight)
|
|
36
|
+
|
|
37
|
+
return G
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def plot_graph(G: nx.Graph, node_size: float = 400, edge_width: float = 0.4, node_distance: float = 1.6):
|
|
41
|
+
# Extract unique populations from the graph nodes
|
|
42
|
+
populations = list(set([cell_id.population_name for cell_id in G.nodes()]))
|
|
43
|
+
|
|
44
|
+
# Create a color map for each population
|
|
45
|
+
color_map = plt.cm.tab20(np.linspace(0, 1, len(populations))) # type: ignore[attr-defined]
|
|
46
|
+
population_color = dict(zip(populations, color_map))
|
|
47
|
+
|
|
48
|
+
# Create node colors based on their population
|
|
49
|
+
node_colors = [population_color[node.population_name] for node in G.nodes()]
|
|
50
|
+
|
|
51
|
+
# Extract weights for edge color mapping
|
|
52
|
+
edge_weights = [d['weight'] for _, _, d in G.edges(data=True)]
|
|
53
|
+
edge_colors = plt.cm.Greens(np.interp(edge_weights, (min(edge_weights), max(edge_weights)), (0.3, 1))) # type: ignore[attr-defined]
|
|
54
|
+
|
|
55
|
+
# Create positions using spring layout for the entire graph
|
|
56
|
+
pos = nx.spring_layout(G, k=node_distance)
|
|
57
|
+
|
|
58
|
+
# Create labels only for the node ID
|
|
59
|
+
labels = {node: node.id for node in G.nodes()}
|
|
60
|
+
|
|
61
|
+
# Create a figure and axis for the drawing
|
|
62
|
+
fig, ax = plt.subplots(figsize=(6, 5))
|
|
63
|
+
|
|
64
|
+
# Draw the graph
|
|
65
|
+
nx.draw(G, pos, with_labels=True, labels=labels, node_color=node_colors,
|
|
66
|
+
edge_color=edge_colors, width=edge_width, node_size=node_size, ax=ax, connectionstyle='arc3, rad = 0.1')
|
|
67
|
+
|
|
68
|
+
# Draw directed edges
|
|
69
|
+
nx.draw_networkx_edges(G, pos, edge_color=edge_colors, width=edge_width, ax=ax, arrowstyle='-|>', arrowsize=20, connectionstyle='arc3, rad = 0.1')
|
|
70
|
+
|
|
71
|
+
# Create a legend
|
|
72
|
+
for population, color in population_color.items():
|
|
73
|
+
plt.plot([0], [0], color=color, label=population)
|
|
74
|
+
plt.legend(loc="upper left", bbox_to_anchor=(-0.1, 1.05)) # Adjust these values as needed
|
|
75
|
+
|
|
76
|
+
# Add a colorbar for edge weights
|
|
77
|
+
sm = ScalarMappable(cmap="Greens", norm=Normalize(vmin=min(edge_weights), vmax=max(edge_weights)))
|
|
78
|
+
sm.set_array([])
|
|
79
|
+
cbar = plt.colorbar(sm, ax=ax, orientation="vertical", fraction=0.03, pad=0.04)
|
|
80
|
+
cbar.set_label('Synaptic Strength')
|
|
81
|
+
|
|
82
|
+
# Add text at the bottom of the figure
|
|
83
|
+
plt.figtext(0.5, 0.01, "Network of simulated cells", ha="center", fontsize=10, va="bottom")
|
|
84
|
+
|
|
85
|
+
plt.show()
|
|
@@ -157,7 +157,7 @@ class Simulation:
|
|
|
157
157
|
|
|
158
158
|
if self.pc is not None:
|
|
159
159
|
for cell in self.cells:
|
|
160
|
-
self.pc.prcellstate(cell.
|
|
160
|
+
self.pc.prcellstate(cell.cell_id.id, f"bluecellulab_t={bluecellulab.neuron.h.t}")
|
|
161
161
|
|
|
162
162
|
try:
|
|
163
163
|
neuron.h.continuerun(neuron.h.tstop)
|
bluecellulab/ssim.py
CHANGED
|
@@ -17,7 +17,6 @@ simulations."""
|
|
|
17
17
|
|
|
18
18
|
from __future__ import annotations
|
|
19
19
|
from collections.abc import Iterable
|
|
20
|
-
from collections import defaultdict
|
|
21
20
|
from pathlib import Path
|
|
22
21
|
from typing import Optional
|
|
23
22
|
import logging
|
|
@@ -100,9 +99,6 @@ class SSim:
|
|
|
100
99
|
self.cells: CellDict = CellDict()
|
|
101
100
|
|
|
102
101
|
self.gids_instantiated = False
|
|
103
|
-
self.connections: defaultdict = defaultdict(
|
|
104
|
-
lambda: defaultdict(lambda: None)
|
|
105
|
-
)
|
|
106
102
|
|
|
107
103
|
# Make sure tstop is set correctly, because it is used by the
|
|
108
104
|
# TStim noise stimulus
|
|
@@ -732,7 +728,7 @@ class SSim:
|
|
|
732
728
|
cell_kwargs = {
|
|
733
729
|
'template_path': self.circuit_access.emodel_path(cell_id),
|
|
734
730
|
'morphology_path': self.circuit_access.morph_filepath(cell_id),
|
|
735
|
-
'
|
|
731
|
+
'cell_id': cell_id,
|
|
736
732
|
'record_dt': self.record_dt,
|
|
737
733
|
'rng_settings': self.rng_settings,
|
|
738
734
|
'template_format': self.circuit_access.get_template_format(),
|
|
@@ -746,7 +742,7 @@ class SSim:
|
|
|
746
742
|
cell_kwargs = self.fetch_cell_kwargs(cell_id)
|
|
747
743
|
return bluecellulab.Cell(template_path=cell_kwargs['template_path'],
|
|
748
744
|
morphology_path=cell_kwargs['morphology_path'],
|
|
749
|
-
|
|
745
|
+
cell_id=cell_kwargs['cell_id'],
|
|
750
746
|
record_dt=cell_kwargs['record_dt'],
|
|
751
747
|
rng_settings=cell_kwargs['rng_settings'],
|
|
752
748
|
template_format=cell_kwargs['template_format'],
|
|
@@ -60,13 +60,13 @@ class SynapseFactory:
|
|
|
60
60
|
randomize_gaba_risetime = condition_parameters.randomize_gaba_rise_time
|
|
61
61
|
else:
|
|
62
62
|
randomize_gaba_risetime = True
|
|
63
|
-
synapse = GabaabSynapse(cell.rng_settings, cell.
|
|
63
|
+
synapse = GabaabSynapse(cell.rng_settings, cell.cell_id, syn_hoc_args, syn_id, syn_description,
|
|
64
64
|
popids, extracellular_calcium, randomize_gaba_risetime)
|
|
65
65
|
elif syn_type == SynapseType.AMPANMDA:
|
|
66
|
-
synapse = AmpanmdaSynapse(cell.rng_settings, cell.
|
|
66
|
+
synapse = AmpanmdaSynapse(cell.rng_settings, cell.cell_id, syn_hoc_args, syn_id, syn_description,
|
|
67
67
|
popids, extracellular_calcium)
|
|
68
68
|
else:
|
|
69
|
-
synapse = GluSynapse(cell.rng_settings, cell.
|
|
69
|
+
synapse = GluSynapse(cell.rng_settings, cell.cell_id, syn_hoc_args, syn_id, syn_description,
|
|
70
70
|
popids, extracellular_calcium)
|
|
71
71
|
|
|
72
72
|
synapse = cls.apply_connection_modifiers(connection_modifiers, synapse)
|
|
@@ -20,6 +20,7 @@ import logging
|
|
|
20
20
|
|
|
21
21
|
import bluecellulab
|
|
22
22
|
from bluecellulab.circuit import SynapseProperty
|
|
23
|
+
from bluecellulab.circuit.node_id import CellId
|
|
23
24
|
from bluecellulab.rngsettings import RNGSettings
|
|
24
25
|
from bluecellulab.type_aliases import HocObjectType, NeuronSection
|
|
25
26
|
|
|
@@ -46,7 +47,7 @@ class Synapse:
|
|
|
46
47
|
def __init__(
|
|
47
48
|
self,
|
|
48
49
|
rng_settings: RNGSettings,
|
|
49
|
-
|
|
50
|
+
cell_id: CellId,
|
|
50
51
|
hoc_args: SynapseHocArgs,
|
|
51
52
|
syn_id: tuple[str, int],
|
|
52
53
|
syn_description: pd.Series,
|
|
@@ -72,7 +73,7 @@ class Synapse:
|
|
|
72
73
|
self._delay_weights: list[tuple[float, float]] = []
|
|
73
74
|
self._weight: Optional[float] = None
|
|
74
75
|
|
|
75
|
-
self.
|
|
76
|
+
self.post_cell_id = cell_id
|
|
76
77
|
self.syn_id = SynapseID(*syn_id)
|
|
77
78
|
self.extracellular_calcium = extracellular_calcium
|
|
78
79
|
self.syn_description: pd.Series = self.update_syn_description(syn_description)
|
|
@@ -146,7 +147,7 @@ class Synapse:
|
|
|
146
147
|
ValueError: when rng mode is not recognised.
|
|
147
148
|
"""
|
|
148
149
|
if self.rng_settings.mode == "Random123":
|
|
149
|
-
self.randseed1 = self.
|
|
150
|
+
self.randseed1 = self.post_cell_id.id + 250
|
|
150
151
|
self.randseed2 = self.syn_id.sid + 100
|
|
151
152
|
self.randseed3 = self.source_popid * 65536 + self.target_popid + \
|
|
152
153
|
self.rng_settings.synapse_seed + 300
|
|
@@ -158,12 +159,12 @@ class Synapse:
|
|
|
158
159
|
rndd = bluecellulab.neuron.h.Random()
|
|
159
160
|
if self.rng_settings.mode == "Compatibility":
|
|
160
161
|
self.randseed1 = self.syn_id.sid * 100000 + 100
|
|
161
|
-
self.randseed2 = self.
|
|
162
|
+
self.randseed2 = self.post_cell_id.id + \
|
|
162
163
|
250 + self.rng_settings.base_seed
|
|
163
164
|
elif self.rng_settings.mode == "UpdatedMCell":
|
|
164
165
|
self.randseed1 = self.syn_id.sid * 1000 + 100
|
|
165
166
|
self.randseed2 = self.source_popid * 16777216 + \
|
|
166
|
-
self.
|
|
167
|
+
self.post_cell_id.id + \
|
|
167
168
|
250 + self.rng_settings.base_seed + \
|
|
168
169
|
self.rng_settings.synapse_seed
|
|
169
170
|
else:
|
|
@@ -209,7 +210,7 @@ class Synapse:
|
|
|
209
210
|
|
|
210
211
|
synapse_dict['synapse_id'] = self.syn_id
|
|
211
212
|
synapse_dict['pre_cell_id'] = self.pre_gid
|
|
212
|
-
synapse_dict['post_cell_id'] = self.
|
|
213
|
+
synapse_dict['post_cell_id'] = self.post_cell_id.id
|
|
213
214
|
synapse_dict['syn_description'] = self.syn_description.to_dict()
|
|
214
215
|
# if keys are enum make them str
|
|
215
216
|
synapse_dict['syn_description'] = {
|
|
@@ -286,7 +287,7 @@ class GluSynapse(Synapse):
|
|
|
286
287
|
if self.syn_description[SynapseProperty.NRRP] >= 0:
|
|
287
288
|
self.hsynapse.Nrrp = self.syn_description[SynapseProperty.NRRP]
|
|
288
289
|
|
|
289
|
-
self.randseed1 = self.
|
|
290
|
+
self.randseed1 = self.post_cell_id.id
|
|
290
291
|
self.randseed2 = 100000 + self.syn_id.sid
|
|
291
292
|
self.randseed3 = self.rng_settings.synapse_seed + 200
|
|
292
293
|
self.hsynapse.setRNG(self.randseed1, self.randseed2, self.randseed3)
|
|
@@ -330,19 +331,19 @@ class GabaabSynapse(Synapse):
|
|
|
330
331
|
if self.rng_settings.mode == "Compatibility":
|
|
331
332
|
rng.MCellRan4(
|
|
332
333
|
self.syn_id.sid * 100000 + 100,
|
|
333
|
-
self.
|
|
334
|
+
self.post_cell_id.id + 250 + self.rng_settings.base_seed)
|
|
334
335
|
elif self.rng_settings.mode == "UpdatedMCell":
|
|
335
336
|
rng.MCellRan4(
|
|
336
337
|
self.syn_id.sid * 1000 + 100,
|
|
337
338
|
self.source_popid *
|
|
338
339
|
16777216 +
|
|
339
|
-
self.
|
|
340
|
+
self.post_cell_id.id +
|
|
340
341
|
250 +
|
|
341
342
|
self.rng_settings.base_seed +
|
|
342
343
|
self.rng_settings.synapse_seed)
|
|
343
344
|
elif self.rng_settings.mode == "Random123":
|
|
344
345
|
rng.Random123(
|
|
345
|
-
self.
|
|
346
|
+
self.post_cell_id.id +
|
|
346
347
|
250,
|
|
347
348
|
self.syn_id.sid +
|
|
348
349
|
100,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: bluecellulab
|
|
3
|
-
Version: 1.8.
|
|
3
|
+
Version: 1.8.2
|
|
4
4
|
Summary: The Pythonic Blue Brain simulator access
|
|
5
5
|
Home-page: https://github.com/BlueBrain/BlueCelluLab
|
|
6
6
|
Author: Blue Brain Project, EPFL
|
|
@@ -24,6 +24,7 @@ Requires-Dist: pandas <3.0.0,>=1.0.0
|
|
|
24
24
|
Requires-Dist: bluepysnap <3.0.0,>=2.0.0
|
|
25
25
|
Requires-Dist: pydantic <3.0.0,>=2.5.2
|
|
26
26
|
Requires-Dist: typing-extensions >=4.8.0
|
|
27
|
+
Requires-Dist: networkx >=3.1
|
|
27
28
|
|
|
28
29
|
|banner|
|
|
29
30
|
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
bluecellulab/__init__.py,sha256=tbFwA146uSwNPO1HeVhqHNfxUBPM0VsuNk3NeMCq-Wc,620
|
|
2
|
-
bluecellulab/connection.py,sha256=
|
|
2
|
+
bluecellulab/connection.py,sha256=zZXQZAdFw8jdqnqrOZhiXjoFffVuQe6fZpgOeK2UwA4,4737
|
|
3
3
|
bluecellulab/dendrogram.py,sha256=G9_oZoxZwevHmJ4va5OGMlc8B2D3DpqK0v0G3SCGkEg,4890
|
|
4
4
|
bluecellulab/exceptions.py,sha256=ggTrfzoW3y0oDFUp3ff7GR9buLo-I2LM8XwxE1vQS9k,2379
|
|
5
|
+
bluecellulab/graph.py,sha256=tADNsE7mcIbaSVnC3--ism-TSmMmIrwUxumEGUS_mi0,3478
|
|
5
6
|
bluecellulab/importer.py,sha256=K09SOykkks7nbZoAbQZsK2TgK0wKPI4LXaxWm0ZdiBc,2467
|
|
6
7
|
bluecellulab/neuron_interpreter.py,sha256=XPbQtOPIDk-sGydl4wuanOIeKl_rWvncXEsaweYTzVw,2185
|
|
7
8
|
bluecellulab/plotwindow.py,sha256=-Tym4DH5tvuxLKua5NXxBcnVUNGMUQt3EltEQhG7fyg,2728
|
|
8
9
|
bluecellulab/psection.py,sha256=RxXZLD5F9iWW9oettm5QROPJd4zpshkMVQmxBkbpJsQ,6077
|
|
9
10
|
bluecellulab/psegment.py,sha256=qQaUM4CCJ4JHLvDblN0Wc4IusKoAukASuP1pfk2p0zg,3309
|
|
10
11
|
bluecellulab/rngsettings.py,sha256=2LIZLroSDjlwsoWFFK1IO2fPMSALga-f3a0_scGVHaM,3999
|
|
11
|
-
bluecellulab/ssim.py,sha256=
|
|
12
|
+
bluecellulab/ssim.py,sha256=e9KQfZ5gLTEaXDNjnpOJy0k8NqDeQ4J2wSjuIr7qLlc,33196
|
|
12
13
|
bluecellulab/stimuli.py,sha256=tZo5hBr3ephHL1LVQXcOjdvjq3I_ziRveMChD55c_dE,15540
|
|
13
14
|
bluecellulab/tools.py,sha256=jFXahRUhA6XZU1w6rhxCa-CLcSsiErTEp4JgqtaPiXY,24243
|
|
14
15
|
bluecellulab/type_aliases.py,sha256=EMrunY-pIgZrsmetpAM8lA7tr0TFEzFoU5SX9sBuiOk,312
|
|
15
16
|
bluecellulab/cell/__init__.py,sha256=Sbc0QOsJ8E7tSwf3q7fsXuE_SevBN6ZmoCVyyU5zfII,208
|
|
16
17
|
bluecellulab/cell/cell_dict.py,sha256=BKpJLYLrJCffKGak4EfGZtgus_u0Scz0NKas7tY31vE,1346
|
|
17
|
-
bluecellulab/cell/core.py,sha256=
|
|
18
|
-
bluecellulab/cell/injector.py,sha256=
|
|
18
|
+
bluecellulab/cell/core.py,sha256=NhAwPde0VLsTiCaKh-oujooASkc9evS_Di3wpCHKNis,34338
|
|
19
|
+
bluecellulab/cell/injector.py,sha256=9cru7K4hxNBulsLq37t7SD9hVER8UviXI64RsDKUh5s,17135
|
|
19
20
|
bluecellulab/cell/plotting.py,sha256=K_oDLeweEK-2LpiIzuZqG0Fd6cSQHoCN2vxuZsWteFs,4123
|
|
20
21
|
bluecellulab/cell/random.py,sha256=s8Kf0q24fiA5rBdVCVbIdDMQGCDfQcwLwXRB72p1e1g,1773
|
|
21
22
|
bluecellulab/cell/section_distance.py,sha256=KoqHkXW3B84QmrtQNhGRczwLOsUrSepLGNJXgaovPOw,3980
|
|
@@ -44,13 +45,13 @@ bluecellulab/hoc/TStim.hoc,sha256=noBJbM_ZqF6T6MEgBeowNzz21I9QeYZ5brGgUvCSm4k,84
|
|
|
44
45
|
bluecellulab/hoc/fileUtils.hoc,sha256=LSM7BgyjYVqo2DGSOKvg4W8IIusbsL45JVYK0vgwitU,2539
|
|
45
46
|
bluecellulab/simulation/__init__.py,sha256=G1md-6mqaYQkfZT8pmzqRi3WW1fMQCgkeaela2kX3OM,258
|
|
46
47
|
bluecellulab/simulation/neuron_globals.py,sha256=5pdkqkstOVZcvPJ_IOwn9nfPvpsXz78TUn_U3k8r2qw,3471
|
|
47
|
-
bluecellulab/simulation/simulation.py,sha256=
|
|
48
|
+
bluecellulab/simulation/simulation.py,sha256=Fj04VN8VJJ0DozJ-hgl1yxag_bLl9eriicpKDLG15rQ,6479
|
|
48
49
|
bluecellulab/synapse/__init__.py,sha256=RW8XoAMXOvK7OG1nHl_q8jSEKLj9ZN4oWf2nY9HAwuk,192
|
|
49
|
-
bluecellulab/synapse/synapse_factory.py,sha256=
|
|
50
|
-
bluecellulab/synapse/synapse_types.py,sha256=
|
|
51
|
-
bluecellulab-1.8.
|
|
52
|
-
bluecellulab-1.8.
|
|
53
|
-
bluecellulab-1.8.
|
|
54
|
-
bluecellulab-1.8.
|
|
55
|
-
bluecellulab-1.8.
|
|
56
|
-
bluecellulab-1.8.
|
|
50
|
+
bluecellulab/synapse/synapse_factory.py,sha256=qrtK_BMWGkpk1embG4oEkrLutt3L_ntqypuvYBxXPEA,6802
|
|
51
|
+
bluecellulab/synapse/synapse_types.py,sha256=M-jF41CnMm7sEDiDhpXKv6HI9wSsRm524jhoI-Xg3qg,17123
|
|
52
|
+
bluecellulab-1.8.2.dist-info/AUTHORS.txt,sha256=EDs3H-2HXBojbma10psixk3C2rFiOCTIREi2ZAbXYNQ,179
|
|
53
|
+
bluecellulab-1.8.2.dist-info/LICENSE,sha256=xOouu1gC1GGklDxkITlaVl60I9Ab860O-nZsFbWydvU,11749
|
|
54
|
+
bluecellulab-1.8.2.dist-info/METADATA,sha256=xP991eJK2iJzHgCFN362iimjph4vO8gK-DBHzAUyphQ,6719
|
|
55
|
+
bluecellulab-1.8.2.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
56
|
+
bluecellulab-1.8.2.dist-info/top_level.txt,sha256=VSyEP8w9l3pXdRkyP_goeMwiNA8KWwitfAqUkveJkdQ,13
|
|
57
|
+
bluecellulab-1.8.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|