bluecellulab 2.6.15__py3-none-any.whl → 2.6.17__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.

@@ -37,6 +37,7 @@ def run_stimulus(
37
37
  stimulus: Stimulus,
38
38
  section: str,
39
39
  segment: float,
40
+ cvode: bool = True,
40
41
  ) -> Recording:
41
42
  """Creates a cell and stimulates it with a given stimulus.
42
43
 
@@ -45,6 +46,7 @@ def run_stimulus(
45
46
  stimulus: The input stimulus to inject into the cell.
46
47
  section: Name of the section of cell where the stimulus is to be injected.
47
48
  segment: The segment of the section where the stimulus is to be injected.
49
+ cvode: True to use variable time-steps. False for fixed time-steps.
48
50
 
49
51
  Returns:
50
52
  The voltage-time recording at the specified location.
@@ -61,7 +63,7 @@ def run_stimulus(
61
63
  current_vector = neuron.h.Vector()
62
64
  current_vector.record(iclamp._ref_i)
63
65
  simulation = Simulation(cell)
64
- simulation.run(stimulus.stimulus_time)
66
+ simulation.run(stimulus.stimulus_time, cvode=cvode)
65
67
  current = np.array(current_vector.to_python())
66
68
  voltage = cell.get_voltage_recording(neuron_section, segment)
67
69
  time = cell.get_time()
@@ -78,6 +80,7 @@ def apply_multiple_stimuli(
78
80
  section_name: str | None = None,
79
81
  segment: float = 0.5,
80
82
  n_processes: int | None = None,
83
+ cvode: bool = True,
81
84
  ) -> StimulusRecordings:
82
85
  """Apply multiple stimuli to the cell on isolated processes.
83
86
 
