-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* SimulationResult & SimulationRecorder added * import and instantiate a SimulationResult during prepare * Implemented basic recorders for the NEURON adapter * NEST simulation spike recorders attempt * quick n dirty spike_detector solution, replace with device wrapper * recording from multiple mpi processes, and deleting all gdf * fix num_neurons: PsthRows now take the full matrix and count cells * added metadata required for plotting * NEST device protocols (#63) * added DeviceProtocols, a formalized way of wrapping NEST devices. * added tests * fixed get_device_protocol called * adapted PSTH plotting to new results data structure * Allow PSTH rows to be ordered * Callable mod kwarg to manipulate PSTH fig * SynapseRecorder basics, current and spike recorder still required * fixed black * skip empty connectivity sets and raise a warning. closes #70 * A "run_id" attr can be used to seperate spikes with identical cell ids * changed variable name from 'stimulus' to 'device' * Bad workaround: reinitialise new class of devices at prepare time * Added recorder mixins for meta and path * added patternless mixin for devices that don't need patterns * Fixed exception handling of recorders * Add all cell type keys to the statistics dict * Added Neuron exceptions * Caught missing cell model error * Added option to select all with `section_count` * Import all errors from .exceptions * Terminal relays without connections are also added to map. * Added cell_id metadata and fixed SpikeRecorder data * Added synapse recorder * Spike generator inputs can be recorded and are recorded by default * Small fixes * Record multiple vectors. Spikes are recorded by recording `_connections` * made the raster plot more robust * Fixed relays without targets on node being treated as cells. * Added synaptic multiplicity test * Realigned with never arborize version that doesn't deduplicate synapses * v3.4.0b0 - First BSB package for PizDaint * Fixed comment indent Co-authored-by: claudia casellato <claudia.casellato@unipv.it> Co-authored-by: Stefano Casali <scasali84@gmail.com> Co-authored-by: Luca Drera <luca.drera01@universitadipavia.it>
- Loading branch information
1 parent
7632b55
commit 7ea8fb7
Showing
17 changed files
with
664 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
__version__ = "3.3.0" | ||
__version__ = "3.4.0b0" | ||
|
||
from .reporting import set_verbosity, report, warn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,5 @@ | ||
import abc, random, types | ||
import numpy as np | ||
from ..helpers import ConfigurableClass, SortableByAfter | ||
from ..reporting import report | ||
from ..exceptions import * | ||
from .cell import SimulationCell | ||
from .component import SimulationComponent | ||
from .targetting import TargetsNeurons, TargetsSections | ||
from .adapter import SimulatorAdapter | ||
from .results import SimulationResult, SimulationRecorder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,60 @@ | ||
from ..reporting import warn | ||
import traceback | ||
|
||
|
||
class SimulationResult: | ||
def __init__(self): | ||
pass | ||
self.recorders = [] | ||
|
||
def add(self, recorder): | ||
self.recorders.append(recorder) | ||
|
||
def create_recorder(self, path_func, data_func, meta_func=None): | ||
recorder = ClosureRecorder(path_func, data_func, meta_func) | ||
self.add(recorder) | ||
return recorder | ||
|
||
def collect(self): | ||
for recorder in self.recorders: | ||
yield recorder.get_path(), recorder.get_data(), recorder.get_meta() | ||
|
||
def safe_collect(self): | ||
gen = iter(self.collect()) | ||
while True: | ||
try: | ||
yield next(gen) | ||
except StopIteration: | ||
break | ||
except Exception as e: | ||
traceback.print_exc() | ||
warn("Recorder errored out!") | ||
|
||
|
||
class SimulationRecorder: | ||
def get_path(self): | ||
raise NotImplementedError("Recorders need to implement the `get_path` function.") | ||
|
||
def get_data(self): | ||
raise NotImplementedError("Recorders need to implement the `get_data` function.") | ||
|
||
def get_meta(self): | ||
return {} | ||
|
||
|
||
class ClosureRecorder(SimulationRecorder): | ||
def __init__(self, path_func, data_func, meta_func=None): | ||
super().__init__() | ||
self.get_path = path_func | ||
self.get_data = data_func | ||
if meta_func: | ||
self.get_meta = meta_func | ||
|
||
|
||
class PresetPathMixin: | ||
def get_path(self): | ||
return self.path | ||
|
||
|
||
class PresetMetaMixin: | ||
def get_meta(self): | ||
return self.meta |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.