Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed May 29, 2024
1 parent 6a5a51f commit 4221238
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion share/lib/python/neuron/rxd/region.py
Original file line number Diff line number Diff line change
Expand Up @@ -934,7 +934,7 @@ def nrn_region(self, value):
self._nrn_region = value
if value == "i" and self.geometry._surface_fraction == 0:
warnings.warn(
f"{self.name} is in the \"i\" region with a surface_fraction of 0 and will not have currents added"
f'{self.name} is in the "i" region with a surface_fraction of 0 and will not have currents added'
)
else:
raise RxDException("Cannot set nrn_region now; model already instantiated")
Expand Down
22 changes: 17 additions & 5 deletions test/rxd/test_region_sections.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,15 @@ def test_zero_fractional_volume_3d(neuron_instance):
dend1 = h.Section("dend1")
dend1.nseg = 5
import warnings

with warnings.catch_warnings(record=True) as w:
cyt = rxd.Region(dend1.wholetree(), "i", name="cyt",
geometry=rxd.FractionalVolume(volume_fraction=0.8), dx=0.25)
cyt = rxd.Region(
dend1.wholetree(),
"i",
name="cyt",
geometry=rxd.FractionalVolume(volume_fraction=0.8),
dx=0.25,
)
ca = rxd.Species(cyt, name="ca", charge=2, initial=1e-12)
dend1.L = 10
dend1.diam = 2
Expand All @@ -51,12 +57,18 @@ def test_zero_fractional_volume_1d(neuron_instance):
dend1 = h.Section("dend1")
dend1.nseg = 5
import warnings

with warnings.catch_warnings(record=True) as w:
cyt = rxd.Region(dend1.wholetree(), "i", name="cyt",
geometry=rxd.FractionalVolume(volume_fraction=0.8), dx=0.25)
cyt = rxd.Region(
dend1.wholetree(),
"i",
name="cyt",
geometry=rxd.FractionalVolume(volume_fraction=0.8),
dx=0.25,
)
ca = rxd.Species(cyt, name="ca", charge=2, initial=1e-12)
dend1.L = 10
dend1.diam = 2
rxd.set_solve_type(domain=[dend1], dimension=1)
h.finitialize()
assert len(w) == 1
assert len(w) == 1

0 comments on commit 4221238

Please sign in to comment.