@@ -91,6 +94,7 @@ def apply_multiple_stimuli(
91
94
  If None, the stimuli are applied at the soma[0] of the cell.
92
95
  segment: The segment of the section where the stimuli are applied.
93
96
  n_processes: The number of processes to use for running the stimuli.
97
+ cvode: True to use variable time-steps. False for fixed time-steps.
94
98
 
95
99
  Returns:
96
100
  A dictionary where the keys are the names of the stimuli and the values
@@ -140,7 +144,7 @@ def apply_multiple_stimuli(
140
144
  else:
141
145
  raise ValueError("Unknown stimulus name.")
142
146
 
143
- task_args.append((cell.template_params, stimulus, section_name, segment))
147
+ task_args.append((cell.template_params, stimulus, section_name, segment, cvode))
144
148
 
145
149
  with IsolatedProcess(processes=n_processes) as pool:
146
150
  # Map expects a function and a list of argument tuples
bluecellulab/cell/core.py CHANGED
@@ -719,27 +719,26 @@ class Cell(InjectableMixin, PlottableMixin):
719
719
  pre_gid = CellId(
720
720
  source_population, int(synapse.syn_description[SynapseProperty.PRE_GID])
721
721
  )
722
- if self.sonata_proxy.circuit_access.target_contains_cell(stimulus.source, pre_gid):
723
- if pre_gid.id in synapse_spikes:
724
- spikes_of_interest = synapse_spikes[pre_gid.id]
725
- # filter spikes of interest >=stimulus.delay, <=stimulus.duration
726
- spikes_of_interest = spikes_of_interest[
727
- (spikes_of_interest >= stimulus.delay)
728
- & (spikes_of_interest <= stimulus.duration)
729
- ]
730
- connection = bluecellulab.Connection(
731
- synapse,
732
- pre_spiketrain=spikes_of_interest,
733
- pre_cell=None,
734
- stim_dt=self.record_dt,
735
- spike_threshold=spike_threshold,
736
- spike_location=spike_location,
737
- )
738
- logger.debug(
739
- f"Added synapse replay from {pre_gid} to {self.cell_id.id}, {synapse_id}"
740
- )
741
-
742
- self.connections[synapse_id] = connection
722
+ if pre_gid.id in synapse_spikes:
723
+ spikes_of_interest = synapse_spikes[pre_gid.id]
724
+ # filter spikes of interest >=stimulus.delay, <=stimulus.duration
725
+ spikes_of_interest = spikes_of_interest[
726
+ (spikes_of_interest >= stimulus.delay)
727
+ & (spikes_of_interest <= stimulus.duration)
728
+ ]
729
+ connection = bluecellulab.Connection(
730
+ synapse,
731
+ pre_spiketrain=spikes_of_interest,
732
+ pre_cell=None,
733
+ stim_dt=self.record_dt,
734
+ spike_threshold=spike_threshold,
735
+ spike_location=spike_location,
736
+ )
737
+ logger.debug(
738
+ f"Added synapse replay from {pre_gid} to {self.cell_id.id}, {synapse_id}"
739
+ )
740
+
741
+ self.connections[synapse_id] = connection
743
742
 
744
743
  @property
745
744
  def info_dict(self):
@@ -172,7 +172,7 @@ class SonataSimulationAccess:
172
172
 
173
173
 
174
174
  def get_synapse_replay_spikes(f_name: str) -> dict:
175
- """Read the .dat file containing the spike replays."""
175
+ """Read the .h5 file containing the spike replays."""
176
176
  with h5py.File(f_name, 'r') as f:
177
177
  # Access the timestamps and node_ids datasets
178
178
  timestamps = f['/spikes/All/timestamps'][:]
@@ -243,7 +243,6 @@ class Stimulus:
243
243
  delay=stimulus_entry["delay"],
244
244
  duration=stimulus_entry["duration"],
245
245
  spike_file=stimulus_entry["spike_file"],
246
- source=stimulus_entry["source"],
247
246
  )
248
247
  elif pattern == Pattern.SHOT_NOISE:
249
248
  return ShotNoise(
@@ -331,7 +330,6 @@ class RelativeLinear(Stimulus):
331
330
  @dataclass(frozen=True, config=dict(extra="forbid"))
332
331
  class SynapseReplay(Stimulus):
333
332
  spike_file: str
334
- source: str
335
333
 
336
334
  @field_validator("spike_file")
337
335
  @classmethod
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: bluecellulab
3
- Version: 2.6.15
3
+ Version: 2.6.17
4
4
  Summary: Biologically detailed neural network simulations and analysis.
5
5
  Author: Blue Brain Project, EPFL
6
6
  License: Apache2.0
@@ -15,10 +15,10 @@ bluecellulab/type_aliases.py,sha256=DvgjERv2Ztdw_sW63JrZTQGpJ0x5uMTFB5hcBHDb0WA,
15
15
  bluecellulab/utils.py,sha256=SbOOkzw1YGjCKV3qOw0zpabNEy7V9BRtgMLsQJiFRq4,1526
16
16
  bluecellulab/verbosity.py,sha256=T0IgX7DrRo19faxrT4Xzb27gqxzoILQ8FzYKxvUeaPM,1342
17
17
  bluecellulab/analysis/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
18
- bluecellulab/analysis/inject_sequence.py,sha256=K3166jDTikEMMfRPJvuqfC6VPdUfyK7Ua7_M9Tr6uZg,5738
18
+ bluecellulab/analysis/inject_sequence.py,sha256=6_OuUtUjmSvhCj5_mX-8ZnUpv5jXUHHYDYPUcV2m0eE,5958
19
19
  bluecellulab/cell/__init__.py,sha256=Sbc0QOsJ8E7tSwf3q7fsXuE_SevBN6ZmoCVyyU5zfII,208
20
20
  bluecellulab/cell/cell_dict.py,sha256=PVmZsjhZ9jp3HC-8QmdFqp-crAcVMSVeLWujcOPLlpo,1346
21
- bluecellulab/cell/core.py,sha256=ZVzy3tsA5X7OyCmnHQn0d6AlNg9rOG2ojKuojvKdsFw,31487
21
+ bluecellulab/cell/core.py,sha256=2UtXXd4FA2X5A_7ljjbN4yobpMWD2FWfux67ZFND2rI,31315
22
22
  bluecellulab/cell/injector.py,sha256=XC49VSHw78xCHzLJKO_-unnnVZAZXsYg5qbmZPx01AA,18091
23
23
  bluecellulab/cell/plotting.py,sha256=hW5KAmaSonJ1tgR6xRrnfVe33I5mBsBUrKJQwGvAbUc,4032
24
24
  bluecellulab/cell/random.py,sha256=FDby9BN4eJT27COwHP59bhDE2v-c6rdOKNFj3cYZTVY,1773
@@ -35,7 +35,7 @@ bluecellulab/circuit/__init__.py,sha256=Khpa13nzNvDlDS2JduyoFTukEduEkWCc5ML_JwGp
35
35
  bluecellulab/circuit/format.py,sha256=eYhiBIQnPnnVBmaSDymFjQprXN9QjEYKmFhb2mIS86o,1674
36
36
  bluecellulab/circuit/iotools.py,sha256=KVE7x5LNQ4RgjNh05Q-h3Swpbs3nRFtrcWNHj62aiRI,1585
37
37
  bluecellulab/circuit/node_id.py,sha256=gaRAW3UhbPOPsoXMHLjo3qH9iNod7YB8ZOcguWprrU4,1265
38
- bluecellulab/circuit/simulation_access.py,sha256=jrVz6pFNAuwvuvsTq9OqeDfjIZ5akE98RBMBNDwuDVQ,7062
38
+ bluecellulab/circuit/simulation_access.py,sha256=BGstSD0nkmW4AMRCztYcM6ehWj-XuznWUuG0vjs0aZI,7061
39
39
  bluecellulab/circuit/synapse_properties.py,sha256=a4-Yw_f8JIR6i2YG8qhCW97TMSd_Z-aF6lp_a1wBwnM,6374
40
40
  bluecellulab/circuit/validate.py,sha256=7EUN15u0JFFlLf389jUBqLwDOHyZdfKtoidI-xLUVYA,3593
41
41
  bluecellulab/circuit/circuit_access/__init__.py,sha256=sgp6m5kP-pq60V1IFGUiSUR1OW01zdxXNNUJmPA8anI,201
@@ -57,14 +57,14 @@ bluecellulab/simulation/neuron_globals.py,sha256=_8xmJPQMfCyhVn6KppK7i3jaUZaALML
57
57
  bluecellulab/simulation/parallel.py,sha256=oQ_oV2EKr8gP4yF2Dq8q9MiblDyi89_wBgLzQkLV_U0,1514
58
58
  bluecellulab/simulation/simulation.py,sha256=I__cZwV_A8I7XSefn6aJDBA_jXCI3E35-pCNCLUsnvo,6206
59
59
  bluecellulab/stimulus/__init__.py,sha256=DgIgVaSyR-URf3JZzvO6j-tjCerzvktuK-ep8pjMRPQ,37
60
- bluecellulab/stimulus/circuit_stimulus_definitions.py,sha256=uij_s44uNdmMwMLGmTHSRgmp9K9B_vvHHshX6YPJNJU,15686
60
+ bluecellulab/stimulus/circuit_stimulus_definitions.py,sha256=QztVteUUeMZolPMVjx-S-KgpahnQlbfTziJsJ_wCmaw,15621
61
61
  bluecellulab/stimulus/factory.py,sha256=XDbnqCuMCh1RdZLKvlRucMj3wkXDqy6mEda_Oh6Yqo4,19955
62
62
  bluecellulab/synapse/__init__.py,sha256=RW8XoAMXOvK7OG1nHl_q8jSEKLj9ZN4oWf2nY9HAwuk,192
63
63
  bluecellulab/synapse/synapse_factory.py,sha256=3y15LlaBoNJiU2KUeTkh70pyU5OYf6xQIMSBmmMPMak,6987
64
64
  bluecellulab/synapse/synapse_types.py,sha256=4gne-hve2vq1Lau-LAVPsfLjffVYqAYBW3kCfC7_600,16871
65
- bluecellulab-2.6.15.dist-info/AUTHORS.txt,sha256=EDs3H-2HXBojbma10psixk3C2rFiOCTIREi2ZAbXYNQ,179
66
- bluecellulab-2.6.15.dist-info/LICENSE,sha256=xOouu1gC1GGklDxkITlaVl60I9Ab860O-nZsFbWydvU,11749
67
- bluecellulab-2.6.15.dist-info/METADATA,sha256=qDL_gdXlfPzB7pl-AowRxYMoRKfd_nfsl-61bumRdtE,7054
68
- bluecellulab-2.6.15.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
69
- bluecellulab-2.6.15.dist-info/top_level.txt,sha256=VSyEP8w9l3pXdRkyP_goeMwiNA8KWwitfAqUkveJkdQ,13
70
- bluecellulab-2.6.15.dist-info/RECORD,,
65
+ bluecellulab-2.6.17.dist-info/AUTHORS.txt,sha256=EDs3H-2HXBojbma10psixk3C2rFiOCTIREi2ZAbXYNQ,179
66
+ bluecellulab-2.6.17.dist-info/LICENSE,sha256=xOouu1gC1GGklDxkITlaVl60I9Ab860O-nZsFbWydvU,11749
67
+ bluecellulab-2.6.17.dist-info/METADATA,sha256=mk1GlOKidaxD1TWN0ESwwmh8wBtYtrrzNFj7_-iGtv0,7054
68
+ bluecellulab-2.6.17.dist-info/WHEEL,sha256=y4mX-SOX4fYIkonsAGA5N0Oy-8_gI4FXw5HNI1xqvWg,91
69
+ bluecellulab-2.6.17.dist-info/top_level.txt,sha256=VSyEP8w9l3pXdRkyP_goeMwiNA8KWwitfAqUkveJkdQ,13
70
+ bluecellulab-2.6.17.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.43.0)
2
+ Generator: setuptools (70.2.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5