Skip to content

Commit 6a72fcd

Browse files
authored
Run all repositories for maximum output (#25)
2 parents 6f3678f + 7f2dc73 commit 6a72fcd

22 files changed

+33906
-2
lines changed

COMPREHENSIVE_RUN_SUMMARY.md

Lines changed: 777 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
{
2+
"timestamp": "2025-11-25T14:54:34.374584",
3+
"benchmark_suite": "HBCM Performance",
4+
"results": [
5+
{
6+
"test_name": "HBCM Single Step",
7+
"duration_s": 0.01442199200002392,
8+
"iterations": 10000,
9+
"mean_latency_ms": 0.0012409382,
10+
"median_latency_ms": 0.00122,
11+
"p95_latency_ms": 0.001327,
12+
"p99_latency_ms": 0.001873,
13+
"min_latency_ms": 0.001036,
14+
"max_latency_ms": 0.014447,
15+
"throughput_ops_per_sec": 693385.4907133088,
16+
"memory_mb": 0.0,
17+
"metadata": {
18+
"dt": 0.001,
19+
"state_size": 4
20+
}
21+
},
22+
{
23+
"test_name": "HBCM Short Simulation (100 steps)",
24+
"duration_s": 0.017287748000000006,
25+
"iterations": 100,
26+
"mean_latency_ms": 0.17287748,
27+
"median_latency_ms": 0.164737,
28+
"p95_latency_ms": 0.197652,
29+
"p99_latency_ms": 0.345699,
30+
"min_latency_ms": 0.161277,
31+
"max_latency_ms": 0.345699,
32+
"throughput_ops_per_sec": 5784.4434104430475,
33+
"memory_mb": 0.0,
34+
"metadata": {
35+
"steps": 100,
36+
"simulated_time_s": 0.1
37+
}
38+
},
39+
{
40+
"test_name": "HBCM Long Simulation (10,000 steps)",
41+
"duration_s": 0.21427981399999999,
42+
"iterations": 10,
43+
"mean_latency_ms": 21.4279814,
44+
"median_latency_ms": 20.903914,
45+
"p95_latency_ms": 26.940432,
46+
"p99_latency_ms": 26.940432,
47+
"min_latency_ms": 18.785698,
48+
"max_latency_ms": 26.940432,
49+
"throughput_ops_per_sec": 46.667951653159456,
50+
"memory_mb": 0.0,
51+
"metadata": {
52+
"steps": 10000,
53+
"simulated_time_s": 10.0
54+
}
55+
},
56+
{
57+
"test_name": "Real-Time Capability (1000 Hz)",
58+
"duration_s": 0.015861716999978626,
59+
"iterations": 10000,
60+
"mean_latency_ms": 0.0013879299,
61+
"median_latency_ms": 0.001358,
62+
"p95_latency_ms": 0.001571,
63+
"p99_latency_ms": 0.001757,
64+
"min_latency_ms": 0.001097,
65+
"max_latency_ms": 0.011467,
66+
"throughput_ops_per_sec": 630448.7717195733,
67+
"memory_mb": 0.0,
68+
"metadata": {
69+
"target_hz": 1000,
70+
"target_dt_ms": 1.0,
71+
"simulated_time_s": 10.0,
72+
"realtime_factor": 630.4487717195733,
73+
"can_run_realtime": true
74+
}
75+
},
76+
{
77+
"test_name": "Parameter Scaling (dt=0.0001s)",
78+
"duration_s": 0.0012714360000000001,
79+
"iterations": 1000,
80+
"mean_latency_ms": 0.001271436,
81+
"median_latency_ms": 0.001222,
82+
"p95_latency_ms": 0.001351,
83+
"p99_latency_ms": 0.001549,
84+
"min_latency_ms": 0.001071,
85+
"max_latency_ms": 0.021118,
86+
"throughput_ops_per_sec": 786512.2585800622,
87+
"memory_mb": 0.0,
88+
"metadata": {
89+
"dt": 0.0001
90+
}
91+
},
92+
{
93+
"test_name": "Parameter Scaling (dt=0.0005s)",
94+
"duration_s": 0.0012715989999999985,
95+
"iterations": 1000,
96+
"mean_latency_ms": 0.001271599,
97+
"median_latency_ms": 0.00124,
98+
"p95_latency_ms": 0.001336,
99+
"p99_latency_ms": 0.001403,
100+
"min_latency_ms": 0.00114,
101+
"max_latency_ms": 0.011554,
102+
"throughput_ops_per_sec": 786411.4394553638,
103+
"memory_mb": 0.0,
104+
"metadata": {
105+
"dt": 0.0005
106+
}
107+
},
108+
{
109+
"test_name": "Parameter Scaling (dt=0.001s)",
110+
"duration_s": 0.0012477389999999994,
111+
"iterations": 1000,
112+
"mean_latency_ms": 0.001247739,
113+
"median_latency_ms": 0.001241,
114+
"p95_latency_ms": 0.001334,
115+
"p99_latency_ms": 0.001412,
116+
"min_latency_ms": 0.001076,
117+
"max_latency_ms": 0.004644,
118+
"throughput_ops_per_sec": 801449.6621488953,
119+
"memory_mb": 0.0,
120+
"metadata": {
121+
"dt": 0.001
122+
}
123+
},
124+
{
125+
"test_name": "Parameter Scaling (dt=0.005s)",
126+
"duration_s": 0.001226551999999999,
127+
"iterations": 1000,
128+
"mean_latency_ms": 0.001226552,
129+
"median_latency_ms": 0.001217,
130+
"p95_latency_ms": 0.001326,
131+
"p99_latency_ms": 0.00145,
132+
"min_latency_ms": 0.001063,
133+
"max_latency_ms": 0.003936,
134+
"throughput_ops_per_sec": 815293.6035325048,
135+
"memory_mb": 0.0,
136+
"metadata": {
137+
"dt": 0.005
138+
}
139+
},
140+
{
141+
"test_name": "Parameter Scaling (dt=0.01s)",
142+
"duration_s": 0.00127227,
143+
"iterations": 1000,
144+
"mean_latency_ms": 0.00127227,
145+
"median_latency_ms": 0.001262,
146+
"p95_latency_ms": 0.00137,
147+
"p99_latency_ms": 0.001494,
148+
"min_latency_ms": 0.001082,
149+
"max_latency_ms": 0.008907,
150+
"throughput_ops_per_sec": 785996.6830939973,
151+
"memory_mb": 0.0,
152+
"metadata": {
153+
"dt": 0.01
154+
}
155+
}
156+
]
157+
}

benchmarks/results/plp_vs_pid_validation.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50022,7 +50022,7 @@
5002250022
"disturbance_rejection_time": 0.0,
5002350023
"noise_amplification": 0.24693005316107844,
5002450024
"control_effort": 1.9646503563061755,
50025-
"computation_time_us": 6.768041399999999,
50025+
"computation_time_us": 6.8092844,
5002650026
"stability_margin": 0.20406070310891564,
5002750027
"max_control_value": 0.21381508940429902
5002850028
},
@@ -50034,7 +50034,7 @@
5003450034
"disturbance_rejection_time": 0.0,
5003550035
"noise_amplification": 0.37800948291826,
5003650036
"control_effort": 8.311934466214723,
50037-
"computation_time_us": 4.0539564,
50037+
"computation_time_us": 4.0034568,
5003850038
"stability_margin": 0.37160875122898035,
5003950039
"max_control_value": 1.0
5004050040
}

pytest_output.log

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
============================= test session starts ==============================
2+
platform linux -- Python 3.11.14, pytest-9.0.1, pluggy-1.6.0 -- /root/.local/share/uv/tools/pytest/bin/python
3+
cachedir: .pytest_cache
4+
rootdir: /home/user/Multi-Heart-Model
5+
collecting ... collected 8 items / 6 errors
6+
7+
==================================== ERRORS ====================================
8+
_____ ERROR collecting tests/integration/test_microprocessor_motorhand.py ______
9+
ImportError while importing test module '/home/user/Multi-Heart-Model/tests/integration/test_microprocessor_motorhand.py'.
10+
Hint: make sure your test modules/packages have valid Python names.
11+
Traceback:
12+
/usr/lib/python3.11/importlib/__init__.py:126: in import_module
13+
return _bootstrap._gcd_import(name[level:], package, level)
14+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
15+
tests/integration/test_microprocessor_motorhand.py:10: in <module>
16+
import numpy as np
17+
E ModuleNotFoundError: No module named 'numpy'
18+
___________ ERROR collecting tests/organ_chip/test_drug_toxicity.py ____________
19+
ImportError while importing test module '/home/user/Multi-Heart-Model/tests/organ_chip/test_drug_toxicity.py'.
20+
Hint: make sure your test modules/packages have valid Python names.
21+
Traceback:
22+
/usr/lib/python3.11/importlib/__init__.py:126: in import_module
23+
return _bootstrap._gcd_import(name[level:], package, level)
24+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
25+
tests/organ_chip/test_drug_toxicity.py:18: in <module>
26+
import numpy as np
27+
E ModuleNotFoundError: No module named 'numpy'
28+
____________ ERROR collecting tests/organchip/test_drug_toxicity.py ____________
29+
ImportError while importing test module '/home/user/Multi-Heart-Model/tests/organchip/test_drug_toxicity.py'.
30+
Hint: make sure your test modules/packages have valid Python names.
31+
Traceback:
32+
/usr/lib/python3.11/importlib/__init__.py:126: in import_module
33+
return _bootstrap._gcd_import(name[level:], package, level)
34+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
35+
tests/organchip/test_drug_toxicity.py:17: in <module>
36+
from organchip.orchestrator import OrganChipSuite, create_default_organ_chip_suite
37+
E ModuleNotFoundError: No module named 'organchip.orchestrator'
38+
_______ ERROR collecting tests/surgical_robotics/test_dvrk_interface.py ________
39+
ImportError while importing test module '/home/user/Multi-Heart-Model/tests/surgical_robotics/test_dvrk_interface.py'.
40+
Hint: make sure your test modules/packages have valid Python names.
41+
Traceback:
42+
/usr/lib/python3.11/importlib/__init__.py:126: in import_module
43+
return _bootstrap._gcd_import(name[level:], package, level)
44+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
45+
tests/surgical_robotics/test_dvrk_interface.py:6: in <module>
46+
import numpy as np
47+
E ModuleNotFoundError: No module named 'numpy'
48+
______ ERROR collecting tests/surgical_robotics/test_physio_controller.py ______
49+
ImportError while importing test module '/home/user/Multi-Heart-Model/tests/surgical_robotics/test_physio_controller.py'.
50+
Hint: make sure your test modules/packages have valid Python names.
51+
Traceback:
52+
/usr/lib/python3.11/importlib/__init__.py:126: in import_module
53+
return _bootstrap._gcd_import(name[level:], package, level)
54+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
55+
tests/surgical_robotics/test_physio_controller.py:6: in <module>
56+
import numpy as np
57+
E ModuleNotFoundError: No module named 'numpy'
58+
____________________ ERROR collecting tests/test_models.py _____________________
59+
ImportError while importing test module '/home/user/Multi-Heart-Model/tests/test_models.py'.
60+
Hint: make sure your test modules/packages have valid Python names.
61+
Traceback:
62+
/usr/lib/python3.11/importlib/__init__.py:126: in import_module
63+
return _bootstrap._gcd_import(name[level:], package, level)
64+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
65+
tests/test_models.py:3: in <module>
66+
from src.cardiac import VanDerPolOscillator
67+
src/__init__.py:3: in <module>
68+
from . import neural, cardiac, coupling # re-export packages
69+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
70+
src/cardiac/__init__.py:26: in <module>
71+
from .luo_rudy import LuoRudyModel, LuoRudyParameters
72+
src/cardiac/luo_rudy.py:29: in <module>
73+
import numpy as np
74+
E ModuleNotFoundError: No module named 'numpy'
75+
=========================== short test summary info ============================
76+
ERROR tests/integration/test_microprocessor_motorhand.py
77+
ERROR tests/organ_chip/test_drug_toxicity.py
78+
ERROR tests/organchip/test_drug_toxicity.py
79+
ERROR tests/surgical_robotics/test_dvrk_interface.py
80+
ERROR tests/surgical_robotics/test_physio_controller.py
81+
ERROR tests/test_models.py
82+
!!!!!!!!!!!!!!!!!!! Interrupted: 6 errors during collection !!!!!!!!!!!!!!!!!!!!
83+
============================== 6 errors in 0.65s ===============================

run_tests_simple.py

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
#!/usr/bin/env python3
2+
"""
3+
Simple test runner that doesn't require pytest
4+
Runs basic functionality tests for all models
5+
"""
6+
7+
import sys
8+
from pathlib import Path
9+
10+
sys.path.insert(0, str(Path(__file__).parent / 'src'))
11+
12+
def test_van_der_pol():
13+
"""Test Van der Pol oscillator"""
14+
from src.cardiac import VanDerPolOscillator
15+
16+
model = VanDerPolOscillator(mu=1.5, omega=1.0)
17+
state = (1.0, 0.0)
18+
19+
# Test step
20+
new_state = model.step(0.0, state, 0.001)
21+
assert len(new_state) == 2
22+
assert not any(v != v for v in new_state) # Check for NaN
23+
24+
return True
25+
26+
def test_fitzhugh_nagumo():
27+
"""Test FitzHugh-Nagumo model"""
28+
from src.neural import FitzHughNagumo
29+
30+
model = FitzHughNagumo(stimulus_amplitude=0.5)
31+
state = (0.0, 0.0)
32+
33+
# Test step
34+
new_state = model.step(0.0, state, 0.001)
35+
assert len(new_state) == 2
36+
assert not any(v != v for v in new_state)
37+
38+
return True
39+
40+
def test_hbcm():
41+
"""Test Heart-Brain Coupling Model"""
42+
from src.cardiac import VanDerPolOscillator
43+
from src.neural import FitzHughNagumo
44+
from src.coupling import HeartBrainCouplingModel
45+
46+
neural = FitzHughNagumo()
47+
cardiac = VanDerPolOscillator()
48+
hbcm = HeartBrainCouplingModel(neural_model=neural, cardiac_model=cardiac)
49+
50+
# Test simulation
51+
trajectory = hbcm.simulate((0.0, 0.0, 1.0, 0.0), (0.0, 1.0), 0.001)
52+
assert len(trajectory) > 0
53+
54+
return True
55+
56+
def test_primal_processor():
57+
"""Test Primal Logic Processor"""
58+
from src.microprocessor import PrimalLogicProcessor
59+
60+
processor = PrimalLogicProcessor()
61+
control, state = processor.compute_control(
62+
current_value=30.0,
63+
target_value=0.0,
64+
timestamp=0.0
65+
)
66+
67+
assert -10.0 <= control <= 10.0
68+
assert state.error == 30.0
69+
70+
return True
71+
72+
def test_organchip():
73+
"""Test Organ Chip Suite"""
74+
from src.organchip.orchestrator import create_default_organ_chip_suite
75+
76+
suite = create_default_organ_chip_suite()
77+
suite.verbose = False
78+
79+
# Test initialization
80+
state = suite.initialize_state(drug_amount_mg=100.0)
81+
assert 'circulation' in state
82+
83+
return True
84+
85+
def main():
86+
"""Run all tests"""
87+
print("=" * 70)
88+
print("SIMPLE TEST RUNNER - Multi-Heart-Model")
89+
print("=" * 70)
90+
91+
tests = [
92+
("Van der Pol Oscillator", test_van_der_pol),
93+
("FitzHugh-Nagumo Model", test_fitzhugh_nagumo),
94+
("Heart-Brain Coupling Model", test_hbcm),
95+
("Primal Logic Processor", test_primal_processor),
96+
("Organ Chip Suite", test_organchip),
97+
]
98+
99+
results = []
100+
101+
for name, test_func in tests:
102+
try:
103+
print(f"\nTesting {name}...")
104+
result = test_func()
105+
print(f" ✓ PASSED")
106+
results.append((name, True))
107+
except Exception as e:
108+
print(f" ✗ FAILED: {e}")
109+
results.append((name, False))
110+
111+
print("\n" + "=" * 70)
112+
print("TEST SUMMARY")
113+
print("=" * 70)
114+
115+
passed = sum(1 for _, result in results if result)
116+
total = len(results)
117+
118+
for name, result in results:
119+
status = "✓ PASS" if result else "✗ FAIL"
120+
print(f" {status}: {name}")
121+
122+
print("=" * 70)
123+
print(f" Results: {passed}/{total} tests passed ({100*passed/total:.1f}%)")
124+
print("=" * 70)
125+
126+
return 0 if passed == total else 1
127+
128+
if __name__ == "__main__":
129+
sys.exit(main())

0 commit comments

Comments
 (0)