bsb-arbor 0.0.0b0__py2.py3-none-any.whl → 0.0.0b1__py2.py3-none-any.whl

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/__init__.py CHANGED
@@ -3,9 +3,10 @@ Arbor simulation adapter for the BSB framework
3
3
  """
4
4
 
5
5
  from bsb.simulation import SimulationBackendPlugin
6
- from .simulation import ArborSimulation
7
- from .adapter import ArborAdapter
6
+
8
7
  from . import devices
8
+ from .adapter import ArborAdapter
9
+ from .simulation import ArborSimulation
9
10
 
10
- __version__ = "0.0.0b0"
11
+ __version__ = "0.0.0b1"
11
12
  __plugin__ = SimulationBackendPlugin(Simulation=ArborSimulation, Adapter=ArborAdapter)
bsb_arbor/adapter.py CHANGED
@@ -1,14 +1,13 @@
1
1
  import itertools
2
+ import itertools as it
3
+ import time
2
4
  import typing
3
5
 
4
- from bsb.reporting import report, warn
6
+ import arbor
5
7
  from bsb.exceptions import AdapterError, UnknownGIDError
8
+ from bsb.reporting import report, warn
6
9
  from bsb.services import MPI
7
10
  from bsb.simulation.adapter import SimulationData, SimulatorAdapter
8
- import itertools as it
9
- import time
10
- import arbor
11
-
12
11
  from bsb.storage import Chunk
13
12
 
14
13
  if typing.TYPE_CHECKING:
@@ -79,7 +78,9 @@ class Population:
79
78
  return ranges
80
79
 
81
80
  def __iter__(self):
82
- yield from itertools.chain.from_iterable(range(r[0], r[1]) for r in self._ranges)
81
+ yield from itertools.chain.from_iterable(
82
+ range(r[0], r[1]) for r in self._ranges
83
+ )
83
84
 
84
85
 
85
86
  class GIDManager:
@@ -266,7 +267,12 @@ class ArborAdapter(SimulatorAdapter):
266
267
  for device in simulation.devices.values():
267
268
  device.prepare_samples(simdata)
268
269
 
269
- def run(self, simulation):
270
+ def run(self, *simulations):
271
+ if len(simulations) != 1:
272
+ raise RuntimeError(
273
+ "Can not run multiple simultaneous simulations. Composition not implemented."
274
+ )
275
+ simulation = simulations[0]
270
276
  try:
271
277
  simdata = self.simdata[simulation]
272
278
  arbor_sim = simdata.arbor_sim
@@ -285,7 +291,7 @@ class ArborAdapter(SimulatorAdapter):
285
291
  if simulation.profiling and arbor.config()["profiling"]:
286
292
  report("printing profiler summary", level=2)
287
293
  report(arbor.profiler_summary(), level=1)
288
- return simdata.result
294
+ return [simdata.result]
289
295
  finally:
290
296
  del self.simdata[simulation]
291
297
 
bsb_arbor/cell.py CHANGED
@@ -1,11 +1,11 @@
1
1
  import abc
2
2
  import typing
3
3
 
4
+ import arbor
4
5
  from bsb import config
5
6
  from bsb.config import types
6
7
  from bsb.exceptions import ConfigurationError
7
8
  from bsb.simulation.cell import CellModel
8
- import arbor
9
9
 
10
10
  from .adapter import SingleReceiverCollection
11
11
 
bsb_arbor/connection.py CHANGED
@@ -1,8 +1,7 @@
1
+ import arbor
1
2
  import tqdm
2
-
3
3
  from bsb import config
4
4
  from bsb.simulation.connection import ConnectionModel
5
- import arbor
6
5
 
7
6
 
8
7
  class Receiver:
@@ -63,5 +62,7 @@ class ArborConnection(ConnectionModel):
63
62
 
64
63
  def gap_junction(self, conn):
65
64
  l = arbor.cell_local_label(f"gap_{conn.to_compartment.id}")
66
- g = arbor.cell_global_label(int(conn.from_id), f"gap_{conn.from_compartment.id}")
65
+ g = arbor.cell_global_label(
66
+ int(conn.from_id), f"gap_{conn.from_compartment.id}"
67
+ )
67
68
  return arbor.gap_junction_connection(g, l, self.weight)
bsb_arbor/device.py CHANGED
@@ -1,12 +1,11 @@
1
1
  import abc
2
2
 
3
+ import arbor
3
4
  from bsb import config
4
5
  from bsb.config import types
5
6
  from bsb.simulation.device import DeviceModel
6
7
  from bsb.simulation.targetting import Targetting
7
8
 
8
- import arbor
9
-
10
9
 
11
10
  @config.dynamic(attr_name="device", auto_classmap=True, classmap_entry=None)
12
11
  class ArborDevice(DeviceModel):
@@ -1,3 +1,3 @@
1
1
  from .poisson_generator import PoissonGenerator
2
- from .spike_recorder import SpikeRecorder
3
2
  from .probe import Probe
3
+ from .spike_recorder import SpikeRecorder
@@ -1,7 +1,8 @@
1
+ import arbor
1
2
  from bsb import config
3
+
2
4
  from ..connection import Receiver
3
5
  from ..device import ArborDevice
4
- import arbor
5
6
 
6
7
 
7
8
  @config.node
@@ -1,6 +1,7 @@
1
- from ..device import ArborDevice
2
- from bsb.exceptions import ConfigurationError
3
1
  import arbor
2
+ from bsb.exceptions import ConfigurationError
3
+
4
+ from ..device import ArborDevice
4
5
 
5
6
 
6
7
  class Probe(ArborDevice):
@@ -1,7 +1,7 @@
1
1
  import neo
2
-
3
2
  from bsb import config
4
3
  from bsb.services import MPI
4
+
5
5
  from ..device import ArborDevice
6
6
 
7
7
 
bsb_arbor/simulation.py CHANGED
@@ -2,6 +2,7 @@ import psutil
2
2
  from bsb import config
3
3
  from bsb.config import types
4
4
  from bsb.simulation.simulation import Simulation
5
+
5
6
  from .cell import ArborCell
6
7
  from .connection import ArborConnection
7
8
  from .device import ArborDevice
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: bsb-arbor
3
- Version: 0.0.0b0
3
+ Version: 0.0.0b1
4
4
  Summary: Arbor simulation adapter for the BSB framework
5
5
  Author-email: Robin De Schepper <robingilbert.deschepper@unipv.it>
6
6
  Description-Content-Type: text/markdown
@@ -8,7 +8,9 @@ Classifier: License :: OSI Approved :: GNU General Public License v3 or later (G
8
8
  Requires-Dist: bsb-core>=4.0.0b0,<=4.0.0b9999
9
9
  Requires-Dist: arbor~=0.9
10
10
  Requires-Dist: arborize[arbor]>=4.0.0b1
11
+ Requires-Dist: bsb-core[parallel] ; extra == "test"
11
12
  Requires-Dist: bsb-test>=0.0.0b0 ; extra == "test"
13
+ Requires-Dist: coverage~=7.0 ; extra == "test"
12
14
  Provides-Extra: test
13
15
 
14
16
  # bsb-arbor
@@ -0,0 +1,15 @@
1
+ bsb_arbor/__init__.py,sha256=Yv0mb912WIOOdwQlrHykIgU_olkGCyL85G9Bis7En_c,316
2
+ bsb_arbor/adapter.py,sha256=qJBT7BY8JIWtpK6e_SpTdrHHc72b_6tV-sWY70rCmGw,13512
3
+ bsb_arbor/cell.py,sha256=xMtSVJTx20hxT-MgqsTeGR0hieWNxI4EXOlCEPz8a8U,2176
4
+ bsb_arbor/connection.py,sha256=ZKz9qbMXpVHnqgzY3d0DevLZ1G0iaZMm2JEUF8DHFug,2285
5
+ bsb_arbor/device.py,sha256=QCoUyAtT0RtgqoGa5O69RHp1kmm1Uj3DYh_M91_8cHU,1527
6
+ bsb_arbor/simulation.py,sha256=iwFxCPFFGI7_K_Tcxd0ZJjvegJgbjSTbzx20MMeM45g,788
7
+ bsb_arbor/devices/__init__.py,sha256=2kKiJZr9ZVXM9ZmR8GsVLnx_ZzFKYZd7pxLL238_EQc,115
8
+ bsb_arbor/devices/poisson_generator.py,sha256=noBN5bjF8C_2ja_znJwvFx3kjrxDr1V_RUFjTgUvyz4,727
9
+ bsb_arbor/devices/probe.py,sha256=3S0ztYAgsjX2CNLw7-wku5J8ku6diKWKLBq4MI9F-nM,1707
10
+ bsb_arbor/devices/spike_recorder.py,sha256=WWyHPq8_Me9XEdqxpHPY6Gv17lv5m1UENQZDYQ_lEu0,1332
11
+ bsb_arbor-0.0.0b1.dist-info/entry_points.txt,sha256=8z5oyflKGOBD2smUKyrUit-_2JqBs85g8rm5YOM8SYg,43
12
+ bsb_arbor-0.0.0b1.dist-info/LICENSE,sha256=0SAgqCl8RI6Vm7Rv5YC6CPyLA2MXedQM9tq17WMXl-o,33041
13
+ bsb_arbor-0.0.0b1.dist-info/WHEEL,sha256=Sgu64hAMa6g5FdzHxXv9Xdse9yxpGGMeagVtPMWpJQY,99
14
+ bsb_arbor-0.0.0b1.dist-info/METADATA,sha256=-N8LwRL_yT2L6RLOO2FwUEuY9-qJ8q7LBhUg8VuULYI,602
15
+ bsb_arbor-0.0.0b1.dist-info/RECORD,,
@@ -1,15 +0,0 @@
1
- bsb_arbor/__init__.py,sha256=LqDOo29O6WXtFllX71ql5jw-xQvSD0Hxy5WODSiy1QI,315
2
- bsb_arbor/adapter.py,sha256=Y8XD9FyT3Lksq81Absd54IS9h1fPDWlh3R6PxbxNtIc,13277
3
- bsb_arbor/cell.py,sha256=3MGxv1q54oOvBxr_q2-RIoSjKA9us7lbyJY8U6i57xA,2176
4
- bsb_arbor/connection.py,sha256=KBuBAVZ06_25Oe4cd1Eiq3EoDaNUDk7MuuEWPfy4O0Y,2264
5
- bsb_arbor/device.py,sha256=uy8ZAdWcCuDJyPg-LnblsGIT4sCLVpYL1mjRNbfo6y0,1528
6
- bsb_arbor/simulation.py,sha256=D1cACVVABHqhbuTJYP1CizAC271Ii3GpCShfJlxI5Go,787
7
- bsb_arbor/devices/__init__.py,sha256=2nRCOpgKognnAyjlTBp6Kh8MYhH6FBeDaN_G636W8o8,115
8
- bsb_arbor/devices/poisson_generator.py,sha256=yvCtDY_uyqpzGNC_s9i0opXi0Eoshm81hShifaEm_QM,726
9
- bsb_arbor/devices/probe.py,sha256=5Pu8oCLdXuoiVNxqHUNpfLSlud3wvUZDzrY7OgJkxoU,1706
10
- bsb_arbor/devices/spike_recorder.py,sha256=D-TURub9v83g2B8nxa4akqM8BUcUIi_dzK63WWtLl0U,1332
11
- bsb_arbor-0.0.0b0.dist-info/entry_points.txt,sha256=8z5oyflKGOBD2smUKyrUit-_2JqBs85g8rm5YOM8SYg,43
12
- bsb_arbor-0.0.0b0.dist-info/LICENSE,sha256=0SAgqCl8RI6Vm7Rv5YC6CPyLA2MXedQM9tq17WMXl-o,33041
13
- bsb_arbor-0.0.0b0.dist-info/WHEEL,sha256=Sgu64hAMa6g5FdzHxXv9Xdse9yxpGGMeagVtPMWpJQY,99
14
- bsb_arbor-0.0.0b0.dist-info/METADATA,sha256=63Pjj_lklIFqdwHuVU-RXB01_HPRdrEfVG-c-bjPerI,503
15
- bsb_arbor-0.0.0b0.dist-info/RECORD,,