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

@@ -21,6 +21,7 @@ from pathlib import Path
21
21
  import re
22
22
  import string
23
23
  from typing import NamedTuple, Optional
24
+ import uuid
24
25
 
25
26
  import neuron
26
27
 
@@ -126,8 +127,8 @@ class NeuronTemplate:
126
127
  # templates load outside of bluecellulab
127
128
  template_name = "%s_bluecellulab" % template_name
128
129
  template_name = get_neuron_compliant_template_name(template_name)
129
- obj_address = hex(id(self))
130
- template_name = f"{template_name}_{obj_address}"
130
+ unique_id = uuid.uuid4().hex
131
+ template_name = f"{template_name}_{unique_id}"
131
132
 
132
133
  template_content = re.sub(
133
134
  r"begintemplate\s*(\S*)",
@@ -28,13 +28,14 @@ logger = logging.getLogger(__name__)
28
28
  class Simulation:
29
29
  """Class that represents a neuron simulation."""
30
30
 
31
- def __init__(self, parallel_context=None) -> None:
31
+ def __init__(self, parallel_context=None, custom_progress_function=None) -> None:
32
32
  self.cells: list[bluecellulab.Cell] = []
33
33
  self.fih_progress = None
34
34
  self.progress = None
35
35
  self.progress_closed = None
36
36
  self.progress_dt: Optional[float] = None
37
37
  self.pc = parallel_context
38
+ self.custom_progress_function = custom_progress_function
38
39
 
39
40
  def add_cell(self, new_cell: bluecellulab.Cell) -> None:
40
41
  """Add a cell to a simulation."""
@@ -50,26 +51,29 @@ class Simulation:
50
51
 
51
52
  def progress_callback(self):
52
53
  """Callback function for the progress bar."""
53
- if self.progress > 0:
54
- sys.stdout.write("\x1b[3F")
55
-
56
- self.progress += 1
57
- self.progress_closed = not self.progress_closed
58
- if self.progress_closed:
59
- sys.stdout.write(" %s%s%s \n" % (" " * (
60
- self.progress - 1), " ", " " * (100 - self.progress)))
61
- sys.stdout.write("[%s%s%s]\n" % ("#" * (
62
- self.progress - 1), "-", "." * (100 - self.progress)))
63
- sys.stdout.write(" %s%s%s \n" % (" " * (
64
- self.progress - 1), " ", " " * (100 - self.progress)))
54
+ if self.custom_progress_function is None:
55
+ if self.progress > 0:
56
+ sys.stdout.write("\x1b[3F")
57
+
58
+ self.progress += 1
59
+ self.progress_closed = not self.progress_closed
60
+ if self.progress_closed:
61
+ sys.stdout.write(" %s%s%s \n" % (" " * (
62
+ self.progress - 1), " ", " " * (100 - self.progress)))
63
+ sys.stdout.write("[%s%s%s]\n" % ("#" * (
64
+ self.progress - 1), "-", "." * (100 - self.progress)))
65
+ sys.stdout.write(" %s%s%s \n" % (" " * (
66
+ self.progress - 1), " ", " " * (100 - self.progress)))
67
+ else:
68
+ sys.stdout.write(" %s%s%s \n" % (" " * (
69
+ self.progress - 1), "/", " " * (100 - self.progress)))
70
+ sys.stdout.write("[%s%s%s]\n" % ("#" * (
71
+ self.progress - 1), ">", "." * (100 - self.progress)))
72
+ sys.stdout.write(" %s%s%s \n" % (" " * (
73
+ self.progress - 1), "\\", " " * (100 - self.progress)))
74
+ sys.stdout.flush()
65
75
  else:
66
- sys.stdout.write(" %s%s%s \n" % (" " * (
67
- self.progress - 1), "/", " " * (100 - self.progress)))
68
- sys.stdout.write("[%s%s%s]\n" % ("#" * (
69
- self.progress - 1), ">", "." * (100 - self.progress)))
70
- sys.stdout.write(" %s%s%s \n" % (" " * (
71
- self.progress - 1), "\\", " " * (100 - self.progress)))
72
- sys.stdout.flush()
76
+ self.custom_progress_function()
73
77
 
74
78
  neuron.h.cvode.event(
75
79
  neuron.h.t + self.progress_dt, self.progress_callback)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: bluecellulab
3
- Version: 2.6.33
3
+ Version: 2.6.35
4
4
  Summary: Biologically detailed neural network simulations and analysis.
5
5
  Author: Blue Brain Project, EPFL
6
6
  License: Apache2.0
@@ -27,7 +27,7 @@ bluecellulab/cell/section_distance.py,sha256=QrNJ_avRSm-PFZfSg-FrcCqu-BNZNwcbECw
27
27
  bluecellulab/cell/serialized_sections.py,sha256=5JfLNgrUKdyYe4mKFIH2zMnT5QohNB9JYXbe475goEg,1543
28
28
  bluecellulab/cell/sonata_proxy.py,sha256=1FsMDosS7fbffgY_shaBKVIXjkmxL5aiPLlxcgeAUsc,1529
29
29
  bluecellulab/cell/stimuli_generator.py,sha256=DwWX8Keed1KgKExwlD4u-h4WUhEXcsG7XPjJTxqfZaQ,7129
30
- bluecellulab/cell/template.py,sha256=TYkHR_6OiimycNu8TfNTmnVqjR9hURYHd5FOg5n5z2A,7562
30
+ bluecellulab/cell/template.py,sha256=JigOhRh52AX9nE25lDhYPUaDsTz7mhW-mUD-8x8tpoM,7573
31
31
  bluecellulab/cell/ballstick/__init__.py,sha256=v1Z8tHFfbpWShxOBdShCUaE0utoz-7rZumuNBQtNOFI,439
32
32
  bluecellulab/cell/ballstick/emodel.hoc,sha256=7WcuepK-wB9bASRvNdCwO9Woc9-SpBCFqBqCXKgjsV8,1517
33
33
  bluecellulab/cell/ballstick/morphology.asc,sha256=EO0VIRilJAwpiDP2hIevwusfvYptNYhvsu1f5GgbSQo,190
@@ -55,16 +55,16 @@ bluecellulab/hoc/fileUtils.hoc,sha256=LSM7BgyjYVqo2DGSOKvg4W8IIusbsL45JVYK0vgwit
55
55
  bluecellulab/simulation/__init__.py,sha256=P2ebt0SFw-08J3ihN-LeRn95HeF79tzA-Q0ReLm32dM,214
56
56
  bluecellulab/simulation/neuron_globals.py,sha256=iBjhg0-1YMP5LsVdtUDt24PEypkCL6mlyzEBZqoS8xo,4508
57
57
  bluecellulab/simulation/parallel.py,sha256=oQ_oV2EKr8gP4yF2Dq8q9MiblDyi89_wBgLzQkLV_U0,1514
58
- bluecellulab/simulation/simulation.py,sha256=Gqe_7dreCzgflME6AJ1BaJApkkEhRJzZdvDAPoH3tk4,6206
58
+ bluecellulab/simulation/simulation.py,sha256=VhftOMYU1Rfrphvud6f0U4kvbUivSviQ5TlVljuTb88,6486
59
59
  bluecellulab/stimulus/__init__.py,sha256=DgIgVaSyR-URf3JZzvO6j-tjCerzvktuK-ep8pjMRPQ,37
60
60
  bluecellulab/stimulus/circuit_stimulus_definitions.py,sha256=WdjxoPL4_T1yn3mEhxH-TvU7d441Kf4v5QwFfH30UNI,15890
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=NHwRMYMrnRVm_sHmyKTJ1bdoNmWZNU4UPOGu7FCi-PE,6987
64
64
  bluecellulab/synapse/synapse_types.py,sha256=zs_yBvGTH4QrbQF3nEViidyq1WM_ZcTSFdjUxB3khW0,16871
65
- bluecellulab-2.6.33.dist-info/AUTHORS.txt,sha256=EDs3H-2HXBojbma10psixk3C2rFiOCTIREi2ZAbXYNQ,179
66
- bluecellulab-2.6.33.dist-info/LICENSE,sha256=dAMAR2Sud4Nead1wGFleKiwTZfkTNZbzmuGfcTKb3kg,11335
67
- bluecellulab-2.6.33.dist-info/METADATA,sha256=3ndufGyyWmrAxJdp4nTwnAoil1KOISgChj12wRKkLeI,8059
68
- bluecellulab-2.6.33.dist-info/WHEEL,sha256=nCVcAvsfA9TDtwGwhYaRrlPhTLV9m-Ga6mdyDtuwK18,91
69
- bluecellulab-2.6.33.dist-info/top_level.txt,sha256=VSyEP8w9l3pXdRkyP_goeMwiNA8KWwitfAqUkveJkdQ,13
70
- bluecellulab-2.6.33.dist-info/RECORD,,
65
+ bluecellulab-2.6.35.dist-info/AUTHORS.txt,sha256=EDs3H-2HXBojbma10psixk3C2rFiOCTIREi2ZAbXYNQ,179
66
+ bluecellulab-2.6.35.dist-info/LICENSE,sha256=dAMAR2Sud4Nead1wGFleKiwTZfkTNZbzmuGfcTKb3kg,11335
67
+ bluecellulab-2.6.35.dist-info/METADATA,sha256=EtR134v7xet5fyknR6fD8Mt-dD0ZiO07l5gJNkuYCCA,8059
68
+ bluecellulab-2.6.35.dist-info/WHEEL,sha256=uCRv0ZEik_232NlR4YDw4Pv3Ajt5bKvMH13NUU7hFuI,91
69
+ bluecellulab-2.6.35.dist-info/top_level.txt,sha256=VSyEP8w9l3pXdRkyP_goeMwiNA8KWwitfAqUkveJkdQ,13
70
+ bluecellulab-2.6.35.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (73.0.0)
2
+ Generator: setuptools (74.1.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5