SimVascular / svZeroDSolver-Archived

A Python lumped-parameter solver for blood flow and pressure in hemodynamic networks
Other
12 stars 14 forks source link

Test cases no longer work #33

Closed JonathanPham closed 3 years ago

JonathanPham commented 3 years ago

Due to reorganization of the svZeroDSolver, test_cases/run_tests.py no longer works.

From within the test_cases directory, running the commands, python run_tests.py or ./run_tests.py, do not work anymore. I am not sure how to fix this issue. @ktbolt can you help out?

ktbolt commented 3 years ago

The relative imports are not working for the test cases, I'll have a look.

ktbolt commented 3 years ago

@JonathanPham I've modified run_tests.py to execute the solver correctly

subprocess.check_output(['python', '-m', 'svzerodsolver.solver', inp])

However, the __init__.py file needed by SV is causing problems because svzerodsolver is being included twice. I have a workaround for that but maybe the testing should be reworked a bit.

For example, I am wondering why run_tests.py is executing the solver using a Python script rather than just calling a function from solver.py, something like

from . solver import run_solver
run_solver('solver.in')
JonathanPham commented 3 years ago

When I originally created the test cases for the 0D solver, I thought the test cases should be similar the ones used by the 1D solver. As such, run_tests.py here is based on the one used in the 1D solver. But like you said, maybe it's better if we rewrite run_tests.py to just call a function from solver.py directly. However, if we do this, would this conflict with the automated Travis testing (#28) that we want to include in the future? @ktbolt, @mrp089 any thoughts?

mrp089 commented 3 years ago

@ktbolt @mrp089 You're both right! The original testing was taken from the 1D solver (C++) and should be adapted as @ktbolt suggested.

I can do that next week!

mrp089 commented 3 years ago

Closed by #28