-
Notifications
You must be signed in to change notification settings - Fork 36
Fix Solver Tests, addressing #156 #166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
57 commits
Select commit
Hold shift + click to select a range
75422ee
compare dataframes more efficiently, recompute some reference solutions
ncdorn b5b5d59
update refefrence solution
ncdorn bfdc35d
update reference solutions for Open Loop Coronary cases
ncdorn df63bd9
Clean up code and update ref vs res plotting
ncdorn 5d12245
Remove unused plotting functions from utils.py
ncdorn 669be6a
some values close to zero still have relative difference above tolerance
ncdorn 23bebd7
Refine relative difference calculation and tolerance check in run_wit…
ncdorn a78a67b
Fix relative difference calculation to handle absolute values and rem…
ncdorn b1cc0e7
Replace coverage import with pytest coverage for improved testing int…
ncdorn dc4b1a4
Simplify error message for tolerance assertion in run_with_reference …
ncdorn 58e2c9b
update solver flow tolerance to see if tests pass on Ubuntu
ncdorn 4fdc3e1
Fix pressure column name and enhance failure message with relative di…
ncdorn d9ab50a
Update solver + test tolerance values and enhance reference solution …
ncdorn 38911ef
adjust solver and testing tolerances such that tests pass, and add te…
ncdorn f166cbd
update solver tolerance, recompute reference solutions, relax test to…
ncdorn c7bd22a
tighten simulation tolerance for closedLoopHeart_singleVessel.json
ncdorn 7748afe
tighten all test case absolute tolerances to 1e-9 and initialize clos…
ncdorn 29e0618
loosen tolerance on coupledblock CLHSV, tighten tolerance on CLHSV
ncdorn 990bdc2
reduce number of timesteps in coupledblock cases
ncdorn 4ed1029
loosen abs tolerances on certain test cases
ncdorn e8cdb4b
reset solver tolerances
ncdorn 037d227
reset num timesteps
ncdorn 2d67efa
combine comments for closed loop blocks
ncdorn f2a0ea7
fix reference result i/o issue, fix result matching issue, create dif…
ncdorn 43d37ca
improve difference error and clean up code
ncdorn 476041b
print result and reference to debug other operating systems
ncdorn 0498f0a
test dataframe prints reference and result values
ncdorn 6a4ee19
add timesteps to test comparison dataframe
ncdorn a8fbcb0
reset coverage
ncdorn 5477fbf
reduce timesteps in coupledblock tests
ncdorn f18bd7b
increase solver tolerance and reduce timesteps for coupledblock tests
ncdorn b54f7e2
tighten solver tolerance for copuledblock tests
ncdorn 14d18a9
tighten solver tolerance for coupledblock tests
ncdorn 70e0262
reduce number of timesteps for copuledblock tests
ncdorn aaf9c84
reduce number of timesteps for coupledblock test cases
ncdorn 52df0e7
reset number of timesteps for coupledblock test cases
ncdorn 8d2fee5
100 time steps
mrp089 c1ff81c
adapt reference solution
mrp089 354f550
100 timesteps for coupledblock test cases
ncdorn 4d66191
reset solver tolerance for 100 timesteps
ncdorn 3b51ae3
recompute reference solutions from ubuntu machine
ncdorn 9632cea
fix timesteps in coupled block test cases to remove need for interpol…
ncdorn 5cef229
clean up code
ncdorn 5184a51
clean up time array to prevent rounding
ncdorn b0204ba
reduce number of cardiac cycles
ncdorn dbbaf25
convert coupledblocks to steady flow
ncdorn 4825f0d
increase number of cardiac cycles
ncdorn 9b99e39
Merge branch 'fix-solver-tests' of https://github.com/ncdorn/svZeroDS…
ncdorn b6391ef
clean up time array to prevent rounding
ncdorn 58beabb
update reference solution
ncdorn ccd0e80
increase timesteps and adjust external coupling block array
ncdorn 16dac29
increase cardiac cycles
ncdorn 00de208
reset back to 100 timesteps
ncdorn 7203dd1
increase test tolerance only for coupledbock withCoronaries case
ncdorn 9f9783e
increase timesteps for withcoronaries case
ncdorn 8575880
increase test tolerance for withcoronaries case
ncdorn 398236b
remove default values from test function
ncdorn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| # Testing Guide | ||
|
|
||
| [Integration testing](https://en.wikipedia.org/wiki/Integration_testing) is an essential part of software development. It is performed when integrating code changes into the main development branch to verify that the code works as expected. The following sections describe how to run and add integration tests used to the svMultiPhysics program. | ||
|
|
||
|
|
||
| # Build svZeroDSolver | ||
|
|
||
| Running a test case requires you to [build svZeroDSolver](https://simvascular.github.io/documentation/rom_simulation.html#0d-solver-install) and install with pip in order to run test cases using `pytest` | ||
|
|
||
| # Running tests using pytest | ||
|
|
||
| to run the full set of svZeroDSolver test cases, navigate to the `tests/` directory and run `pytest` from the terminal | ||
|
|
||
| ## Create a new solver test | ||
|
|
||
| In order to create a new test for the solver, complete the following steps: | ||
|
|
||
| 1. Create a svZeroDSolver json file for the test (e.g. `pulsatileFlow_R_RCR.json`) in the `tests/cases` directory | ||
| 2. Verify the results. If possible, verify against an analystical solution. If this is not feasible, find some way to verify that the test results are correct. For example, you might use reference solutions from other codes, manufactured solutions, convergence analysis, or something of that variety. | ||
| 3. Compute a reference solution for the test by navigating to the `tests` directory and running `python compute_ref_sol.py <your_test_case_name..json>` from the terminal. This should create a resultant `result_your_test_case_name.json` file in the `tests/cases/results` directory. Verify the result is there. | ||
| 4. Add your test case to the `pytest` parametrization in `test_solver.py`. simply add the name of your test `json` to the list of strings after the `@pytest.mark.parametrize` decorator. | ||
| 5. Verify that the test runs properly by running `pytest` from the terminal while in the `tests` directory. | ||
|
|
||
|
|
||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.