bsb-neuron 7.2.2__tar.gz → 7.2.3__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bsb-neuron
3
- Version: 7.2.2
3
+ Version: 7.2.3
4
4
  Summary: NEURON simulator adapter for the BSB framework.
5
5
  Author-email: Robin De Schepper <robin@alexandria.sc>, Dimitri Rodarie <dimitri.rodarie@unipv.it>
6
6
  Requires-Python: >=3.10,<4
@@ -0,0 +1,17 @@
1
+ import contextlib
2
+ import warnings
3
+
4
+ from arborize.exceptions import ProxyWarning
5
+
6
+
7
+ @contextlib.contextmanager
8
+ def ignore_arborize_proxy_warnings():
9
+ try:
10
+ catch = warnings.catch_warnings(category=ProxyWarning)
11
+ except TypeError:
12
+ # Python 3.10: This catches all warnings, sorry if this bites you.
13
+ # todo: remove when dropping support for Python 3.10 (EOL Oct 2026)
14
+ catch = warnings.catch_warnings()
15
+
16
+ with catch:
17
+ yield
@@ -1,6 +1,8 @@
1
1
  import numpy as np
2
2
  from bsb import AdapterError, ConnectionModel, Parameter, config, types
3
3
 
4
+ from bsb_neuron._util import ignore_arborize_proxy_warnings
5
+
4
6
 
5
7
  @config.dynamic(
6
8
  attr_name="model_strategy",
@@ -71,6 +73,7 @@ class TransceiverModel(NeuronConnection, classmap_entry="transceiver"):
71
73
  self.create_transmitters(simdata, cs)
72
74
  self.create_receivers(simdata, cs)
73
75
 
76
+ @ignore_arborize_proxy_warnings()
74
77
  def create_transmitters(self, simdata, cs):
75
78
  """
76
79
  :type simdata: bsb_neuron.simulation.NeuronSimulationData
@@ -92,6 +95,7 @@ class TransceiverModel(NeuronConnection, classmap_entry="transceiver"):
92
95
  point = (loc[1], 0)
93
96
  cell.insert_transmitter(gid, point, source=self.source)
94
97
 
98
+ @ignore_arborize_proxy_warnings()
95
99
  def create_receivers(self, simdata, cs):
96
100
  """
97
101
  :type simdata: bsb_neuron.simulation.NeuronSimulationData
@@ -1,5 +1,6 @@
1
1
  from bsb import LocationTargetting, config, warn
2
2
 
3
+ from .._util import ignore_arborize_proxy_warnings
3
4
  from ..device import NeuronDevice
4
5
 
5
6
 
@@ -32,6 +33,7 @@ class CurrentClamp(NeuronDevice, classmap_entry="current_clamp"):
32
33
  )
33
34
  clamped = True
34
35
 
36
+ @ignore_arborize_proxy_warnings()
35
37
  def _add_clamp(self, simdata, location, **annotations):
36
38
  sx = location.arc(0.5)
37
39
  clamp = location.section.iclamp(
@@ -1,5 +1,6 @@
1
1
  from bsb import LocationTargetting, config, types
2
2
 
3
+ from .._util import ignore_arborize_proxy_warnings
3
4
  from ..device import NeuronDevice
4
5
 
5
6
 
@@ -9,6 +10,7 @@ class SpikeGenerator(NeuronDevice, classmap_entry="spike_generator"):
9
10
  synapses = config.list()
10
11
  parameters = config.catch_all(type=types.any_())
11
12
 
13
+ @ignore_arborize_proxy_warnings()
12
14
  def implement(self, adapter, simulation, simdata):
13
15
  for _model, pop in self.targetting.get_targets(
14
16
  adapter, simulation, simdata
@@ -1,5 +1,6 @@
1
1
  from bsb import LocationTargetting, config
2
2
 
3
+ from .._util import ignore_arborize_proxy_warnings
3
4
  from ..device import NeuronDevice
4
5
 
5
6
 
@@ -10,6 +11,7 @@ class SynapseRecorder(NeuronDevice, classmap_entry="synapse_recorder"):
10
11
  synapse_types = config.list()
11
12
  """List of synaptic types"""
12
13
 
14
+ @ignore_arborize_proxy_warnings()
13
15
  def implement(self, adapter, simulation, simdata):
14
16
  for _model, pop in self.targetting.get_targets(
15
17
  adapter, simulation, simdata
@@ -2,6 +2,7 @@ import warnings
2
2
 
3
3
  from bsb import LocationTargetting, config, types
4
4
 
5
+ from .._util import ignore_arborize_proxy_warnings
5
6
  from ..device import NeuronDevice
6
7
 
7
8
 
@@ -41,6 +42,7 @@ class VoltageClamp(NeuronDevice, classmap_entry="vclamp"):
41
42
  )
42
43
  clamped = True
43
44
 
45
+ @ignore_arborize_proxy_warnings()
44
46
  def _add_clamp(self, results, location, **annotations):
45
47
  sx = location.arc(0.5)
46
48
  clamp = location.section.vclamp(
@@ -1,5 +1,6 @@
1
1
  from bsb import LocationTargetting, config
2
2
 
3
+ from .._util import ignore_arborize_proxy_warnings
3
4
  from ..device import NeuronDevice
4
5
 
5
6
 
@@ -24,6 +25,7 @@ class VoltageRecorder(NeuronDevice, classmap_entry="voltage_recorder"):
24
25
  cell_id=target.id,
25
26
  )
26
27
 
28
+ @ignore_arborize_proxy_warnings()
27
29
  def _add_voltage_recorder(self, results, location, **annotations):
28
30
  section = location.section
29
31
  x = location.arc(0)
@@ -6,7 +6,7 @@ build-backend = "flit_core.buildapi"
6
6
 
7
7
  [project]
8
8
  name = "bsb-neuron"
9
- version = "7.2.2"
9
+ version = "7.2.3"
10
10
  readme = "README.md"
11
11
  requires-python = ">=3.10,<4"
12
12
  dynamic = [ "description" ]
File without changes
File without changes