From fc35e97006692c2e3aa1a570ce49b01c28d29b6d Mon Sep 17 00:00:00 2001 From: filimarc <52816133+filimarc@users.noreply.github.com> Date: Tue, 25 Jun 2024 16:01:30 +0200 Subject: [PATCH] Fix NeuronPopulation class issue (#14) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix NeuronPopulation class issue * Bump version: 4.0.1 → 4.0.2 --- bsb_neuron/__init__.py | 2 +- bsb_neuron/adapter.py | 4 ++-- pyproject.toml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bsb_neuron/__init__.py b/bsb_neuron/__init__.py index 05f6b6e..bc39843 100644 --- a/bsb_neuron/__init__.py +++ b/bsb_neuron/__init__.py @@ -8,5 +8,5 @@ from .adapter import NeuronAdapter from .simulation import NeuronSimulation -__version__ = "4.0.1" +__version__ = "4.0.2" __plugin__ = SimulationBackendPlugin(Simulation=NeuronSimulation, Adapter=NeuronAdapter) diff --git a/bsb_neuron/adapter.py b/bsb_neuron/adapter.py index c97ff91..2a20013 100644 --- a/bsb_neuron/adapter.py +++ b/bsb_neuron/adapter.py @@ -247,11 +247,11 @@ def __init__(self, model: "NeuronCell", instances: list): def __getitem__(self, item): # Boolean masking, kind of if getattr(item, "dtype", None) == bool or _all_bools(item): - return NeuronPopulation([p for p, b in zip(self, item) if b]) + return NeuronPopulation(self._model, [p for p, b in zip(self, item) if b]) elif getattr(item, "dtype", None) == int or _all_ints(item): if getattr(item, "ndim", None) == 0: return super().__getitem__(item) - return NeuronPopulation([self[i] for i in item]) + return NeuronPopulation(self._model, [self[i] for i in item]) else: return super().__getitem__(item) diff --git a/pyproject.toml b/pyproject.toml index 7fc092f..af07b05 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,7 +38,7 @@ line-length = 90 profile = "black" [tool.bumpversion] -current_version = "4.0.1" +current_version = "4.0.2" parse = "(?P\\d+)\\.(?P\\d+)\\.(?P\\d+)" serialize = ["{major}.{minor}.{patch}"] search = "{current_version}"