Skip to content

Add noise stimuli in StimulusFactory #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Feb 28, 2025
8 changes: 4 additions & 4 deletions bluecellulab/analysis/inject_sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Recording(NamedTuple):
current: np.ndarray
voltage: np.ndarray
time: np.ndarray
spike: np.ndarray | None
spike: Optional[np.ndarray] = None


StimulusRecordings = Dict[str, Recording]
Expand All @@ -46,7 +46,7 @@ def run_stimulus(
recording_section: str = "soma[0]",
recording_segment: float = 0.5,
enable_spike_detection: bool = False,
threshold_spike_detection: float = -30,
threshold_spike_detection: float = -30.0,
) -> Recording:
"""Creates a cell from template parameters, applies a stimulus, and records
the response.
Expand Down Expand Up @@ -135,9 +135,9 @@ def apply_multiple_stimuli(
stimulus_name: StimulusName,
amplitudes: Sequence[float],
threshold_based: bool = True,
section_name: str | None = None,
section_name: Optional[str] = None,
segment: float = 0.5,
n_processes: int | None = None,
n_processes: Optional[int] = None,
cvode: bool = True,
add_hypamp: bool = True,
) -> StimulusRecordings:
Expand Down
2 changes: 1 addition & 1 deletion bluecellulab/cell/injector.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ def _get_ornstein_uhlenbeck_rand(self, stim_count, seed):
rng = neuron.h.Random()
rng.Random123(seed1, seed2, seed3)
else:
raise BluecellulabError("Shot noise stimulus requires Random123")
raise BluecellulabError("Ornstein-Uhlenbeck noise stimulus requires Random123")

self.persistent.append(rng)
return rng
Expand Down
Loading