bsb-arbor 6.0.0a18__tar.gz → 6.0.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of bsb-arbor might be problematic. Click here for more details.
- bsb_arbor-6.0.2/PKG-INFO +29 -0
- bsb_arbor-6.0.2/README.md +14 -0
- {bsb_arbor-6.0.0a18 → bsb_arbor-6.0.2}/bsb_arbor/adapter.py +81 -0
- {bsb_arbor-6.0.0a18 → bsb_arbor-6.0.2}/pyproject.toml +5 -19
- bsb_arbor-6.0.0a18/PKG-INFO +0 -36
- bsb_arbor-6.0.0a18/README.md +0 -9
- {bsb_arbor-6.0.0a18 → bsb_arbor-6.0.2}/LICENSE +0 -0
- {bsb_arbor-6.0.0a18 → bsb_arbor-6.0.2}/bsb_arbor/__init__.py +0 -0
- {bsb_arbor-6.0.0a18 → bsb_arbor-6.0.2}/bsb_arbor/cell.py +0 -0
- {bsb_arbor-6.0.0a18 → bsb_arbor-6.0.2}/bsb_arbor/connection.py +0 -0
- {bsb_arbor-6.0.0a18 → bsb_arbor-6.0.2}/bsb_arbor/device.py +0 -0
- {bsb_arbor-6.0.0a18 → bsb_arbor-6.0.2}/bsb_arbor/devices/__init__.py +0 -0
- {bsb_arbor-6.0.0a18 → bsb_arbor-6.0.2}/bsb_arbor/devices/poisson_generator.py +0 -0
- {bsb_arbor-6.0.0a18 → bsb_arbor-6.0.2}/bsb_arbor/devices/probe.py +0 -0
- {bsb_arbor-6.0.0a18 → bsb_arbor-6.0.2}/bsb_arbor/devices/spike_recorder.py +0 -0
- {bsb_arbor-6.0.0a18 → bsb_arbor-6.0.2}/bsb_arbor/simulation.py +0 -0
bsb_arbor-6.0.2/PKG-INFO
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: bsb-arbor
|
|
3
|
+
Version: 6.0.2
|
|
4
|
+
Summary: Arbor simulation adapter for the BSB framework.
|
|
5
|
+
Author-email: Robin De Schepper <robin@alexandria.sc>, Dimitri Rodarie <dimitri.rodarie@unipv.it>
|
|
6
|
+
Requires-Python: >=3.10,<4
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Requires-Dist: numpy~=1.21
|
|
11
|
+
Requires-Dist: bsb-core~=6.0
|
|
12
|
+
Requires-Dist: arborize~=6.0
|
|
13
|
+
Requires-Dist: arbor~=0.10; sys_platform != 'win32'
|
|
14
|
+
|
|
15
|
+
[](https://github.com/dbbs-lab/bsb/actions/workflows/main.yml)
|
|
16
|
+
[](https://bsb-arbor.readthedocs.io/en/latest/?badge=latest)
|
|
17
|
+
[](https://github.com/astral-sh/ruff)
|
|
18
|
+
|
|
19
|
+
# bsb-arbor
|
|
20
|
+
|
|
21
|
+
bsb-arbor is a plugin of the [BSB](https://github.com/dbbs-lab/bsb)
|
|
22
|
+
It contains the interfaces and tools to simulate BSB circuits with the
|
|
23
|
+
[Arbor simulator](https://arbor-sim.org/).
|
|
24
|
+
|
|
25
|
+
Comprehensive documentation is available at:
|
|
26
|
+
|
|
27
|
+
* [BSB Documentation](https://bsb.readthedocs.io/en/latest)
|
|
28
|
+
* [bsb-arbor Documentation](https://bsb-arbor.readthedocs.io/en/latest)
|
|
29
|
+
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
[](https://github.com/dbbs-lab/bsb/actions/workflows/main.yml)
|
|
2
|
+
[](https://bsb-arbor.readthedocs.io/en/latest/?badge=latest)
|
|
3
|
+
[](https://github.com/astral-sh/ruff)
|
|
4
|
+
|
|
5
|
+
# bsb-arbor
|
|
6
|
+
|
|
7
|
+
bsb-arbor is a plugin of the [BSB](https://github.com/dbbs-lab/bsb)
|
|
8
|
+
It contains the interfaces and tools to simulate BSB circuits with the
|
|
9
|
+
[Arbor simulator](https://arbor-sim.org/).
|
|
10
|
+
|
|
11
|
+
Comprehensive documentation is available at:
|
|
12
|
+
|
|
13
|
+
* [BSB Documentation](https://bsb.readthedocs.io/en/latest)
|
|
14
|
+
* [bsb-arbor Documentation](https://bsb-arbor.readthedocs.io/en/latest)
|
|
@@ -63,7 +63,20 @@ class SingleReceiverCollection(list):
|
|
|
63
63
|
|
|
64
64
|
|
|
65
65
|
class Population:
|
|
66
|
+
"""
|
|
67
|
+
Represents a population of cells for the Arbor simulator.
|
|
68
|
+
|
|
69
|
+
This class manages a collection of cells from a specific cell model, handling their
|
|
70
|
+
GID ranges and providing methods to access and manipulate subsets of the population.
|
|
71
|
+
"""
|
|
66
72
|
def __init__(self, simdata, cell_model, offset):
|
|
73
|
+
"""
|
|
74
|
+
Initialize a population of cells.
|
|
75
|
+
|
|
76
|
+
:param simdata: The simulation data container
|
|
77
|
+
:param cell_model: The cell model for this population
|
|
78
|
+
:param offset: The GID offset for this population
|
|
79
|
+
"""
|
|
67
80
|
self._model = cell_model
|
|
68
81
|
self._simdata = simdata
|
|
69
82
|
ps = cell_model.get_placement_set(simdata.chunks)
|
|
@@ -72,22 +85,61 @@ class Population:
|
|
|
72
85
|
|
|
73
86
|
@property
|
|
74
87
|
def model(self):
|
|
88
|
+
"""
|
|
89
|
+
Get the cell model associated with this population.
|
|
90
|
+
|
|
91
|
+
:return: The cell model object
|
|
92
|
+
"""
|
|
75
93
|
return self._model
|
|
76
94
|
|
|
77
95
|
@property
|
|
78
96
|
def offset(self):
|
|
97
|
+
"""
|
|
98
|
+
Get the GID offset for this population.
|
|
99
|
+
|
|
100
|
+
:return: The GID offset value
|
|
101
|
+
"""
|
|
79
102
|
return self._offset
|
|
80
103
|
|
|
81
104
|
def __len__(self):
|
|
105
|
+
"""
|
|
106
|
+
Get the total number of cells in this population.
|
|
107
|
+
|
|
108
|
+
:return: The number of cells
|
|
109
|
+
"""
|
|
82
110
|
return sum(stop - start for start, stop in self._ranges)
|
|
83
111
|
|
|
84
112
|
def __contains__(self, i):
|
|
113
|
+
"""
|
|
114
|
+
Check if a GID is part of this population.
|
|
115
|
+
|
|
116
|
+
:param i: The GID to check
|
|
117
|
+
:return: True if the GID is in this population, False otherwise
|
|
118
|
+
"""
|
|
85
119
|
return any(start <= i < stop for start, stop in self._ranges)
|
|
86
120
|
|
|
87
121
|
def copy(self):
|
|
122
|
+
"""
|
|
123
|
+
Create a copy of this population.
|
|
124
|
+
|
|
125
|
+
:return: A new Population instance with the same properties
|
|
126
|
+
"""
|
|
88
127
|
return Population(self._simdata, self._model, self._offset)
|
|
89
128
|
|
|
90
129
|
def __getitem__(self, item):
|
|
130
|
+
"""
|
|
131
|
+
Get a subset of the population based on the provided index or mask.
|
|
132
|
+
|
|
133
|
+
Supports various indexing methods:
|
|
134
|
+
- Boolean masking: Select cells based on a boolean mask
|
|
135
|
+
- Integer indexing: Select specific cells by their indices
|
|
136
|
+
- Slicing: Select a range of cells
|
|
137
|
+
|
|
138
|
+
:param item: The index, slice, or mask to use for selection
|
|
139
|
+
:return: A new Population instance containing the selected cells
|
|
140
|
+
:raises ValueError: If the dimensions of the mask don't match the population
|
|
141
|
+
:raises IndexError: If an index is out of bounds
|
|
142
|
+
"""
|
|
91
143
|
# Boolean masking, kind of
|
|
92
144
|
if getattr(item, "dtype", None) == bool or _all_bools(item): # noqa: E721
|
|
93
145
|
if len(item) != len(self):
|
|
@@ -106,6 +158,14 @@ class Population:
|
|
|
106
158
|
return self._subpop_one(item)
|
|
107
159
|
|
|
108
160
|
def _get_ranges(self, chunks, ps, offset):
|
|
161
|
+
"""
|
|
162
|
+
Calculate the GID ranges for this population based on chunk statistics.
|
|
163
|
+
|
|
164
|
+
:param chunks: The simulation chunks to include
|
|
165
|
+
:param ps: The placement set for the cell model
|
|
166
|
+
:param offset: The starting GID offset
|
|
167
|
+
:return: A list of (start, stop) tuples representing GID ranges
|
|
168
|
+
"""
|
|
109
169
|
stats = ps.get_chunk_stats()
|
|
110
170
|
ranges = []
|
|
111
171
|
for chunk, len_ in sorted(
|
|
@@ -117,6 +177,15 @@ class Population:
|
|
|
117
177
|
return ranges
|
|
118
178
|
|
|
119
179
|
def _subpop_np(self, arr):
|
|
180
|
+
"""
|
|
181
|
+
Create a subpopulation from a numpy array of indices.
|
|
182
|
+
|
|
183
|
+
This method handles array-based indexing, including boolean masks,
|
|
184
|
+
integer arrays, and slices.
|
|
185
|
+
|
|
186
|
+
:param arr: A numpy array of indices to include in the subpopulation
|
|
187
|
+
:return: A new Population instance containing only the selected cells
|
|
188
|
+
"""
|
|
120
189
|
pop = self.copy()
|
|
121
190
|
if not len(pop):
|
|
122
191
|
return pop
|
|
@@ -138,6 +207,13 @@ class Population:
|
|
|
138
207
|
return pop
|
|
139
208
|
|
|
140
209
|
def _subpop_one(self, item):
|
|
210
|
+
"""
|
|
211
|
+
Create a subpopulation containing a single cell.
|
|
212
|
+
|
|
213
|
+
:param item: The index of the cell to include
|
|
214
|
+
:return: A new Population instance containing only the selected cell
|
|
215
|
+
:raises IndexError: If the index is out of bounds
|
|
216
|
+
"""
|
|
141
217
|
if item >= len(self):
|
|
142
218
|
raise IndexError(f"Index {item} out of bounds for size {len(self)}")
|
|
143
219
|
pop = self.copy()
|
|
@@ -150,6 +226,11 @@ class Population:
|
|
|
150
226
|
ptr += stop - start
|
|
151
227
|
|
|
152
228
|
def __iter__(self):
|
|
229
|
+
"""
|
|
230
|
+
Iterate over all GIDs in this population.
|
|
231
|
+
|
|
232
|
+
:yield: Each GID in the population's ranges
|
|
233
|
+
"""
|
|
153
234
|
yield from itertools.chain.from_iterable(range(r[0], r[1]) for r in self._ranges)
|
|
154
235
|
|
|
155
236
|
|
|
@@ -6,7 +6,7 @@ build-backend = "flit_core.buildapi"
|
|
|
6
6
|
|
|
7
7
|
[project]
|
|
8
8
|
name = "bsb-arbor"
|
|
9
|
-
version = "6.0.
|
|
9
|
+
version = "6.0.2"
|
|
10
10
|
readme = "README.md"
|
|
11
11
|
requires-python = ">=3.10,<4"
|
|
12
12
|
dynamic = [ "description" ]
|
|
@@ -31,30 +31,16 @@ dependencies = [
|
|
|
31
31
|
[project.license]
|
|
32
32
|
file = "LICENSE"
|
|
33
33
|
|
|
34
|
-
[project.optional-dependencies]
|
|
35
|
-
test = [
|
|
36
|
-
"bsb-core[parallel]",
|
|
37
|
-
"bsb-hdf5~=6.0",
|
|
38
|
-
"bsb-test~=6.0",
|
|
39
|
-
"coverage>=7.3"
|
|
40
|
-
]
|
|
41
|
-
docs = [ "furo~=2024.0", "sphinxext-bsb~=6.0" ]
|
|
42
|
-
dev = [
|
|
43
|
-
"bsb-arbor[test,docs]",
|
|
44
|
-
"pre-commit~=3.5",
|
|
45
|
-
"ruff>=0.8.2",
|
|
46
|
-
"snakeviz~=2.1"
|
|
47
|
-
]
|
|
48
|
-
|
|
49
34
|
[project.entry-points."bsb.simulation_backends"]
|
|
50
35
|
arbor = "bsb_arbor"
|
|
51
36
|
|
|
52
|
-
[tool.flit.module]
|
|
53
|
-
name = "bsb_arbor"
|
|
54
|
-
|
|
55
37
|
[tool.uv]
|
|
38
|
+
default-groups = [ "dev", "docs", "test" ]
|
|
56
39
|
sources = { }
|
|
57
40
|
|
|
41
|
+
[tool.flit.module]
|
|
42
|
+
name = "bsb_arbor"
|
|
43
|
+
|
|
58
44
|
[tool.coverage.run]
|
|
59
45
|
branch = true
|
|
60
46
|
source = [ "bsb_arbor" ]
|
bsb_arbor-6.0.0a18/PKG-INFO
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: bsb-arbor
|
|
3
|
-
Version: 6.0.0a18
|
|
4
|
-
Summary: Arbor simulation adapter for the BSB framework.
|
|
5
|
-
Author-email: Robin De Schepper <robin@alexandria.sc>, Dimitri Rodarie <dimitri.rodarie@unipv.it>
|
|
6
|
-
Requires-Python: >=3.10,<4
|
|
7
|
-
Description-Content-Type: text/markdown
|
|
8
|
-
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
|
|
9
|
-
License-File: LICENSE
|
|
10
|
-
Requires-Dist: numpy~=1.21
|
|
11
|
-
Requires-Dist: bsb-core~=6.0
|
|
12
|
-
Requires-Dist: arborize~=6.0
|
|
13
|
-
Requires-Dist: arbor~=0.10; sys_platform != 'win32'
|
|
14
|
-
Requires-Dist: bsb-arbor[test, docs] ; extra == "dev"
|
|
15
|
-
Requires-Dist: pre-commit~=3.5 ; extra == "dev"
|
|
16
|
-
Requires-Dist: ruff>=0.8.2 ; extra == "dev"
|
|
17
|
-
Requires-Dist: snakeviz~=2.1 ; extra == "dev"
|
|
18
|
-
Requires-Dist: furo~=2024.0 ; extra == "docs"
|
|
19
|
-
Requires-Dist: sphinxext-bsb~=6.0 ; extra == "docs"
|
|
20
|
-
Requires-Dist: bsb-core[parallel] ; extra == "test"
|
|
21
|
-
Requires-Dist: bsb-hdf5~=6.0 ; extra == "test"
|
|
22
|
-
Requires-Dist: bsb-test~=6.0 ; extra == "test"
|
|
23
|
-
Requires-Dist: coverage>=7.3 ; extra == "test"
|
|
24
|
-
Provides-Extra: dev
|
|
25
|
-
Provides-Extra: docs
|
|
26
|
-
Provides-Extra: test
|
|
27
|
-
|
|
28
|
-
[](https://github.com/dbbs-lab/bsb-arbor/actions/workflows/main.yml)
|
|
29
|
-
[](https://github.com/psf/black)
|
|
30
|
-
|
|
31
|
-
# bsb-arbor
|
|
32
|
-
|
|
33
|
-
bsb-arbor is a plugin of the [BSB](https://github.com/dbbs-lab/bsb) (see also
|
|
34
|
-
[bsb-core](https://github.com/dbbs-lab/bsb-core)).
|
|
35
|
-
It contains the interfaces and tools to simulate BSB circuit with the
|
|
36
|
-
[Arbor simulator](https://arbor-sim.org/).
|
bsb_arbor-6.0.0a18/README.md
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
[](https://github.com/dbbs-lab/bsb-arbor/actions/workflows/main.yml)
|
|
2
|
-
[](https://github.com/psf/black)
|
|
3
|
-
|
|
4
|
-
# bsb-arbor
|
|
5
|
-
|
|
6
|
-
bsb-arbor is a plugin of the [BSB](https://github.com/dbbs-lab/bsb) (see also
|
|
7
|
-
[bsb-core](https://github.com/dbbs-lab/bsb-core)).
|
|
8
|
-
It contains the interfaces and tools to simulate BSB circuit with the
|
|
9
|
-
[Arbor simulator](https://arbor-sim.org/).
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|