Skip to content

Commit 4375acd

Browse files
committed
Add test
1 parent 4b8d957 commit 4375acd

4 files changed

Lines changed: 56 additions & 27 deletions

File tree

.github/workflows/non_omv.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Non OMV tests
2+
3+
on:
4+
push:
5+
branches: [ master, development, experimental ]
6+
pull_request:
7+
branches: [ master, development, experimental ]
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
python-version: [ "3.12" ]
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Set up Python ${{ matrix.python-version }}
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
25+
- name: Run Python scripts
26+
run: |
27+
echo "Running non OMV tests..."
28+
cd Python
29+
pip install -r requirements.txt
30+
./test.sh

neuromlmodel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def add_neuroml_model(
9090
if __name__ == "__main__":
9191
plotter = pv.Plotter()
9292

93-
add_neuroml_model(plotter, "NeuroPAL_All_straightened.net.nml", somas_only=True)
93+
add_neuroml_model(plotter, "c302_D_Full.net.nml", somas_only=False)
9494
plotter.set_background("white")
9595
plotter.add_axes()
9696

requirements.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Worm3DViewer Requirements
2+
pyvista
3+
stpyvista
4+
5+
libneuroml
6+
pyneuroml
7+
ruff

virtualworm.py

Lines changed: 18 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,46 +6,38 @@
66
NEURONS_OBJ_FILE = "neurons.obj"
77

88

9-
def add_virtualworm_muscles(plotter):
9+
def add_virtualworm_muscles(plotter, scale=20, translate=(-40, 0, 0)):
1010
print("Adding virtual worm file %s..." % BODY_WALL_MUSCLE_OBJ_FILE)
1111
mesh = pv.read(BODY_WALL_MUSCLE_OBJ_FILE)
12-
mesh.scale(20, inplace=True)
13-
mesh.translate((-40, 0, 0), inplace=True)
1412

15-
plotter.add_mesh(mesh, smooth_shading=True, color="green")
13+
mesh.scale(scale, inplace=True)
14+
mesh.translate((translate), inplace=True)
1615

16+
conn = mesh.connectivity("all")
1717

18-
def add_virtualworm_neurons(plotter):
19-
print("Adding virtual worm file %s..." % NEURONS_OBJ_FILE)
20-
mesh2 = pv.read(NEURONS_OBJ_FILE)
21-
mesh2.scale(20, inplace=True)
22-
mesh2.translate((-80, 0, 0), inplace=True)
18+
plotter.add_mesh(conn, smooth_shading=True, color="green")
2319

24-
plotter.add_mesh(mesh2, smooth_shading=True, color="orange")
2520

26-
"""
27-
conn = mesh.connectivity('all')
28-
print(conn)
29-
# Format scalar bar text for integer values.
30-
scalar_bar_args = dict(
31-
fmt='%.f',
21+
def add_virtualworm_neurons(plotter, scale=20, translate=(-80, 0, 0)):
22+
print("Adding virtual worm file %s..." % NEURONS_OBJ_FILE)
23+
mesh2 = pv.read(NEURONS_OBJ_FILE)
24+
mesh2.scale(scale, inplace=True)
25+
mesh2.translate(translate, inplace=True)
26+
27+
# plotter.add_mesh(mesh2, smooth_shading=True, color="orange")
28+
conn = mesh2.connectivity("all")
29+
plotter.add_mesh(
30+
conn,
31+
smooth_shading=True,
32+
cmap="jet",
3233
)
3334

34-
cpos = [(10.5, 12.2, 18.3), (0.0, 0.0, 0.0), (0.0, 1.0, 0.0)]
35-
36-
37-
conn.plot(
38-
categories=True,
39-
cmap='jet',
40-
scalar_bar_args=scalar_bar_args,
41-
cpos=cpos,
42-
)"""
43-
4435

4536
if __name__ == "__main__":
4637
pl = pv.Plotter()
4738

4839
add_virtualworm_muscles(pl)
40+
add_virtualworm_neurons(pl)
4941

5042
pl.set_background("white")
5143
pl.add_axes()

0 commit comments

Comments
 (0)