Skip to content
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

WIP: add tests/refactor fieldmap code #71

Merged
merged 23 commits into from
Jul 21, 2016

Conversation

berleant
Copy link
Contributor

No description provided.

@berleant berleant changed the title WIP: add tests for fieldmap WIP: add tests Jun 23, 2016
@oesteban
Copy link
Member

oesteban commented Jun 23, 2016

@shoshber, maybe this would fit in this PR since you are refactoring the fieldmaps machinery.

The naming se_pair_workflow happens to be incorrect. Actually, in the AA database, the fieldmap is computed from 8 images (four pairs of SE acquisitions). We should think of a different way to name all of this because pair is particularly misleading: it is easily confounded with computing the fieldmap using a pair of GRE acquisitions (#20) and looking at the phase difference. Actually, the latter case is a lot more appropriate for the pair word, since it is always computed with two (you could use more, but I don't think anybody is doing that).

On the other case (our current se_pair_workflow) it is appropriate to have more than two images. Results improve significantly.

@oesteban
Copy link
Member

Actually, this was already open: #62

@berleant
Copy link
Contributor Author

Circle ci test is failing because the docker image does not rebuild unless preprocessing-workflow/master is changed, but it needs to be rebuilt to read the new dependencies.

@berleant berleant changed the title WIP: add tests WIP: add tests/refactor fieldmap code Jun 24, 2016
@oesteban
Copy link
Member

Circle ci test is failing because the docker image does not rebuild unless preprocessing-workflow/master is changed, but it needs to be rebuilt to read the new dependencies.

Are you sure? I'd say you are not not using the docker image to run your tests... But I might be wrong because I just took a very brief look into this.

@@ -20,6 +20,9 @@ dependencies:
- docker build -t oesteban/fmriprep .
test:
override:
# run unit tests
- pwd
- python -m unittest discover test
Copy link
Member

@oesteban oesteban Jul 15, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not using the docker image to run your tests... Please see build/circle_tests.sh to see how to run them inside the docker image.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you! I had not looked into this very much but I think you just saved me a lot of time

@@ -20,6 +20,11 @@ dependencies:
- docker build -t oesteban/fmriprep .
test:
override:
# run unit tests
- source activate crnenv
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the workflow is containerized in a docker image. Thus, anything you want to do should be inside the image. To run code inside the image there are several strategies (see https://github.com/poldracklab/preprocessing-workflow/blob/master/build/circle_tests.sh#L6).

Basically, you may want to write an entry point for the docker image (like https://github.com/poldracklab/preprocessing-workflow/blob/master/build/files/run_fmriprep) in which you source the environment and call the tests. Finally, you will call the fmriprep docker image setting this new entrypoint (with something like --entrypoint=/usr/local/bin/run_shoshber_tests). This will replace the default entrypoint run_fmriprep).

Anything you place in that directory with the preffix run_ will be placed and granted permissions in the docker image automatically.

@@ -3,4 +3,6 @@
set -x
set -e

docker run -t --entrypoint="/usr/bin/run_unittests" -w "/root/src/preprocessing-workflow" oesteban/fmriprep
Copy link
Member

@oesteban oesteban Jul 20, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are almost there. Before the image name oesteban/fmriprep you need to specify the entrypoint. In your case it is --entrypoint=/usr/bin/run_unittests. And you're done!

Edit by @shoshber: I think this is already true?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, if you want CircleCI to understand this test as a separate test (and run always the second line of this file), then you will need to put this line as a new entry in the circle.yml file. Actually, having this file is not necessary here, we could also get the smoke test out to the yml file and remove this build/circle_tests.sh

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great suggestion! I won't act on it now because not trying to find a perfect solution here, especially because I'm supposed to be working on fieldmap stuff--I just want to close this pull request because long-running pr's are bad form in my book. It is true that the test infrastructure (e.g., files in the build directory) in this package is a little wonky. Maybe create an issue for un-wonkifying the test infrastructure?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shoshber Ok, now I see that the entrypoint was there :). Sorry about that.

@berleant
Copy link
Contributor Author

Yussssssss

@berleant berleant merged commit 1344e90 into nipreps:master Jul 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants