bluecellulab 2.5.3__py3-none-any.whl → 2.5.5__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/__init__.py CHANGED
@@ -18,7 +18,7 @@ from .psection import PSection # NOQA
18
18
  from .psegment import PSegment # NOQA
19
19
  from .simulation import Simulation # NOQA
20
20
  from .rngsettings import RNGSettings # NOQA
21
- from .ssim import SSim # NOQA
21
+ from .circuit_simulation import CircuitSimulation, CircuitSimulation # NOQA
22
22
 
23
23
 
24
24
  from .simulation.neuron_globals import NeuronGlobals
@@ -57,7 +57,6 @@ class BluepyCircuitAccess:
57
57
  raise FileNotFoundError(
58
58
  f"Circuit config file {simulation_config} not found.")
59
59
 
60
- # to allow the usage of SimulationConfig outside of Ssim
61
60
  if isinstance(simulation_config, BluepySimulationConfig):
62
61
  simulation_config = simulation_config.impl
63
62
 
@@ -32,7 +32,7 @@ def parse_outdat(path: str | Path) -> dict[CellId, np.ndarray]:
32
32
  # convert Series to DataFrame with 2 columns for `groupby` operation
33
33
  spike_df = spikes.to_frame().reset_index()
34
34
  if (spike_df["t"] < 0).any():
35
- logger.warning('SSim: Found negative spike times in out.dat ! '
35
+ logger.warning('Found negative spike times in out.dat ! '
36
36
  'Clipping them to 0')
37
37
  spike_df["t"].clip(lower=0., inplace=True)
38
38
 
@@ -25,6 +25,8 @@ import neuron
25
25
  import numpy as np
26
26
  import pandas as pd
27
27
  from pydantic.types import NonNegativeInt
28
+ from typing_extensions import deprecated
29
+
28
30
  import bluecellulab
29
31
  from bluecellulab.cell import CellDict
30
32
  from bluecellulab.cell.sonata_proxy import SonataProxy
@@ -53,9 +55,14 @@ from bluecellulab.synapse.synapse_types import SynapseID
53
55
  logger = logging.getLogger(__name__)
54
56
 
55
57
 
58
+ @deprecated("SSim will be removed, use CircuitSimulation instead.")
56
59
  class SSim:
57
60
  """Class that loads a circuit simulation to do cell simulations."""
58
61
 
62
+
63
+ class CircuitSimulation:
64
+ """Class that loads a circuit simulation to do cell simulations."""
65
+
59
66
  @load_mod_files
60
67
  def __init__(
61
68
  self,
@@ -219,16 +226,17 @@ class SSim:
219
226
  }
220
227
 
221
228
  if self.gids_instantiated:
222
- raise Exception("SSim: instantiate_gids() called twice on the \
223
- same SSim, this is not supported yet")
229
+ raise BluecellulabError(
230
+ "instantiate_gids() is called twice on the "
231
+ "same CircuitSimumation, this is not supported")
224
232
  else:
225
233
  self.gids_instantiated = True
226
234
 
227
235
  if pre_spike_trains or add_replay:
228
236
  if add_synapses is False:
229
- raise Exception("SSim: you need to set add_synapses to True "
230
- "if you want to specify use add_replay or "
231
- "pre_spike_trains")
237
+ raise BluecellulabError("You need to set add_synapses to True "
238
+ "if you want to specify use add_replay or "
239
+ "pre_spike_trains")
232
240
 
233
241
  if add_projections is True:
234
242
  projections = self.circuit_access.config.get_all_projection_names()
@@ -245,8 +253,8 @@ class SSim:
245
253
  projections=projections)
246
254
  if add_replay or interconnect_cells or pre_spike_trains:
247
255
  if add_replay and not add_synapses:
248
- raise Exception("SSim: add_replay option can not be used if "
249
- "add_synapses is False")
256
+ raise BluecellulabError("add_replay option can not be used if "
257
+ "add_synapses is False")
250
258
  self._add_connections(add_replay=add_replay,
251
259
  interconnect_cells=interconnect_cells,
252
260
  user_pre_spike_trains=pre_spike_trains) # type: ignore
@@ -549,7 +557,7 @@ class SSim:
549
557
  cvode: bool = False,
550
558
  show_progress: bool = False,
551
559
  ):
552
- """Simulate the SSim.
560
+ """Simulate the Circuit.
553
561
 
554
562
  Parameters
555
563
  ----------
@@ -705,7 +713,7 @@ class SSim:
705
713
  return voltage
706
714
 
707
715
  def delete(self):
708
- """Delete ssim and all of its attributes.
716
+ """Delete CircuitSimulation and all of its attributes.
709
717
 
710
718
  NEURON objects are explicitly needed to be deleted.
711
719
  """
@@ -105,7 +105,7 @@ class RNGSettings:
105
105
  options = {"Compatibility": 0, "Random123": 1, "UpdatedMCell": 2}
106
106
  if new_val not in options:
107
107
  raise UndefinedRNGException(
108
- "SSim: RNG mode %s not in accepted list: %s"
108
+ "RNG mode's value %s is not in the accepted list: %s"
109
109
  % (self.mode, list(options.keys()))
110
110
  )
111
111
  else:
bluecellulab/tools.py CHANGED
@@ -151,9 +151,9 @@ def holding_current(
151
151
  ) -> Tuple[float, float]:
152
152
  """Calculate the holding current necessary for a given holding voltage."""
153
153
  cell_id = bluecellulab.circuit.node_id.create_cell_id(cell_id)
154
- ssim = bluecellulab.SSim(circuit_path)
154
+ circuit_sim = bluecellulab.CircuitSimulation(circuit_path)
155
155
 
156
- cell_kwargs = ssim.fetch_cell_kwargs(cell_id)
156
+ cell_kwargs = circuit_sim.fetch_cell_kwargs(cell_id)
157
157
  with IsolatedProcess() as runner:
158
158
  i_hold, v_control = runner.apply(
159
159
  holding_current_subprocess, [v_hold, enable_ttx, cell_kwargs]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: bluecellulab
3
- Version: 2.5.3
3
+ Version: 2.5.5
4
4
  Summary: The Pythonic Blue Brain simulator access
5
5
  Author: Blue Brain Project, EPFL
6
6
  License: Apache2.0
@@ -1,4 +1,5 @@
1
- bluecellulab/__init__.py,sha256=yC97iFnCVDtwqspxdpt4C-qq9vQF7AMJOWe1h_cB0Wc,827
1
+ bluecellulab/__init__.py,sha256=-DopR1_1ji4NQlsRi4fLSUETM358o6UCdJtnhQ8wrQA,873
2
+ bluecellulab/circuit_simulation.py,sha256=Tbw8y-4lT06nxyK9v_i7KMDu0BK-OI14na3Ao_9u7Po,33680
2
3
  bluecellulab/connection.py,sha256=volV2YKtmqAF7MOEJar5ldF1ARAo7k2vF9MB1NXybUY,4640
3
4
  bluecellulab/dendrogram.py,sha256=w0vvv0Q169DolTX1j9dAZIvHIl4H258gAjQ1xQaNiGk,6427
4
5
  bluecellulab/exceptions.py,sha256=KIxF7s_7gPVJ07TiQ-Z1D8de7ylV74gNMhzl0339CVM,2379
@@ -8,9 +9,8 @@ bluecellulab/neuron_interpreter.py,sha256=hXig_u3T6JmEHbkV8ZblEZtX0kY80ate4VpRtA
8
9
  bluecellulab/plotwindow.py,sha256=UVHzml-BB83m5Qr-YGkjR9kB-vSW8mM0Owh2j95yIaU,2721
9
10
  bluecellulab/psection.py,sha256=EgAS8IS9DcYv2xOkNISgfg_CfRc0nDfRFjvgQhyi9eY,6328
10
11
  bluecellulab/psegment.py,sha256=rBryDYHC_uDK9itfXXrFZ0DL9F6WgRICL0j5EHN56QM,3125
11
- bluecellulab/rngsettings.py,sha256=KACk4ujPXhlHL9iAoTdAjjLuFEcUoG6aes92ZClSoQQ,4228
12
- bluecellulab/ssim.py,sha256=radFcT2lWRfb1C0zKlqw0JQ6JY4b9LJiDP9JDPeQIqs,33399
13
- bluecellulab/tools.py,sha256=8QMNdmh9lRDOWT4kz9cI_MYNVh4ulxgY8CtHZbaMbkA,11056
12
+ bluecellulab/rngsettings.py,sha256=Dlt34dc4AoWyxCCzUK3Jlui90VCK20xHg6gD_OJzPIw,4237
13
+ bluecellulab/tools.py,sha256=tS0lth0La-HE13EXsfXlPro1O2lAaEBSL4ZdvMsy6jw,11083
14
14
  bluecellulab/type_aliases.py,sha256=DvgjERv2Ztdw_sW63JrZTQGpJ0x5uMTFB5hcBHDb0WA,441
15
15
  bluecellulab/utils.py,sha256=fgqjgy3xzyL0zu-qjCPJdHp6PEAHADCzlr2FqyBmzHI,2012
16
16
  bluecellulab/verbosity.py,sha256=T0IgX7DrRo19faxrT4Xzb27gqxzoILQ8FzYKxvUeaPM,1342
@@ -33,13 +33,13 @@ bluecellulab/cell/ballstick/emodel.hoc,sha256=7WcuepK-wB9bASRvNdCwO9Woc9-SpBCFqB
33
33
  bluecellulab/cell/ballstick/morphology.asc,sha256=EO0VIRilJAwpiDP2hIevwusfvYptNYhvsu1f5GgbSQo,190
34
34
  bluecellulab/circuit/__init__.py,sha256=Khpa13nzNvDlDS2JduyoFTukEduEkWCc5ML_JwGpmZs,361
35
35
  bluecellulab/circuit/format.py,sha256=eYhiBIQnPnnVBmaSDymFjQprXN9QjEYKmFhb2mIS86o,1674
36
- bluecellulab/circuit/iotools.py,sha256=ERtrsl9KePZ0QFKiTi5lbBgudXbcHrqxr-BY2ysFfqg,1591
36
+ bluecellulab/circuit/iotools.py,sha256=KVE7x5LNQ4RgjNh05Q-h3Swpbs3nRFtrcWNHj62aiRI,1585
37
37
  bluecellulab/circuit/node_id.py,sha256=gaRAW3UhbPOPsoXMHLjo3qH9iNod7YB8ZOcguWprrU4,1265
38
38
  bluecellulab/circuit/simulation_access.py,sha256=QHVEN-sEZbCCvblhBHEShGX0-NEXCD1AYpavpVGCgAE,7073
39
39
  bluecellulab/circuit/synapse_properties.py,sha256=6PpMWeothomR2c-mx63yVIISJc4eSL9xMnaIM2nryNM,5494
40
40
  bluecellulab/circuit/validate.py,sha256=7EUN15u0JFFlLf389jUBqLwDOHyZdfKtoidI-xLUVYA,3593
41
41
  bluecellulab/circuit/circuit_access/__init__.py,sha256=sgp6m5kP-pq60V1IFGUiSUR1OW01zdxXNNUJmPA8anI,201
42
- bluecellulab/circuit/circuit_access/bluepy_circuit_access.py,sha256=j-DYHMBTbq1TvlYyc-w1CSyqElSm6B6SyUdkxIGNA20,14746
42
+ bluecellulab/circuit/circuit_access/bluepy_circuit_access.py,sha256=msAbAKH7XEPn77lTPA7-ntRiY-fCIxvLuA250gjo__Q,14681
43
43
  bluecellulab/circuit/circuit_access/definition.py,sha256=SnKBFEgdXFG-QexYRrGSzVAd7bSj7NwN0IuTsjDOrDY,4435
44
44
  bluecellulab/circuit/circuit_access/sonata_circuit_access.py,sha256=P1ElK_VA10_JyyKbAnqzuAlduEYE2c_NSec2TZuix1U,10345
45
45
  bluecellulab/circuit/config/__init__.py,sha256=aaoJXRKBJzpxxREo9NxKc-_CCPmVeuR1mcViRXcLrC4,215
@@ -61,9 +61,9 @@ bluecellulab/stimulus/factory.py,sha256=AOby3Sp2g8BJsRccz3afazfCyysyWIgLtcliWlye
61
61
  bluecellulab/synapse/__init__.py,sha256=RW8XoAMXOvK7OG1nHl_q8jSEKLj9ZN4oWf2nY9HAwuk,192
62
62
  bluecellulab/synapse/synapse_factory.py,sha256=YkvxbdGF-u-vxYdbRNTlX-9AtSC_3t_FQRFhybwzgrk,6805
63
63
  bluecellulab/synapse/synapse_types.py,sha256=4gne-hve2vq1Lau-LAVPsfLjffVYqAYBW3kCfC7_600,16871
64
- bluecellulab-2.5.3.dist-info/AUTHORS.txt,sha256=EDs3H-2HXBojbma10psixk3C2rFiOCTIREi2ZAbXYNQ,179
65
- bluecellulab-2.5.3.dist-info/LICENSE,sha256=xOouu1gC1GGklDxkITlaVl60I9Ab860O-nZsFbWydvU,11749
66
- bluecellulab-2.5.3.dist-info/METADATA,sha256=rYhJTsxGMFuS6MWaiwkByBjBpVxemuA3GoybjU0PgSM,7003
67
- bluecellulab-2.5.3.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
68
- bluecellulab-2.5.3.dist-info/top_level.txt,sha256=VSyEP8w9l3pXdRkyP_goeMwiNA8KWwitfAqUkveJkdQ,13
69
- bluecellulab-2.5.3.dist-info/RECORD,,
64
+ bluecellulab-2.5.5.dist-info/AUTHORS.txt,sha256=EDs3H-2HXBojbma10psixk3C2rFiOCTIREi2ZAbXYNQ,179
65
+ bluecellulab-2.5.5.dist-info/LICENSE,sha256=xOouu1gC1GGklDxkITlaVl60I9Ab860O-nZsFbWydvU,11749
66
+ bluecellulab-2.5.5.dist-info/METADATA,sha256=lF8ZtLbDD11XzdZ2JftoUhHD7OXew_TTknWwb1Mf9x4,7003
67
+ bluecellulab-2.5.5.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
68
+ bluecellulab-2.5.5.dist-info/top_level.txt,sha256=VSyEP8w9l3pXdRkyP_goeMwiNA8KWwitfAqUkveJkdQ,13
69
+ bluecellulab-2.5.5.dist-info/RECORD,,