bluecellulab 2.6.45__tar.gz → 2.6.46__tar.gz

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.

Files changed (106) hide show
  1. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/PKG-INFO +1 -1
  2. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/stimulus/factory.py +36 -5
  3. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/stimulus/stimulus.py +66 -0
  4. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab.egg-info/PKG-INFO +1 -1
  5. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/.compile_mod.sh +0 -0
  6. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/.gitattributes +0 -0
  7. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/.github/dependabot.yml +0 -0
  8. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/.github/workflows/release.yml +0 -0
  9. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/.github/workflows/test.yml +0 -0
  10. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/.gitignore +0 -0
  11. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/.gitlab-ci.yml +0 -0
  12. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/.readthedocs.yml +0 -0
  13. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/.zenodo.json +0 -0
  14. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/AUTHORS.txt +0 -0
  15. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/CHANGELOG.rst +0 -0
  16. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/CITATION.cff +0 -0
  17. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/CONTRIBUTING.rst +0 -0
  18. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/LICENSE +0 -0
  19. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/MANIFEST.in +0 -0
  20. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/Makefile +0 -0
  21. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/README.rst +0 -0
  22. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/__init__.py +0 -0
  23. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/analysis/__init__.py +0 -0
  24. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/analysis/analysis.py +0 -0
  25. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/analysis/inject_sequence.py +0 -0
  26. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/analysis/plotting.py +0 -0
  27. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/cell/__init__.py +0 -0
  28. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/cell/ballstick/__init__.py +0 -0
  29. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/cell/ballstick/emodel.hoc +0 -0
  30. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/cell/ballstick/morphology.asc +0 -0
  31. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/cell/cell_dict.py +0 -0
  32. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/cell/core.py +0 -0
  33. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/cell/injector.py +0 -0
  34. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/cell/plotting.py +0 -0
  35. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/cell/random.py +0 -0
  36. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/cell/recording.py +0 -0
  37. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/cell/section_distance.py +0 -0
  38. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/cell/serialized_sections.py +0 -0
  39. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/cell/sonata_proxy.py +0 -0
  40. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/cell/stimuli_generator.py +0 -0
  41. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/cell/template.py +0 -0
  42. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/circuit/__init__.py +0 -0
  43. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/circuit/circuit_access/__init__.py +0 -0
  44. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/circuit/circuit_access/bluepy_circuit_access.py +0 -0
  45. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/circuit/circuit_access/definition.py +0 -0
  46. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/circuit/circuit_access/sonata_circuit_access.py +0 -0
  47. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/circuit/config/__init__.py +0 -0
  48. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/circuit/config/bluepy_simulation_config.py +0 -0
  49. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/circuit/config/definition.py +0 -0
  50. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/circuit/config/sections.py +0 -0
  51. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/circuit/config/sonata_simulation_config.py +0 -0
  52. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/circuit/format.py +0 -0
  53. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/circuit/iotools.py +0 -0
  54. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/circuit/node_id.py +0 -0
  55. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/circuit/simulation_access.py +0 -0
  56. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/circuit/synapse_properties.py +0 -0
  57. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/circuit/validate.py +0 -0
  58. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/circuit_simulation.py +0 -0
  59. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/connection.py +0 -0
  60. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/dendrogram.py +0 -0
  61. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/exceptions.py +0 -0
  62. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/graph.py +0 -0
  63. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/hoc/Cell.hoc +0 -0
  64. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/hoc/RNGSettings.hoc +0 -0
  65. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/hoc/TDistFunc.hoc +0 -0
  66. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/hoc/TStim.hoc +0 -0
  67. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/hoc/fileUtils.hoc +0 -0
  68. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/importer.py +0 -0
  69. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/neuron_interpreter.py +0 -0
  70. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/plotwindow.py +0 -0
  71. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/psection.py +0 -0
  72. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/psegment.py +0 -0
  73. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/rngsettings.py +0 -0
  74. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/simulation/__init__.py +0 -0
  75. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/simulation/neuron_globals.py +0 -0
  76. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/simulation/parallel.py +0 -0
  77. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/simulation/simulation.py +0 -0
  78. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/stimulus/__init__.py +0 -0
  79. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/stimulus/circuit_stimulus_definitions.py +0 -0
  80. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/synapse/__init__.py +0 -0
  81. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/synapse/synapse_factory.py +0 -0
  82. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/synapse/synapse_types.py +0 -0
  83. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/tools.py +0 -0
  84. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/type_aliases.py +0 -0
  85. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/utils.py +0 -0
  86. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab/verbosity.py +0 -0
  87. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab.egg-info/SOURCES.txt +0 -0
  88. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab.egg-info/dependency_links.txt +0 -0
  89. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab.egg-info/requires.txt +0 -0
  90. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/bluecellulab.egg-info/top_level.txt +0 -0
  91. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/docs/Makefile +0 -0
  92. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/docs/images/voltage-readme.png +0 -0
  93. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/docs/make.bat +0 -0
  94. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/docs/requirements_docs.txt +0 -0
  95. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/docs/source/_static/.gitkeep +0 -0
  96. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/docs/source/api.rst +0 -0
  97. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/docs/source/changelog.rst +0 -0
  98. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/docs/source/compiling-mechanisms.rst +0 -0
  99. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/docs/source/conf.py +0 -0
  100. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/docs/source/contributing.rst +0 -0
  101. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/docs/source/index.rst +0 -0
  102. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/docs/source/list_of_stim.rst +0 -0
  103. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/docs/source/logo/BlueCelluLabBanner.jpg +0 -0
  104. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/pyproject.toml +0 -0
  105. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/setup.cfg +0 -0
  106. {bluecellulab-2.6.45 → bluecellulab-2.6.46}/tox.ini +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: bluecellulab
