bluecellulab 1.5.1__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 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, synapse_id: tuple[str, int],
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, syn_id, syn_description, connection_parameters,
642
- base_seed=None, popids=(0, 0), mini_frequencies=None):
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 = syn_id[1]
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 connection_parameters:
663
- weight_scalar = connection_parameters['Weight']
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[syn_id]
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 connection_parameters:
674
- spont_minis_rate = connection_parameters['SpontMinis']
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[syn_id] = bluecellulab.neuron.h.\
689
+ self.ips[synapse_id] = bluecellulab.neuron.h.\
685
690
  InhPoissonStim(location, sec=sec)
686
691
 
687
- self.syn_mini_netcons[syn_id] = bluecellulab.neuron.h.\
688
- NetCon(self.ips[syn_id], synapse.hsynapse, sec=sec)
689
- self.syn_mini_netcons[syn_id].delay = 0.1
690
- self.syn_mini_netcons[syn_id].weight[0] = weight * weight_scalar
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[syn_id].weight[nc_type_param] = 1
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[syn_id].setRNGs(
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[syn_id].setRNGs(exprng, uniformrng)
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[syn_id].setTbins(tbins_vec)
751
- self.ips[syn_id].setRate(rate_vec)
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/ssim.py CHANGED
@@ -542,7 +542,9 @@ class SSim:
542
542
  syn_description,
543
543
  syn_connection_parameters,
544
544
  popids=popids,
545
- mini_frequencies=mini_frequencies)
545
+ mini_frequencies=mini_frequencies,
546
+ base_seed=None
547
+ )
546
548
 
547
549
  def run(
548
550
  self,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: bluecellulab
3
- Version: 1.5.1
3
+ Version: 1.5.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
@@ -8,13 +8,13 @@ bluecellulab/plotwindow.py,sha256=bJQISwpo_pRF0qlhPfSknPEdDXu6ygEdO8CQAX1qD2I,28
8
8
  bluecellulab/psection.py,sha256=RxXZLD5F9iWW9oettm5QROPJd4zpshkMVQmxBkbpJsQ,6077
9
9
  bluecellulab/psegment.py,sha256=qQaUM4CCJ4JHLvDblN0Wc4IusKoAukASuP1pfk2p0zg,3309
10
10
  bluecellulab/rngsettings.py,sha256=2LIZLroSDjlwsoWFFK1IO2fPMSALga-f3a0_scGVHaM,3999
11
- bluecellulab/ssim.py,sha256=-N2ZKFi_zLObhSK0fwEqfD6v026y7BUTan2LV_6nEv0,33490
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=tid1FQAsFEENsj90iNo_YX__KhDI-bmkmvoLlsyMfec,37392
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=GsszQLyxJjJdKa8WH9l3hpurH-dJ7ouyWwYfeKAMI-c,27619
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.1.dist-info/AUTHORS.txt,sha256=EDs3H-2HXBojbma10psixk3C2rFiOCTIREi2ZAbXYNQ,179
52
- bluecellulab-1.5.1.dist-info/LICENSE,sha256=xOouu1gC1GGklDxkITlaVl60I9Ab860O-nZsFbWydvU,11749
53
- bluecellulab-1.5.1.dist-info/METADATA,sha256=ODO2731Kd9uowbKQzpCcNGqidn7xPmrAvUIBPDEwxi0,6558
54
- bluecellulab-1.5.1.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
55
- bluecellulab-1.5.1.dist-info/top_level.txt,sha256=VSyEP8w9l3pXdRkyP_goeMwiNA8KWwitfAqUkveJkdQ,13
56
- bluecellulab-1.5.1.dist-info/RECORD,,
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,,