bluecellulab 1.5.0__py3-none-any.whl → 1.5.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 +27 -22
- bluecellulab/circuit/circuit_access.py +3 -3
- bluecellulab/rngsettings.py +1 -10
- bluecellulab/ssim.py +4 -9
- {bluecellulab-1.5.0.dist-info → bluecellulab-1.5.2.dist-info}/METADATA +1 -1
- {bluecellulab-1.5.0.dist-info → bluecellulab-1.5.2.dist-info}/RECORD +10 -10
- {bluecellulab-1.5.0.dist-info → bluecellulab-1.5.2.dist-info}/AUTHORS.txt +0 -0
- {bluecellulab-1.5.0.dist-info → bluecellulab-1.5.2.dist-info}/LICENSE +0 -0
- {bluecellulab-1.5.0.dist-info → bluecellulab-1.5.2.dist-info}/WHEEL +0 -0
- {bluecellulab-1.5.0.dist-info → bluecellulab-1.5.2.dist-info}/top_level.txt +0 -0
bluecellulab/cell/core.py
CHANGED
|
@@ -102,8 +102,8 @@ class Cell(InjectableMixin, PlottableMixin):
|
|
|
102
102
|
self.synapses: dict[tuple[str, int], Synapse] = {}
|
|
103
103
|
self.connections: dict[tuple[str, int], bluecellulab.Connection] = {}
|
|
104
104
|
|
|
105
|
-
self.ips: dict[int, HocObjectType] = {}
|
|
106
|
-
self.syn_mini_netcons: dict[int, HocObjectType] = {}
|
|
105
|
+
self.ips: dict[tuple[str, int], HocObjectType] = {}
|
|
106
|
+
self.syn_mini_netcons: dict[tuple[str, int], HocObjectType] = {}
|
|
107
107
|
self.serialized = None
|
|
108
108
|
|
|
109
109
|
# Be careful when removing this,
|
|
@@ -503,7 +503,8 @@ class Cell(InjectableMixin, PlottableMixin):
|
|
|
503
503
|
"""Get recorded values."""
|
|
504
504
|
return np.array(self.recordings[var_name].to_python())
|
|
505
505
|
|
|
506
|
-
def add_replay_synapse(self,
|
|
506
|
+
def add_replay_synapse(self,
|
|
507
|
+
synapse_id: tuple[str, int],
|
|
507
508
|
syn_description: pd.Series,
|
|
508
509
|
connection_modifiers: dict,
|
|
509
510
|
condition_parameters: Conditions,
|
|
@@ -638,13 +639,17 @@ class Cell(InjectableMixin, PlottableMixin):
|
|
|
638
639
|
result = self.recordings[f"spike_detector_{location}_{threshold}"]
|
|
639
640
|
return result.to_python()
|
|
640
641
|
|
|
641
|
-
def add_replay_minis(self,
|
|
642
|
-
|
|
642
|
+
def add_replay_minis(self,
|
|
643
|
+
synapse_id: tuple[str, int],
|
|
644
|
+
syn_description: pd.Series,
|
|
645
|
+
connection_modifiers: dict,
|
|
646
|
+
base_seed: int | None,
|
|
647
|
+
popids: tuple[int, int],
|
|
648
|
+
mini_frequencies: tuple[float | None, float | None]) -> None:
|
|
643
649
|
"""Add minis from the replay."""
|
|
644
|
-
|
|
645
650
|
source_popid, target_popid = popids
|
|
646
651
|
|
|
647
|
-
sid =
|
|
652
|
+
sid = synapse_id[1]
|
|
648
653
|
|
|
649
654
|
if base_seed is None:
|
|
650
655
|
base_seed = self.rng_settings.base_seed
|
|
@@ -659,19 +664,19 @@ class Cell(InjectableMixin, PlottableMixin):
|
|
|
659
664
|
synlocation_to_segx(post_sec_id, post_seg_id,
|
|
660
665
|
post_seg_distance)
|
|
661
666
|
# todo: False
|
|
662
|
-
if 'Weight' in
|
|
663
|
-
weight_scalar =
|
|
667
|
+
if 'Weight' in connection_modifiers:
|
|
668
|
+
weight_scalar = connection_modifiers['Weight']
|
|
664
669
|
else:
|
|
665
670
|
weight_scalar = 1.0
|
|
666
671
|
|
|
667
672
|
exc_mini_frequency, inh_mini_frequency = mini_frequencies \
|
|
668
673
|
if mini_frequencies is not None else (None, None)
|
|
669
674
|
|
|
670
|
-
synapse = self.synapses[
|
|
675
|
+
synapse = self.synapses[synapse_id]
|
|
671
676
|
|
|
672
677
|
# SpontMinis in sim config takes precedence of values in nodes file
|
|
673
|
-
if 'SpontMinis' in
|
|
674
|
-
spont_minis_rate =
|
|
678
|
+
if 'SpontMinis' in connection_modifiers:
|
|
679
|
+
spont_minis_rate = connection_modifiers['SpontMinis']
|
|
675
680
|
else:
|
|
676
681
|
if synapse.mech_name in ["GluSynapse", "ProbAMPANMDA_EMS"]:
|
|
677
682
|
spont_minis_rate = exc_mini_frequency
|
|
@@ -681,25 +686,25 @@ class Cell(InjectableMixin, PlottableMixin):
|
|
|
681
686
|
if spont_minis_rate is not None and spont_minis_rate > 0:
|
|
682
687
|
sec = self.get_hsection(post_sec_id)
|
|
683
688
|
# add the *minis*: spontaneous synaptic events
|
|
684
|
-
self.ips[
|
|
689
|
+
self.ips[synapse_id] = bluecellulab.neuron.h.\
|
|
685
690
|
InhPoissonStim(location, sec=sec)
|
|
686
691
|
|
|
687
|
-
self.syn_mini_netcons[
|
|
688
|
-
NetCon(self.ips[
|
|
689
|
-
self.syn_mini_netcons[
|
|
690
|
-
self.syn_mini_netcons[
|
|
692
|
+
self.syn_mini_netcons[synapse_id] = bluecellulab.neuron.h.\
|
|
693
|
+
NetCon(self.ips[synapse_id], synapse.hsynapse, sec=sec)
|
|
694
|
+
self.syn_mini_netcons[synapse_id].delay = 0.1
|
|
695
|
+
self.syn_mini_netcons[synapse_id].weight[0] = weight * weight_scalar
|
|
691
696
|
# set netcon type
|
|
692
697
|
nc_param_name = 'nc_type_param_{}'.format(
|
|
693
698
|
synapse.hsynapse).split('[')[0]
|
|
694
699
|
if hasattr(bluecellulab.neuron.h, nc_param_name):
|
|
695
700
|
nc_type_param = int(getattr(bluecellulab.neuron.h, nc_param_name))
|
|
696
701
|
# NC_SPONTMINI
|
|
697
|
-
self.syn_mini_netcons[
|
|
702
|
+
self.syn_mini_netcons[synapse_id].weight[nc_type_param] = 1
|
|
698
703
|
|
|
699
704
|
if self.rng_settings.mode == 'Random123':
|
|
700
705
|
seed2 = source_popid * 65536 + target_popid \
|
|
701
706
|
+ self.rng_settings.minis_seed
|
|
702
|
-
self.ips[
|
|
707
|
+
self.ips[synapse_id].setRNGs(
|
|
703
708
|
sid + 200,
|
|
704
709
|
self.gid + 250,
|
|
705
710
|
seed2 + 300,
|
|
@@ -739,7 +744,7 @@ class Cell(InjectableMixin, PlottableMixin):
|
|
|
739
744
|
uniformrng.MCellRan4(uniform_seed1, uniform_seed2)
|
|
740
745
|
uniformrng.uniform(0.0, 1.0)
|
|
741
746
|
|
|
742
|
-
self.ips[
|
|
747
|
+
self.ips[synapse_id].setRNGs(exprng, uniformrng)
|
|
743
748
|
|
|
744
749
|
tbins_vec = bluecellulab.neuron.h.Vector(1)
|
|
745
750
|
tbins_vec.x[0] = 0.0
|
|
@@ -747,8 +752,8 @@ class Cell(InjectableMixin, PlottableMixin):
|
|
|
747
752
|
rate_vec.x[0] = spont_minis_rate
|
|
748
753
|
self.persistent.append(tbins_vec)
|
|
749
754
|
self.persistent.append(rate_vec)
|
|
750
|
-
self.ips[
|
|
751
|
-
self.ips[
|
|
755
|
+
self.ips[synapse_id].setTbins(tbins_vec)
|
|
756
|
+
self.ips[synapse_id].setRate(rate_vec)
|
|
752
757
|
|
|
753
758
|
def locate_bapsite(self, seclist_name, distance):
|
|
754
759
|
"""Return the location of the BAP site.
|
|
@@ -137,7 +137,7 @@ class CircuitAccess(Protocol):
|
|
|
137
137
|
def fetch_cell_info(self, cell_id: CellId) -> pd.Series:
|
|
138
138
|
raise NotImplementedError
|
|
139
139
|
|
|
140
|
-
def fetch_mini_frequencies(self, cell_id: CellId) -> tuple:
|
|
140
|
+
def fetch_mini_frequencies(self, cell_id: CellId) -> tuple[float | None, float | None]:
|
|
141
141
|
raise NotImplementedError
|
|
142
142
|
|
|
143
143
|
@property
|
|
@@ -432,7 +432,7 @@ class BluepyCircuitAccess:
|
|
|
432
432
|
|
|
433
433
|
return emodel_name
|
|
434
434
|
|
|
435
|
-
def fetch_mini_frequencies(self, cell_id: CellId) -> tuple:
|
|
435
|
+
def fetch_mini_frequencies(self, cell_id: CellId) -> tuple[float | None, float | None]:
|
|
436
436
|
"""Get inhibitory frequency of gid."""
|
|
437
437
|
cell_info = self.fetch_cell_info(cell_id)
|
|
438
438
|
# mvd uses inh_mini_frequency, sonata uses inh-mini_frequency
|
|
@@ -650,7 +650,7 @@ class SonataCircuitAccess:
|
|
|
650
650
|
def fetch_cell_info(self, cell_id: CellId) -> pd.Series:
|
|
651
651
|
return self._circuit.nodes[cell_id.population_name].get(cell_id.id)
|
|
652
652
|
|
|
653
|
-
def fetch_mini_frequencies(self, cell_id: CellId) -> tuple:
|
|
653
|
+
def fetch_mini_frequencies(self, cell_id: CellId) -> tuple[float | None, float | None]:
|
|
654
654
|
cell_info = self.fetch_cell_info(cell_id)
|
|
655
655
|
exc_mini_frequency = cell_info['exc-mini_frequency'] \
|
|
656
656
|
if 'exc-mini_frequency' in cell_info else None
|
bluecellulab/rngsettings.py
CHANGED
|
@@ -32,8 +32,7 @@ class RNGSettings(metaclass=Singleton):
|
|
|
32
32
|
self,
|
|
33
33
|
mode: Optional[str] = None,
|
|
34
34
|
circuit_access: Optional[CircuitAccess] = None,
|
|
35
|
-
base_seed: Optional[int] = None
|
|
36
|
-
base_noise_seed: Optional[int] = None):
|
|
35
|
+
base_seed: Optional[int] = None):
|
|
37
36
|
"""Constructor.
|
|
38
37
|
|
|
39
38
|
Parameters
|
|
@@ -41,7 +40,6 @@ class RNGSettings(metaclass=Singleton):
|
|
|
41
40
|
mode : rng mode, if not specified mode is taken from circuit_access
|
|
42
41
|
circuit: circuit access object, if present seeds are read from simulation
|
|
43
42
|
base_seed: base seed for entire sim, overrides config value
|
|
44
|
-
base_noise_seed: base seed for the noise stimuli
|
|
45
43
|
"""
|
|
46
44
|
|
|
47
45
|
self._mode = ""
|
|
@@ -77,11 +75,6 @@ class RNGSettings(metaclass=Singleton):
|
|
|
77
75
|
self.minis_seed = circuit_access.config.minis_seed if circuit_access else 0
|
|
78
76
|
bluecellulab.neuron.h.minisSeed = self.minis_seed
|
|
79
77
|
|
|
80
|
-
if base_noise_seed is None:
|
|
81
|
-
self.base_noise_seed = 0
|
|
82
|
-
else:
|
|
83
|
-
self.base_noise_seed = base_noise_seed
|
|
84
|
-
|
|
85
78
|
@property
|
|
86
79
|
def mode(self):
|
|
87
80
|
return self._mode
|
|
@@ -103,14 +96,12 @@ class RNGSettings(metaclass=Singleton):
|
|
|
103
96
|
def __repr__(self) -> str:
|
|
104
97
|
"""Returns a string representation of the object."""
|
|
105
98
|
return "RNGSettings(mode={mode}, base_seed={base_seed}, " \
|
|
106
|
-
"base_noise_seed={base_noise_seed}, " \
|
|
107
99
|
"synapse_seed={synapse_seed}, " \
|
|
108
100
|
"ionchannel_seed={ionchannel_seed}, " \
|
|
109
101
|
"stimulus_seed={stimulus_seed}, " \
|
|
110
102
|
"minis_seed={minis_seed})".format(
|
|
111
103
|
mode=self.mode,
|
|
112
104
|
base_seed=self.base_seed,
|
|
113
|
-
base_noise_seed=self.base_noise_seed,
|
|
114
105
|
synapse_seed=self.synapse_seed,
|
|
115
106
|
ionchannel_seed=self.ionchannel_seed,
|
|
116
107
|
stimulus_seed=self.stimulus_seed,
|
bluecellulab/ssim.py
CHANGED
|
@@ -59,7 +59,6 @@ class SSim:
|
|
|
59
59
|
dt: float = 0.025,
|
|
60
60
|
record_dt: Optional[float] = None,
|
|
61
61
|
base_seed: Optional[int] = None,
|
|
62
|
-
base_noise_seed: Optional[int] = None,
|
|
63
62
|
rng_mode: Optional[str] = None,
|
|
64
63
|
print_cellstate: bool = False,
|
|
65
64
|
):
|
|
@@ -75,11 +74,6 @@ class SSim:
|
|
|
75
74
|
Has to positive integer.
|
|
76
75
|
When this is not set, and no seed is set in the
|
|
77
76
|
simulation config, the seed will be 0.
|
|
78
|
-
base_noise_seed :
|
|
79
|
-
Base seed used for the noise stimuli in the simulation.
|
|
80
|
-
Not setting this will result in the default Neurodamus
|
|
81
|
-
behavior (i.e. seed=0)
|
|
82
|
-
Has to positive integer.
|
|
83
77
|
rng_mode : String with rng mode, if not specified mode is taken from
|
|
84
78
|
simulation config. Possible values are Compatibility, Random123
|
|
85
79
|
and UpdatedMCell.
|
|
@@ -103,8 +97,7 @@ class SSim:
|
|
|
103
97
|
self.rng_settings = bluecellulab.RNGSettings(
|
|
104
98
|
rng_mode,
|
|
105
99
|
self.circuit_access,
|
|
106
|
-
base_seed=base_seed
|
|
107
|
-
base_noise_seed=base_noise_seed)
|
|
100
|
+
base_seed=base_seed)
|
|
108
101
|
|
|
109
102
|
self.cells: CellDict = CellDict()
|
|
110
103
|
|
|
@@ -549,7 +542,9 @@ class SSim:
|
|
|
549
542
|
syn_description,
|
|
550
543
|
syn_connection_parameters,
|
|
551
544
|
popids=popids,
|
|
552
|
-
mini_frequencies=mini_frequencies
|
|
545
|
+
mini_frequencies=mini_frequencies,
|
|
546
|
+
base_seed=None
|
|
547
|
+
)
|
|
553
548
|
|
|
554
549
|
def run(
|
|
555
550
|
self,
|
|
@@ -7,14 +7,14 @@ bluecellulab/neuron_interpreter.py,sha256=XPbQtOPIDk-sGydl4wuanOIeKl_rWvncXEsawe
|
|
|
7
7
|
bluecellulab/plotwindow.py,sha256=bJQISwpo_pRF0qlhPfSknPEdDXu6ygEdO8CQAX1qD2I,2800
|
|
8
8
|
bluecellulab/psection.py,sha256=RxXZLD5F9iWW9oettm5QROPJd4zpshkMVQmxBkbpJsQ,6077
|
|
9
9
|
bluecellulab/psegment.py,sha256=qQaUM4CCJ4JHLvDblN0Wc4IusKoAukASuP1pfk2p0zg,3309
|
|
10
|
-
bluecellulab/rngsettings.py,sha256=
|
|
11
|
-
bluecellulab/ssim.py,sha256=
|
|
10
|
+
bluecellulab/rngsettings.py,sha256=2LIZLroSDjlwsoWFFK1IO2fPMSALga-f3a0_scGVHaM,3999
|
|
11
|
+
bluecellulab/ssim.py,sha256=jxB1UbU4ozLrNRM3pl60yGN4_3L7LfqaOzb5Rc94Wq8,33543
|
|
12
12
|
bluecellulab/stimuli.py,sha256=LEsz_OBgM_ZHVbp2fPEVZ7VmruEMHQh8ZPp-qMzhvqU,15474
|
|
13
13
|
bluecellulab/tools.py,sha256=O1w_K-KTn2vLGSNmGtaxdQ9SrjvW54VxFo_Q86Og6l8,25287
|
|
14
14
|
bluecellulab/type_aliases.py,sha256=pXoiQjKEpqJKTZvHv1QVGHTJXxDFUn1slMemu3JWV_w,276
|
|
15
15
|
bluecellulab/cell/__init__.py,sha256=Sbc0QOsJ8E7tSwf3q7fsXuE_SevBN6ZmoCVyyU5zfII,208
|
|
16
16
|
bluecellulab/cell/cell_dict.py,sha256=BKpJLYLrJCffKGak4EfGZtgus_u0Scz0NKas7tY31vE,1346
|
|
17
|
-
bluecellulab/cell/core.py,sha256=
|
|
17
|
+
bluecellulab/cell/core.py,sha256=e8njZj09OEl0V1PCt34mqqEVA7s8Gfu3DgnZxmpCunI,37703
|
|
18
18
|
bluecellulab/cell/injector.py,sha256=HtKY1ok-Fv8HpEt8D-iVb7AhR_CeL_gwTf7odhBVUb4,16938
|
|
19
19
|
bluecellulab/cell/plotting.py,sha256=K_oDLeweEK-2LpiIzuZqG0Fd6cSQHoCN2vxuZsWteFs,4123
|
|
20
20
|
bluecellulab/cell/random.py,sha256=s8Kf0q24fiA5rBdVCVbIdDMQGCDfQcwLwXRB72p1e1g,1773
|
|
@@ -27,7 +27,7 @@ bluecellulab/cell/ballstick/__init__.py,sha256=vywMSPAeTuCcK_E9gD8UX2XD1KfKbfCVF
|
|
|
27
27
|
bluecellulab/cell/ballstick/emodel.hoc,sha256=7WcuepK-wB9bASRvNdCwO9Woc9-SpBCFqBqCXKgjsV8,1517
|
|
28
28
|
bluecellulab/cell/ballstick/morphology.asc,sha256=EO0VIRilJAwpiDP2hIevwusfvYptNYhvsu1f5GgbSQo,190
|
|
29
29
|
bluecellulab/circuit/__init__.py,sha256=Khpa13nzNvDlDS2JduyoFTukEduEkWCc5ML_JwGpmZs,361
|
|
30
|
-
bluecellulab/circuit/circuit_access.py,sha256=
|
|
30
|
+
bluecellulab/circuit/circuit_access.py,sha256=xXxbfR1Kgh-922W32n49M_J-IWTL-khq5vv-63IA24M,27703
|
|
31
31
|
bluecellulab/circuit/format.py,sha256=Q_YENbm45st6JjW80oMOOnLPdzKeVJh5nS_HHq1oj8g,1674
|
|
32
32
|
bluecellulab/circuit/iotools.py,sha256=R_iDo1CM0X5z0SF_QtV4Ol4k5xX8kerE7n5djaY4Fxo,1591
|
|
33
33
|
bluecellulab/circuit/node_id.py,sha256=OFNNt4g8w4Z6ZTh0qsbHqdSrWdftDp--tDaq_0-bLd8,1265
|
|
@@ -48,9 +48,9 @@ bluecellulab/simulation/simulation.py,sha256=Q114zkk_qUAoU55Aw8jv8Q3QmaD7FhnTkhK
|
|
|
48
48
|
bluecellulab/synapse/__init__.py,sha256=RW8XoAMXOvK7OG1nHl_q8jSEKLj9ZN4oWf2nY9HAwuk,192
|
|
49
49
|
bluecellulab/synapse/synapse_factory.py,sha256=EU8x2sEDAVLoXuERFZizlEb6-VGcB4F4_qeIBAi9dho,3754
|
|
50
50
|
bluecellulab/synapse/synapse_types.py,sha256=ZPNvjsOClUY4xSfY3aF4cbH9yxhRPhoTS4IDEocfZnA,17180
|
|
51
|
-
bluecellulab-1.5.
|
|
52
|
-
bluecellulab-1.5.
|
|
53
|
-
bluecellulab-1.5.
|
|
54
|
-
bluecellulab-1.5.
|
|
55
|
-
bluecellulab-1.5.
|
|
56
|
-
bluecellulab-1.5.
|
|
51
|
+
bluecellulab-1.5.2.dist-info/AUTHORS.txt,sha256=EDs3H-2HXBojbma10psixk3C2rFiOCTIREi2ZAbXYNQ,179
|
|
52
|
+
bluecellulab-1.5.2.dist-info/LICENSE,sha256=xOouu1gC1GGklDxkITlaVl60I9Ab860O-nZsFbWydvU,11749
|
|
53
|
+
bluecellulab-1.5.2.dist-info/METADATA,sha256=aHYLzURIxA0mLaUFs8IWypvZ1dSunXlGzHGD4g3rxeM,6558
|
|
54
|
+
bluecellulab-1.5.2.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
|
|
55
|
+
bluecellulab-1.5.2.dist-info/top_level.txt,sha256=VSyEP8w9l3pXdRkyP_goeMwiNA8KWwitfAqUkveJkdQ,13
|
|
56
|
+
bluecellulab-1.5.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|