-
Notifications
You must be signed in to change notification settings - Fork 36
swap actual and desired in test #105
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
Open
oscarjalnefjord
wants to merge
4
commits into
main
Choose a base branch
from
pre_paper1
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+129
−31
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
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 |
---|---|---|
|
@@ -5,6 +5,8 @@ | |
__pycache__/ | ||
*.nii.gz | ||
*.nii | ||
*.bval | ||
*.bvec | ||
*.dcm | ||
*.mat | ||
*.raw | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
{ | ||
"Gray matter": { | ||
"noise": 0.0005, | ||
"D": 0.81e-3, | ||
"f": 0.044, | ||
"Dp": 84e-3, | ||
"data": [ | ||
1.00021099, | ||
0.9668462, | ||
0.94870507, | ||
0.93594347, | ||
0.92702605, | ||
0.89596427, | ||
0.8748837, | ||
0.85339213, | ||
0.83335988, | ||
0.81319343, | ||
0.74911377, | ||
0.69206656, | ||
0.63748683, | ||
0.58790883, | ||
0.54206431, | ||
0.50051437, | ||
0.46152624 | ||
] | ||
}, | ||
"White matter": { | ||
"noise": 0.0005, | ||
"D": 0.86e-3, | ||
"f": 0.033, | ||
"Dp": 76e-3, | ||
"data": [ | ||
0.99968445, | ||
0.97478753, | ||
0.95818188, | ||
0.94546804, | ||
0.93605795, | ||
0.90321907, | ||
0.88051331, | ||
0.85720661, | ||
0.83480693, | ||
0.81373184, | ||
0.74707338, | ||
0.6854536, | ||
0.62867824, | ||
0.57723924, | ||
0.53090183, | ||
0.48602603, | ||
0.44600491 | ||
] | ||
}, | ||
"config": { | ||
"bvalues": [ | ||
0.0, | ||
10.0, | ||
20.0, | ||
30.0, | ||
40.0, | ||
80.0, | ||
110.0, | ||
140.0, | ||
170.0, | ||
200.0, | ||
300.0, | ||
400.0, | ||
500.0, | ||
600.0, | ||
700.0, | ||
800.0, | ||
900.0 | ||
] | ||
} | ||
} |
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why un-parameterize this? It seems to be doing the right thing, but I'm honestly surprised it's working. Perhaps this was somewhat unnecessary, but I'm not even really following how it's getting the data. For example,
data_ivim_fit_saved
was a nested for loop that ran each algorithm for each dataset. I don't see how this is happening anymore, but I think the number of tests hasn't changed, so it must be happening somewhere?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function previously used for parameterization (data_ivim_saved()) was hardcoded to load data from generic.json. To make use of --dataFile in the call to pytest I had to switch to parameterization by pytest_generate_tests, but an alterative would have been to change data_ivim_saved() to also loop over json files. I felt that the fomer would be more less work, but I am open for other solutions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah ok, took me a while but I see now. I do like this approach more, it seems to be more how pytest should work. My concern is that your addition doesn't cover everything the previous function,
data_ivim_fit_saved
was doing. Maybe it was no longer necessary or thing we don't want to support anymore, likexfail
orfail_first_time
? I thinkdata_ivim_fit_saved
could be entirely moved over to conftest.py into the algorithm_list function that you modified, but maybe that's not necessary?