Skip to content

Commit

Permalink
black format for test/.../*.py
Browse files Browse the repository at this point in the history
  • Loading branch information
nrnhines committed Oct 28, 2024
1 parent 4e12ea1 commit b398627
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 6 deletions.
2 changes: 2 additions & 0 deletions test/coreneuron/test_pointer.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def sortspikes(spiketime, gidvec):
# Set globally so we can ensure the IClamp duration is shorter
tstop = 1


# Passive cell random tree so there is some inhomogeneity of ia and im
class Cell:
def __init__(self, id, nsec):
Expand Down Expand Up @@ -310,6 +311,7 @@ def cmp_spks(spikes, dir, chkpntdirs):
with open(os.path.join(dir, "temp"), "w") as f:
for spike in spikes:
f.write("{:.8g}\t{}\n".format(spike[0], int(spike[1])))

# sometimes roundoff to %.8g gives different sort.
def help(cmd, name_in, name_out):
# `cmd` is some generic utility, which does not need to have a
Expand Down
1 change: 1 addition & 0 deletions test/datahandle/test_token.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from neuron import h


# model - membrane action potential
def model():
s = h.Section()
Expand Down
1 change: 1 addition & 0 deletions test/pytest/test_nrntest_thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Tests that used to live in the thread/ subdirectory of the
https://github.com/neuronsimulator/nrntest repository
"""

import os
import pytest
from neuron import h
Expand Down
1 change: 1 addition & 0 deletions test/pytest_coreneuron/test_hoc_po.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ def test_2():

# BBSaveState for mixed (hoc and python cells) Ring.


# some helpers copied from ../parallel_tests/test_bas.py
def rmfiles():
if pc.id() == 0:
Expand Down
1 change: 1 addition & 0 deletions test/pytest_coreneuron/test_nrntest_fast.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Tests that used to live in the fast/ subdirectory of the
https://github.com/neuronsimulator/nrntest repository
"""

import math
import numpy as np
import os
Expand Down
6 changes: 3 additions & 3 deletions test/rxd/ecs/test_ecs_pure_diffusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ def make_model(nx, ny, nz, alpha, lambd, d=1.0, perm=None):
name="k",
d=d,
charge=1,
initial=lambda nd: 1
if nd.x3d**2 + nd.y3d**2 + nd.z3d**2 < (2 * dx) ** 2
else 0,
initial=lambda nd: (
1 if nd.x3d**2 + nd.y3d**2 + nd.z3d**2 < (2 * dx) ** 2 else 0
),
)

model = (ecs, k)
Expand Down
8 changes: 5 additions & 3 deletions test/rxd/hybrid/test_pure_diffusion_hybrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@ def ics_diffusion_hybrid(neuron_instance):
ca = rxd.Species(
r,
d=diff_constant,
initial=lambda node: 1
if (0.8 < node.x and node in dend1) or (node.x < 0.2 and node in dend2)
else 0,
initial=lambda node: (
1
if (0.8 < node.x and node in dend1) or (node.x < 0.2 and node in dend2)
else 0
),
)
model = ([dend1, dend2, dend3], r, ca)
yield (neuron_instance, model)
Expand Down

0 comments on commit b398627

Please sign in to comment.