3
- Version: 2.6.45
3
+ Version: 2.6.46
4
4
  Summary: Biologically detailed neural network simulations and analysis.
5
5
  Author: Blue Brain Project, EPFL
6
6
  License: Apache2.0
@@ -16,8 +16,7 @@
16
16
  from __future__ import annotations
17
17
  from typing import Optional
18
18
  import logging
19
- from bluecellulab.stimulus.stimulus import DelayedZap, Empty, Ramp, Slope, Step, StepNoise, Stimulus, OrnsteinUhlenbeck, ShotNoise, Sinusoidal
20
- from bluecellulab.stimulus.circuit_stimulus_definitions import Stimulus as CircuitStimulus
19
+ from bluecellulab.stimulus.stimulus import DelayedZap, Empty, Ramp, Slope, Step, StepNoise, Stimulus, OrnsteinUhlenbeck, ShotNoise, Sinusoidal, Pulse
21
20
 
22
21
  logger = logging.getLogger(__name__)
23
22
 
@@ -678,6 +677,38 @@ class StimulusFactory:
678
677
 
679
678
  raise TypeError("You must provide either `mean` and `sigma`, or `threshold_current` and `mean_percent` and `sigma_percent` with percentage values.")
680
679
 
681
- def from_sonata(cls, circuit_stimulus: CircuitStimulus):
682
- """Convert a SONATA stimulus into a factory-based stimulus."""
683
- raise ValueError(f"Unsupported circuit stimulus type: {type(circuit_stimulus)}")
680
+ def pulse(
681
+ self,
682
+ pre_delay: float,
683
+ duration: float,
684
+ post_delay: float,
685
+ frequency: float,
686
+ width: float,
687
+ threshold_current: Optional[float] = None,
688
+ threshold_percentage: Optional[float] = None,
689
+ amplitude: Optional[float] = None,
690
+ ) -> Stimulus:
691
+ """Creates a pulse stimulus.
692
+
693
+ Args:
694
+ threshold_current: The threshold current of the Cell.
695
+ threshold_percentage: Percentage of desired threshold_current amplification.
696
+ amplitude: Raw amplitude of input current.
697
+ pre_delay: Delay before the first pulse (ms).
698
+ duration: Duration of the pulse train (ms).
699
+ post_delay: Delay after the last pulse (ms).
700
+ frequency: Frequency of the pulses (Hz).
701
+ width: Width of each pulse (ms).
702
+ """
703
+ if amplitude is not None:
704
+ if threshold_current is not None and threshold_current != 0 and threshold_percentage is not None:
705
+ logger.info(
706
+ "amplitude, threshold_current and threshold_percentage are all set in pulse."
707
+ " Will only keep amplitude value."
708
+ )
709
+ return Pulse.amplitude_based(self.dt, pre_delay, duration, post_delay, amplitude, frequency, width)
710
+
711
+ if threshold_current is not None and threshold_current != 0 and threshold_percentage is not None:
712
+ return Pulse.threshold_based(self.dt, pre_delay, duration, post_delay, threshold_current, threshold_percentage, frequency, width)
713
+
714
+ raise TypeError("You have to give either threshold_current or amplitude")
@@ -369,6 +369,41 @@ class SinusoidalWave(Stimulus):
369
369
  return np.array(tvec.to_python()), np.array(stim.to_python())
