Closed binarybottle closed 11 years ago
you could consider two options:
pip install mindboggle-data
and it will install the package together with necessary data elementsfrom mindboggle import get_test_data
The reason i would stay away from using the data for doctests depends on how large the datasets are. for doctests you can craft a dataset that's fairly light and included with mindboggle, but leave regression and other tests to unit-tests. you can decorate those to skip the longer tests if the larger test data are not available.
+1 for (1) and satra's answer.
Actually I prefer Arno's old way. I think it's easy for users to point to where they store their data. If we use the other two options, would it be difficult for users to run MindBoggle pipeline on their own data? For example, do they need to define paths in mindboggle.get_test_data ?
@forrestbao: users should be able to run minboggle independent of whether this test data exists or not or the environment variable exists or not. if mindboggle's core code is dependent on the environment variable, then that data is integral to mindboggle and should be distributed as a dependency (via a mindboggle-data package).
doctests should not be dependent on large data - you want those things to run very quickly and to demonstrate the point and potentially code coverage rather than use them to perform regression tests. in fact data used for doc-tests should be part of the mindboggle package i think.
Thank you for your explanation @satra. I see. This is for test data. Then I +1 for your (1) answer too.
in addition to the test data for running the examples, the data that users might need to run mindboggle include:
single source of mindboggle a. mindboggle as is with any necessary data b. a separate mindboggle-data package containing data only
for an example see: http://nipy.sourceforge.net/nibabel/devel/data_pkg_design.html#data-package-design
doctests are both examples and tests
when you say "doctest", this does not necessarily mean a test within a docstring that is run when executing all tests, does it?
yes it does
is it a good idea to have externally executable tests in the docstrings, to ensure that the documentation and examples are current? if so, how do you set up and run such a test?
don't know what this means. but you should always do a test before building docs, to ensure that the docs are built on tests that pass.
finallly:
Throughout the Mindboggle code base, I've included Examples in the documentation with lines like the following:
where MINDBOGGLE_DATA is an environment variable set according to the instructions in http://mindboggle.info/users/installation.html.
Is this reasonable, or is there a better way for users to try out functions?
I also created these examples with the goal of testing code within doc strings with sphinx, and of carefully unit testing everything, but haven't had time to do this.