Skip to content

Commit

Permalink
Fix NeuronPopulation class issue (#14)
Browse files Browse the repository at this point in the history
* Fix NeuronPopulation class issue

* Bump version: 4.0.1 → 4.0.2
  • Loading branch information
filimarc authored Jun 25, 2024
1 parent 4fc632c commit fc35e97
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bsb_neuron/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
4 changes: 2 additions & 2 deletions bsb_neuron/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ line-length = 90
profile = "black"

[tool.bumpversion]
current_version = "4.0.1"
current_version = "4.0.2"
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
serialize = ["{major}.{minor}.{patch}"]
search = "{current_version}"
Expand Down

0 comments on commit fc35e97

Please sign in to comment.