370
370
 
371
371
 
372
+ class PulseTrain(Stimulus):
373
+ """Generates a pulse train signal."""
374
+
375
+ def __init__(self, dt: float, duration: float, amplitude: float, frequency: float, width: float):
376
+ super().__init__(dt)
377
+ self.duration = duration
378
+ self.amplitude = amplitude
379
+ self.frequency = frequency
380
+ self.width = width
381
+
382
+ self._time, self._current = self._generate_pulse_train()
383
+
384
+ @property
385
+ def time(self) -> np.ndarray:
386
+ return self._time
387
+
388
+ @property
389
+ def current(self) -> np.ndarray:
390
+ return self._current
391
+
392
+ def _generate_pulse_train(self):
393
+ total_duration = self.duration
394
+ time_steps = int(total_duration / self.dt)
395
+ time = np.linspace(0, total_duration, time_steps)
396
+ current = np.zeros_like(time)
397
+
398
+ start_time = 0
399
+ while start_time + self.width < self.duration:
400
+ pulse_indices = (time >= start_time) & (time < start_time + self.width)
401
+ current[pulse_indices] = self.amplitude
402
+ start_time += 1000.0 / self.frequency
403
+
404
+ return time, current
405
+
406
+
372
407
  class Step(Stimulus):
373
408
 
374
409
  def __init__(self):
@@ -878,3 +913,34 @@ class Sinusoidal(Stimulus):
878
913
  amplitude=amplitude,
879
914
  frequency=frequency,
880
915
  )
916
+
917
+
918
+ class Pulse(Stimulus):
919
+ """Factory-compatible Pulse Stimulus."""
920
+
921
+ def __init__(self):
922
+ """Prevents direct instantiation of the class."""
923
+ raise NotImplementedError(
924
+ "This class cannot be instantiated directly. "
925
+ "Please use 'amplitude_based' or 'threshold_based' methods."
926
+ )
927
+
928
+ @classmethod
929
+ def amplitude_based(
930
+ cls, dt: float, pre_delay: float, duration: float, post_delay: float, amplitude: float, frequency: float, width: float
931
+ ) -> CombinedStimulus:
932
+ """Creates a Pulse stimulus from given time events and amplitude."""
933
+ return (
934
+ Empty(dt, duration=pre_delay)
935
+ + PulseTrain(dt, duration, amplitude, frequency, width)
936
+ + Empty(dt, duration=post_delay)
937
+ )
938
+
939
+ @classmethod
940
+ def threshold_based(
941
+ cls, dt: float, pre_delay: float, duration: float, post_delay: float, threshold_current: float, threshold_percentage: float,
942
+ frequency: float, width: float
943
+ ) -> CombinedStimulus:
944
+ """Creates a Pulse stimulus with respect to the threshold current."""
945
+ amplitude = threshold_current * (threshold_percentage / 100)
946
+ return cls.amplitude_based(dt, pre_delay, duration, post_delay, amplitude, frequency, width)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: bluecellulab
3
- Version: 2.6.45
3
+ Version: 2.6.46
4
4
  Summary: Biologically detailed neural network simulations and analysis.
5
5
  Author: Blue Brain Project, EPFL
6
6
  License: Apache2.0
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes