Skip to content

Commit 47fa629

Browse files
author
Goran Jelic-Cizmek
committed
Merge remote-tracking branch 'origin/jelic/refactor_coverage' into jelic/refactor_coverage
2 parents d692cea + 5cf9a74 commit 47fa629

18 files changed

Lines changed: 179 additions & 50 deletions

File tree

.github/workflows/coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ jobs:
248248
PATH="${PWD}/bin:${PATH}" \
249249
LD_LIBRARY_PATH="${PWD}/lib:${LD_LIBRARY_PATH}" \
250250
DYLD_LIBRARY_PATH="${PWD}/lib:${DYLD_LIBRARY_PATH}" \
251-
"${python}" -c "from neuron import h; import neuron; neuron.test();neuron.test_rxd();"
251+
"${python}" -c "from neuron import h; import neuron; neuron.test();neuron.test_rxd(); from neuron.tests import test_nmodl; test_nmodl.test_nmodl()"
252252
done
253253
cmake --build . --target cover_collect
254254
cmake --build . --target cover_combine

.github/workflows/neuron-ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,15 @@ jobs:
5959
config:
6060
build_mode: cmake
6161
cmake_option: -DNRN_ENABLE_CORENEURON=ON
62-
-DNRN_ENABLE_INTERVIEWS=OFF -DNMODL_SANITIZERS=undefined
62+
-DNRN_ENABLE_INTERVIEWS=OFF
6363
flag_warnings: ON
6464
sanitizer: undefined
6565
- os: ubuntu-22.04
6666
config:
6767
build_mode: cmake
6868
# TODO: CoreNEURON is only LeakSanitizer-clean if we disable MPI
6969
cmake_option: -DNRN_ENABLE_CORENEURON=ON
70-
-DNRN_ENABLE_INTERVIEWS=OFF -DNMODL_SANITIZERS=address
70+
-DNRN_ENABLE_INTERVIEWS=OFF
7171
# TODO: address-leak is the dream, but there are many problems,
7272
# including external ones from the MPI implementations
7373
sanitizer: address
@@ -85,14 +85,14 @@ jobs:
8585
build_mode: cmake
8686
# TODO: investigate rxd test timeouts in this build and re-enable them
8787
cmake_option: -DNRN_ENABLE_CORENEURON=ON -DNRN_ENABLE_INTERVIEWS=OFF
88-
-DNRN_ENABLE_RX3D=OFF -DNMODL_SANITIZERS=address
88+
-DNRN_ENABLE_RX3D=OFF
8989
sanitizer: address
9090
- os: macOS-14
9191
config:
9292
build_mode: cmake
9393
# TODO: investigate rxd test timeouts in this build and re-enable them
9494
cmake_option: -DNRN_ENABLE_CORENEURON=ON -DNRN_ENABLE_INTERVIEWS=OFF
95-
-DNRN_ENABLE_RX3D=OFF -DNMODL_SANITIZERS=address
95+
-DNRN_ENABLE_RX3D=OFF
9696
sanitizer: thread
9797
fail-fast: false
9898

docs/cmake_doc/index.rst

Lines changed: 0 additions & 8 deletions
This file was deleted.

docs/cmake_doc/options.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
CMake Build Options
2+
~~~~~~~~~~~~~~~~~~~
3+
14
Introduction
25
============
36
The NEURON build system now uses CMake as of version 7.8 circa Nov 2019.

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ and more (use the links on the side or search).
1717
:hidden:
1818

1919
install/install
20-
cmake_doc/index
20+
cmake_doc/options.rst
2121
install/developer
2222

2323
.. toctree::

packaging/python/test_wheels.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ run_serial_test () {
105105

106106
# Test 3: run coreneuron binary shipped inside wheel
107107
if [[ "$has_coreneuron" == "true" ]]; then
108+
$python_exe -c "from neuron.tests import test_nmodl; test_nmodl.test_nmodl()"
108109
HOC_LIBRARY_PATH=${PWD}/test/ringtest nrniv test/ringtest/ring.hoc
109110
mv out.dat out.nrn.dat
110111
nrniv-core --datpath .
@@ -190,7 +191,7 @@ run_parallel_test() {
190191
run_mpi_test "mpirun.mpich" "MPICH" ""
191192
# choose openmpi
192193
sudo update-alternatives --set mpi-${ARCH_DIR}-linux-gnu /usr/lib/${ARCH_DIR}-linux-gnu/openmpi/include
193-
run_mpi_test "mpirun.openmpi" "OpenMPI" ""
194+
run_mpi_test "mpirun.openmpi --oversubscribe" "OpenMPI" ""
194195

195196
# linux desktop or docker container used for wheel
196197
else

share/lib/python/neuron/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ set(NRN_PYTHON_FILES_LIST
4646
tests/test_rxd.json)
4747

4848
set(NRN_PYTHON_NMODL_FILES_LIST
49+
tests/test_nmodl.py
4950
nmodl/dsl.py
5051
nmodl/symtab.py
5152
nmodl/ext/example/passive.mod

share/lib/python/neuron/rxd/geometry3d/FullJoinMorph.py

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,7 @@ def minmax(lst, old):
141141
# soma: modified when ctng properly assigns soma obj to segments
142142
if soma_objects:
143143
for item, seg in soma_objects.items():
144-
if seg in final_seg_dict:
145-
final_seg_dict[seg].append(item)
146-
else:
147-
final_seg_dict[seg] = [item]
144+
final_seg_dict.setdefault(seg, []).append(item)
148145

149146
# assign join objects
150147
for jg in join_groups:
@@ -154,18 +151,12 @@ def minmax(lst, old):
154151
if (not (isinstance(item, Cone) or isinstance(item, Cylinder))) or (
155152
item in join_objects
156153
):
157-
if seg in final_seg_dict.keys():
158-
final_seg_dict[seg].append(item)
159-
else:
160-
final_seg_dict[seg] = [item]
154+
final_seg_dict.setdefault(seg, []).append(item)
161155

162156
# complete final segment dictionary
163157
for cone in cones:
164158
seg = segment_dict[(cone._x0, cone._y0, cone._z0, cone._x1, cone._y1, cone._z1)]
165-
if seg in final_seg_dict.keys():
166-
final_seg_dict[seg].append(cone)
167-
else:
168-
final_seg_dict[seg] = [cone]
159+
final_seg_dict.setdefault(seg, []).append(cone)
169160

170161
# voxelize all the objects and assign voxels
171162
# output dictionaries of internal and surface voxels

share/lib/python/neuron/rxd/geometry3d/triangularMesh.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@
1111

1212
def _register_on_neighbor_map(the_map, pt, neighbor):
1313
# does not assume neighbor relations are bidirectional
14-
if pt in the_map:
15-
the_map[pt].append(neighbor)
16-
else:
17-
the_map[pt] = [neighbor]
14+
the_map.setdefault(pt, []).append(neighbor)
1815

1916

2017
class TriangularMesh:

share/lib/python/neuron/rxd/region.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,7 @@ def __init__(self, regions):
7777
self._overlap = h.SectionList(
7878
[sec for sec in r._secs1d if sec in self._overlap]
7979
)
80-
if r in _c_region_lookup:
81-
_c_region_lookup[rptr].append(self)
82-
else:
83-
_c_region_lookup[rptr] = [self]
80+
_c_region_lookup.setdefault(rptr, []).append(self)
8481

8582
def add_reaction(self, rptr, region):
8683
# for multicompartment reaction -- check all regions are present

0 commit comments

Comments
 (0)