From f0d2fe2173ad1acd9561f18d7e8dbd096777a15f Mon Sep 17 00:00:00 2001 From: RCagnol Date: Wed, 20 Mar 2024 14:51:43 +0100 Subject: [PATCH 1/5] Minor changes in visualization code and README --- README.rst | 2 +- mozaik/visualization/plotting.py | 41 ++++++++++------- mozaik/visualization/simple_plot.py | 69 ++++++++++++++++++++++++++++- 3 files changed, 94 insertions(+), 18 deletions(-) diff --git a/README.rst b/README.rst index 34527f271..2ec3c2e0e 100644 --- a/README.rst +++ b/README.rst @@ -51,7 +51,7 @@ ____________ Now you can install all other dependencies in this protected environment:: - pip3 install numpy==1.23.5 scipy mpi4py matplotlib quantities lazyarray interval Pillow param==1.5.1 parameters neo cython psutil future requests elephant pytest-xdist pytest-timeout junitparser numba + pip3 install numpy==1.23.5 scipy mpi4py matplotlib quantities lazyarray interval Pillow param==1.5.1 parameters neo==0.12.0 cython psutil future requests elephant pytest-xdist pytest-timeout junitparser numba Next we will manually install several packages. It is probably the best if you create a separate directory in an appropriate place, where you will download and install the packages from. diff --git a/mozaik/visualization/plotting.py b/mozaik/visualization/plotting.py index 1135bc138..9ff0ada28 100644 --- a/mozaik/visualization/plotting.py +++ b/mozaik/visualization/plotting.py @@ -712,51 +712,60 @@ class GSynPlot(Plotting): spontaneous : bool Whether to also show the spontaneous activity the preceded the stimulus. - """ + separated : bool + Whether the excitatory and inhibitory conductances should be plotted separately. + """ + required_parameters = ParameterSet({ 'neuron': int, # we can only plot one neuron - which one ? 'sheet_name': str, 'spontaneous' : bool, # whether to also show the spontaneous activity the preceded the stimulus + 'separated': bool, # Whether the excitatory and inhibitory conductances should be plotted separately }) def subplot(self, subplotspec): dsv = queries.param_filter_query(self.datastore,sheet_name=self.parameters.sheet_name) return PerStimulusPlot(dsv, function=self._ploter, title_style="Standard" ).make_line_plot(subplotspec) - + @staticmethod def concat_asl(asl1,asl2): assert asl1.sampling_period == asl2.sampling_period assert asl1.units == asl2.units - + return NeoAnalogSignal(numpy.concatenate((asl1.magnitude,asl2.magnitude)),t_start=-asl1.t_stop, sampling_period=asl1.sampling_period, units=asl1.units) - def _ploter(self, dsv,gs): + def _ploter(self, dsv, subplotspec): + if self.parameters.separated: + gs = gridspec.GridSpecFromSubplotSpec(2, 1, subplot_spec=subplotspec,hspace=0.3, wspace=0.45) + else: + gs = gridspec.GridSpecFromSubplotSpec(1, 1, subplot_spec=subplotspec) + segs = sorted(dsv.get_segments(),key = lambda x : MozaikParametrized.idd(x.annotations['stimulus']).trial) gsyn_es = [s.get_esyn(self.parameters.neuron) for s in segs] gsyn_is = [s.get_isyn(self.parameters.neuron) for s in segs] params = OrderedDict() - + if self.parameters.spontaneous: segs = sorted(dsv.get_segments(null=True),key = lambda x : MozaikParametrized.idd(x.annotations['stimulus']).trial) - spont_gsyn_es = [s.get_esyn(self.parameters.neuron) for s in segs] - spont_gsyn_is = [s.get_isyn(self.parameters.neuron) for s in segs] - - gsyn_es = [GSynPlot.concat_asl(s,n) for n,s in zip(gsyn_es,spont_gsyn_es)] - gsyn_is = [GSynPlot.concat_asl(s,n) for n,s in zip(gsyn_is,spont_gsyn_is)] + spont_gsyn_es = [s.get_esyn(self.parameters.neuron) for s in segs] + spont_gsyn_is = [s.get_isyn(self.parameters.neuron) for s in segs] + + gsyn_es = [GSynPlot.concat_asl(s,n) for n,s in zip(gsyn_es,spont_gsyn_es)] + gsyn_is = [GSynPlot.concat_asl(s,n) for n,s in zip(gsyn_is,spont_gsyn_is)] t_start = - spont_gsyn_es[0].t_stop.magnitude t_stop = gsyn_es[0].t_stop.magnitude params = {'x_ticks' : [t_start,0, t_stop/2, t_stop]} - - return [("ConductancesPlot",ConductancesPlot(gsyn_es, gsyn_is),gs,params)] - - - - + + if self.parameters.separated: + return [("ConductancePlotExc",ConductancePlot(gsyn_es,'exc'),gs[0,0],params), + ("ConductancePlotInh",ConductancePlot(gsyn_is,'inh'),gs[1,0],params)] + else: + return [("ConductancesPlot",ConductancesPlot(gsyn_es, gsyn_is),gs[0,0],params)] diff --git a/mozaik/visualization/simple_plot.py b/mozaik/visualization/simple_plot.py index 926e8e725..92790d7db 100644 --- a/mozaik/visualization/simple_plot.py +++ b/mozaik/visualization/simple_plot.py @@ -1028,6 +1028,72 @@ def plot(self): self.axis.legend(fontsize=self.legend_fontsize) self.x_lim = (tmin, tmax) + +class ConductancePlot(StandardStyle): + """ + Plots conductances of one type (either excitatory or inhibitory). + + Parameters + ---------- + + cond : list + List of conductances (AnalogSignal type). + + type_ : string + Whether the conductances are excitatory or inhibitory + Should be 'exc' or 'inh' + + Other parameters + ---------------- + + legend : bool + Whether legend should be displayed. + + smooth_means : bool + Whether to apply low pass filter to the mean of the conductances. + """ + + def __init__(self, cond, type_,**param): + StandardStyle.__init__(self,**param) + self.cond = cond + self.parameters["legend"] = False + self.parameters["smooth_means"] = False + if type_ == 'exc': + self.cond_color = '#F5A9A9' + self.mean_color = 'r' + elif type_ == 'inh': + self.cond_color = '#A9BCF5' + self.mean_color = 'b' + else: + raise ValueError('%s is not an appropriate name for parameter `type_`. Only `exc` or `inh` are valid', self.type_) + + def plot(self): + mean_cond = numpy.zeros(numpy.shape(self.cond[0])) + sampling_period = self.cond[0].sampling_period + t_stop = float(self.cond[0].t_stop - sampling_period) + t_start = float(self.cond[0].t_start) + time_axis = numpy.arange(0, len(self.cond[0]), 1) / float(len(self.cond[0])) * abs(t_start-t_stop) + t_start + + for c in self.cond: + c = c.rescale(mozaik.tools.units.nS) + self.axis.plot(time_axis, c.tolist(), color=self.cond_color) + mean_cond = mean_cond + numpy.array(c.tolist()) + + mean_cond = mean_cond / len(self.cond) + from scipy.signal import savgol_filter + if self.smooth_means: + p1, = self.axis.plot(numpy.transpose(time_axis).flatten(), savgol_filter(numpy.transpose(mean_cond).tolist(),151,2).flatten(), color=self.mean_color, linewidth=3) + else: + p1, = self.axis.plot(time_axis, mean_cond.tolist(), color=self.mean_color, linewidth=1) + if self.legend: + self.axis.legend([p1], [type_]) + + self.x_lim = (t_start, t_stop) + #self.x_ticks = [t_start, (t_stop - t_start)/2, t_stop] + self.x_label = 'time (' + self.cond[0].t_start.dimensionality.latex + ')' + self.y_label = 'g (' + mozaik.tools.units.nS.dimensionality.latex + ')' + + class ConductancesPlot(StandardStyle): """ Plots conductances. @@ -1257,6 +1323,7 @@ def __init__(self, values,labels=None,**param): self.parameters["mark_mean"] = False self.parameters["mark_value"] = False self.parameters["legend"] = False + self.parameters["legend_fontsize"] = False self.parameters["histtype"] = 'bar' self.parameters["rwidth"] = None @@ -1305,7 +1372,7 @@ def plot(self): ) if self.legend: - self.axis.legend() + self.axis.legend(fontsize=self.legend_fontsize) self.y_label = '#' From fcadd4ef89799cbd2cfc03d2801b1bff1398980c Mon Sep 17 00:00:00 2001 From: RCagnol Date: Wed, 20 Mar 2024 15:34:06 +0100 Subject: [PATCH 2/5] Reformating --- mozaik/experiments/optogenetic.py | 42 +++++++++++++------------- tests/sheets/test_direct_stimulator.py | 6 ++-- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/mozaik/experiments/optogenetic.py b/mozaik/experiments/optogenetic.py index 71cd12e2d..05df147ec 100644 --- a/mozaik/experiments/optogenetic.py +++ b/mozaik/experiments/optogenetic.py @@ -232,12 +232,12 @@ def stimulating_signal_function(sheet, coor_x, coor_y, update_interval, paramete def __init__(self, model, parameters): CorticalStimulationWithOptogeneticArray.__init__(self, model, parameters) - self.parameters.stimulator_array_parameters[ - "stimulating_signal" - ] = self.parameters.stimulating_signal - self.parameters.stimulator_array_parameters[ - "stimulating_signal_parameters" - ] = self.parameters.stimulating_signal_parameters + self.parameters.stimulator_array_parameters["stimulating_signal"] = ( + self.parameters.stimulating_signal + ) + self.parameters.stimulator_array_parameters["stimulating_signal_parameters"] = ( + self.parameters.stimulating_signal_parameters + ) self.append_direct_stim(model, self.parameters.stimulator_array_parameters) @@ -333,9 +333,9 @@ class OptogeneticArrayStimulusCircles(CorticalStimulationWithOptogeneticArray): def __init__(self, model, parameters): CorticalStimulationWithOptogeneticArray.__init__(self, model, parameters) sap = self.parameters.stimulator_array_parameters - sap[ - "stimulating_signal" - ] = "mozaik.sheets.direct_stimulator.stimulating_pattern_flash" + sap["stimulating_signal"] = ( + "mozaik.sheets.direct_stimulator.stimulating_pattern_flash" + ) sap["stimulating_signal_parameters"] = ParameterSet( { "shape": "circle", @@ -457,9 +457,9 @@ class OptogeneticArrayStimulusHexagonalTiling(CorticalStimulationWithOptogenetic def __init__(self, model, parameters): CorticalStimulationWithOptogeneticArray.__init__(self, model, parameters) sap = self.parameters.stimulator_array_parameters - sap[ - "stimulating_signal" - ] = "mozaik.sheets.direct_stimulator.stimulating_pattern_flash" + sap["stimulating_signal"] = ( + "mozaik.sheets.direct_stimulator.stimulating_pattern_flash" + ) sap["stimulating_signal_parameters"] = ParameterSet( { "shape": "hexagon", @@ -621,9 +621,9 @@ class OptogeneticArrayImageStimulus(CorticalStimulationWithOptogeneticArray): def __init__(self, model, parameters): CorticalStimulationWithOptogeneticArray.__init__(self, model, parameters) sap = self.parameters.stimulator_array_parameters - sap[ - "stimulating_signal" - ] = "mozaik.sheets.direct_stimulator.stimulating_pattern_flash" + sap["stimulating_signal"] = ( + "mozaik.sheets.direct_stimulator.stimulating_pattern_flash" + ) sap["stimulating_signal_parameters"] = ParameterSet( { "shape": "image", @@ -741,9 +741,9 @@ def __init__(self, model, parameters): self.parameters["sheet_intensity_scaler"] = [1 for s in sl] self.parameters["sheet_transfection_proportion"] = [1 for s in sl] sap = self.parameters.stimulator_array_parameters - sap[ - "stimulating_signal" - ] = "mozaik.sheets.direct_stimulator.stimulating_pattern_flash" + sap["stimulating_signal"] = ( + "mozaik.sheets.direct_stimulator.stimulating_pattern_flash" + ) sap["stimulating_signal_parameters"] = ParameterSet( { "shape": "or_map", @@ -885,9 +885,9 @@ def __init__(self, model, parameters): self.parameters["sheet_intensity_scaler"] = [1 for s in sl] self.parameters["sheet_transfection_proportion"] = [1 for s in sl] sap = self.parameters.stimulator_array_parameters - sap[ - "stimulating_signal" - ] = "mozaik.sheets.direct_stimulator.stimulating_pattern_flash" + sap["stimulating_signal"] = ( + "mozaik.sheets.direct_stimulator.stimulating_pattern_flash" + ) sap["stimulating_signal_parameters"] = ParameterSet( { "shape": "or_map", diff --git a/tests/sheets/test_direct_stimulator.py b/tests/sheets/test_direct_stimulator.py index a5b57ca4b..15377904b 100644 --- a/tests/sheets/test_direct_stimulator.py +++ b/tests/sheets/test_direct_stimulator.py @@ -61,9 +61,9 @@ def setup_class(cls): cls.sheet_params.max_depth = 400 cls.opt_array_params = load_parameters(test_dir + "/sheets/opt_array_params") cls.opt_array_params["transfection_proportion"] = 1.0 - cls.opt_array_params[ - "stimulating_signal" - ] = "mozaik.sheets.direct_stimulator.stimulating_pattern_flash" + cls.opt_array_params["stimulating_signal"] = ( + "mozaik.sheets.direct_stimulator.stimulating_pattern_flash" + ) cls.opt_array_params["stimulating_signal_parameters"] = ParameterSet( { "shape": "circle", From b369cd57a621e5f6951d114e8e2a00a551ce1ded Mon Sep 17 00:00:00 2001 From: RCagnol Date: Wed, 20 Mar 2024 15:34:46 +0100 Subject: [PATCH 3/5] Forcing installation of neo 0.12.0 in github action workflows --- .github/workflows/fast-model-mpi-explosion.yml | 2 +- .github/workflows/fast-model-mpi.yml | 2 +- .github/workflows/fast-model-stepcurrentmodule.yml | 2 +- .github/workflows/fast-model.yml | 2 +- .github/workflows/lsv1m-model.yml | 2 +- .github/workflows/unit-tests.yml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/fast-model-mpi-explosion.yml b/.github/workflows/fast-model-mpi-explosion.yml index b579ef7cf..d138950af 100644 --- a/.github/workflows/fast-model-mpi-explosion.yml +++ b/.github/workflows/fast-model-mpi-explosion.yml @@ -20,7 +20,7 @@ jobs: pip3 install pytest pytest-cov pytest-randomly coverage black # TODO: Remove fixed numpy and pynn versions after the PyNN pull request # https://github.com/NeuralEnsemble/PyNN/pull/762 is accepted - pip3 install numpy==1.23.5 scipy mpi4py matplotlib quantities lazyarray interval Pillow param==1.5.1 parameters neo cython pynn==0.10.0 psutil future requests elephant pytest-xdist pytest-timeout junitparser numba + pip3 install numpy==1.23.5 scipy mpi4py matplotlib quantities lazyarray interval Pillow param==1.5.1 parameters neo==0.12.0 cython pynn==0.10.0 psutil future requests elephant pytest-xdist pytest-timeout junitparser numba - name: Download and install imagen run: | git clone https://github.com/antolikjan/imagen.git diff --git a/.github/workflows/fast-model-mpi.yml b/.github/workflows/fast-model-mpi.yml index d389e59ef..053564198 100644 --- a/.github/workflows/fast-model-mpi.yml +++ b/.github/workflows/fast-model-mpi.yml @@ -20,7 +20,7 @@ jobs: pip3 install pytest pytest-cov pytest-randomly coverage black # TODO: Remove fixed numpy and pynn versions after the PyNN pull request # https://github.com/NeuralEnsemble/PyNN/pull/762 is accepted - pip3 install numpy==1.23.5 scipy mpi4py matplotlib quantities lazyarray interval Pillow param==1.5.1 parameters neo cython pynn==0.10.0 psutil future requests elephant pytest-xdist pytest-timeout junitparser numba + pip3 install numpy==1.23.5 scipy mpi4py matplotlib quantities lazyarray interval Pillow param==1.5.1 parameters neo==0.12.0 cython pynn==0.10.0 psutil future requests elephant pytest-xdist pytest-timeout junitparser numba - name: Download and install imagen run: | git clone https://github.com/antolikjan/imagen.git diff --git a/.github/workflows/fast-model-stepcurrentmodule.yml b/.github/workflows/fast-model-stepcurrentmodule.yml index 09428621b..cc4913806 100644 --- a/.github/workflows/fast-model-stepcurrentmodule.yml +++ b/.github/workflows/fast-model-stepcurrentmodule.yml @@ -19,7 +19,7 @@ jobs: pip3 install pytest pytest-cov pytest-randomly coverage black # TODO: Remove fixed numpy and pynn versions after the PyNN pull request # https://github.com/NeuralEnsemble/PyNN/pull/762 is accepted - pip3 install numpy==1.23.5 scipy mpi4py matplotlib quantities lazyarray interval Pillow param==1.5.1 parameters neo cython psutil future requests elephant pytest-xdist pytest-timeout junitparser numba + pip3 install numpy==1.23.5 scipy mpi4py matplotlib quantities lazyarray interval Pillow param==1.5.1 parameters neo==0.12.0 cython psutil future requests elephant pytest-xdist pytest-timeout junitparser numba - name: Download and install imagen run: | diff --git a/.github/workflows/fast-model.yml b/.github/workflows/fast-model.yml index d41318a7f..5538b933c 100644 --- a/.github/workflows/fast-model.yml +++ b/.github/workflows/fast-model.yml @@ -19,7 +19,7 @@ jobs: pip3 install pytest pytest-cov pytest-randomly coverage black # TODO: Remove fixed numpy and pynn versions after the PyNN pull request # https://github.com/NeuralEnsemble/PyNN/pull/762 is accepted - pip3 install numpy==1.23.5 scipy mpi4py matplotlib quantities lazyarray interval Pillow param==1.5.1 parameters neo cython pynn==0.10.0 psutil future requests elephant pytest-xdist pytest-timeout junitparser numba + pip3 install numpy==1.23.5 scipy mpi4py matplotlib quantities lazyarray interval Pillow param==1.5.1 parameters neo==0.12.0 cython pynn==0.10.0 psutil future requests elephant pytest-xdist pytest-timeout junitparser numba - name: Download and install imagen run: | diff --git a/.github/workflows/lsv1m-model.yml b/.github/workflows/lsv1m-model.yml index 941bae903..05c962d13 100644 --- a/.github/workflows/lsv1m-model.yml +++ b/.github/workflows/lsv1m-model.yml @@ -19,7 +19,7 @@ jobs: pip3 install pytest pytest-cov pytest-randomly coverage black # TODO: Remove fixed numpy and pynn versions after the PyNN pull request # https://github.com/NeuralEnsemble/PyNN/pull/762 is accepted - pip3 install numpy==1.23.5 scipy mpi4py matplotlib quantities lazyarray interval Pillow param==1.5.1 parameters neo cython pynn==0.10.0 psutil future requests elephant pytest-xdist pytest-timeout junitparser numba + pip3 install numpy==1.23.5 scipy mpi4py matplotlib quantities lazyarray interval Pillow param==1.5.1 parameters neo==0.12.0 cython pynn==0.10.0 psutil future requests elephant pytest-xdist pytest-timeout junitparser numba - name: Download and install imagen run: | diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index b969b8411..fabe8f2a1 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -19,7 +19,7 @@ jobs: pip3 install pytest pytest-cov pytest-randomly coverage black # TODO: Remove fixed numpy and pynn versions after the PyNN pull request # https://github.com/NeuralEnsemble/PyNN/pull/762 is accepted - pip3 install numpy==1.23.5 scipy mpi4py matplotlib quantities lazyarray interval Pillow param==1.5.1 parameters neo cython pynn==0.10.0 psutil future requests elephant pytest-xdist pytest-timeout junitparser numba + pip3 install numpy==1.23.5 scipy mpi4py matplotlib quantities lazyarray interval Pillow param==1.5.1 parameters neo==0.12.0 cython pynn==0.10.0 psutil future requests elephant pytest-xdist pytest-timeout junitparser numba - name: Download and install imagen run: | From a4a4325393ecedae40a7953fd7bad017de6c3696 Mon Sep 17 00:00:00 2001 From: RCagnol Date: Thu, 28 Mar 2024 13:57:04 +0100 Subject: [PATCH 4/5] Minor changes in visualization code --- mozaik/visualization/plotting.py | 18 +++++++++++------- mozaik/visualization/simple_plot.py | 3 ++- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/mozaik/visualization/plotting.py b/mozaik/visualization/plotting.py index 9ff0ada28..366b6790f 100644 --- a/mozaik/visualization/plotting.py +++ b/mozaik/visualization/plotting.py @@ -58,7 +58,7 @@ from neo.core.analogsignal import AnalogSignal as NeoAnalogSignal from neo.core.spiketrain import SpikeTrain as NeoSpikeTrain from .simple_plot import StandardStyleLinePlot, SpikeRasterPlot, \ - SpikeHistogramPlot, ConductancesPlot, PixelMovie, \ + SpikeHistogramPlot, ConductancePlot, ConductancesPlot, PixelMovie, \ ScatterPlotMovie, ScatterPlot, ConnectionPlot, SimplePlot, HistogramPlot, CorticalColumnSpikeRasterPlot, OrderedAnalogSignalListPlot from .plot_constructors import LinePlot, PerStimulusPlot, PerStimulusADSPlot, ADSGridPlot, MultipleFilesPlot @@ -829,7 +829,7 @@ def _ploter(self, dsv,subplotspec): ("Conductance_plot",GSynPlot(dsv, ParameterSet({'sheet_name': self.parameters.sheet_name,'spontaneous' : self.parameters.spontaneous, - 'neuron': self.parameters.neuron}) + 'separated' : False, 'neuron': self.parameters.neuron}) ),gs[1 + offset, 0], {'x_label' : None, 'x_tick_style' : 'Custom' , 'x_tick_labels' : None, 'title' : None}), ("Vm_plot",VmPlot(dsv, @@ -1195,6 +1195,9 @@ class PerNeuronValuePlot(Plotting): cortical_view : bool Whether to show cortical view or histogram (see class description for full detail.) + neuron_ids : list + List of neurons to plot + Notes ----- So far doesn't support the situation where several types of PerNeuronValue analysys data structures are present in the supplied @@ -1203,6 +1206,7 @@ class PerNeuronValuePlot(Plotting): required_parameters = ParameterSet({ 'cortical_view': bool, #Whether to show cortical view or histogram (see class description for full detail.) + 'neuron_ids': list, }) def __init__(self, datastore, parameters, plot_file_name=None, @@ -1224,9 +1228,9 @@ def _ploter(self, dsv, gs): assert len(pnvs) <= 1, logger.error("We can only display single stimulus parametrization in cortical view, but you have suplied multiple in datastore.") pnv = pnvs[0] pos = self.dsv.get_neuron_positions()[pnv.sheet_name] - posx = pos[0,self.datastore.get_sheet_indexes(pnv.sheet_name,pnv.ids)] - posy = pos[1,self.datastore.get_sheet_indexes(pnv.sheet_name,pnv.ids)] - values = pnv.values + posx = pos[0,self.datastore.get_sheet_indexes(pnv.sheet_name,self.parameters.neuron_ids)] + posy = pos[1,self.datastore.get_sheet_indexes(pnv.sheet_name,self.parameters.neuron_ids)] + values = pnv.get_value_by_id(self.parameters.neuron_ids) if pnv.period != None: periodic = True period = pnv.period @@ -1249,9 +1253,9 @@ def _ploter(self, dsv, gs): a = sorted([(','.join([p + ' : ' + str(getattr(MozaikParametrized.idd(pnv.stimulus_id),p)) for p in varying_stim_parameters]),pnv) for pnv in pnvs],key=lambda x: x[0]) if len(a) > 1: - return [("HistogramPlot",HistogramPlot([z[1].values for z in a],labels=[z[0] for z in a]),gs,params)] + return [("HistogramPlot",HistogramPlot([z[1].get_value_by_id(self.parameters.neuron_ids) for z in a],labels=[z[0] for z in a]),gs,params)] else: - return [("HistogramPlot",HistogramPlot([pnvs[0].values]),gs,params)] + return [("HistogramPlot",HistogramPlot([pnvs[0].get_value_by_id(self.parameters.neuron_ids)]),gs,params)] diff --git a/mozaik/visualization/simple_plot.py b/mozaik/visualization/simple_plot.py index 92790d7db..f07328678 100644 --- a/mozaik/visualization/simple_plot.py +++ b/mozaik/visualization/simple_plot.py @@ -1058,6 +1058,7 @@ def __init__(self, cond, type_,**param): self.cond = cond self.parameters["legend"] = False self.parameters["smooth_means"] = False + self.type = type_ if type_ == 'exc': self.cond_color = '#F5A9A9' self.mean_color = 'r' @@ -1086,7 +1087,7 @@ def plot(self): else: p1, = self.axis.plot(time_axis, mean_cond.tolist(), color=self.mean_color, linewidth=1) if self.legend: - self.axis.legend([p1], [type_]) + self.axis.legend([p1], [self.type]) self.x_lim = (t_start, t_stop) #self.x_ticks = [t_start, (t_stop - t_start)/2, t_stop] From 3e6edede3b7511487b971214362a913c22f0fee5 Mon Sep 17 00:00:00 2001 From: RCagnol Date: Wed, 3 Apr 2024 15:19:03 +0200 Subject: [PATCH 5/5] Modifications in installation instructions --- README.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index 2ec3c2e0e..da449874b 100644 --- a/README.rst +++ b/README.rst @@ -60,14 +60,14 @@ First install the *imagen* package:: git clone https://github.com/CSNG-MFF/imagen.git cd imagen - python setup.py install + pip install . Then install the *PyNN* package from the PyNNStepCurrentModule branch:: git clone https://github.com/CSNG-MFF/PyNN.git cd PyNN git checkout PyNNStepCurrentModule - python setup.py install + pip install . Next install the *Nest* simulator (always in the virtual environment): @@ -125,7 +125,7 @@ And, finally, Mozaik:: git clone https://github.com/CSNG-MFF/mozaik.git cd mozaik - python setup.py install + pip install . .. _ref-run: