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

Develop standard method to access test data files #6683

Open
mhvk opened this issue Oct 7, 2017 · 0 comments
Open

Develop standard method to access test data files #6683

mhvk opened this issue Oct 7, 2017 · 0 comments

Comments

@mhvk
Copy link
Contributor

mhvk commented Oct 7, 2017

In #6664, there was some discussion how to access test data in documentation. It would seem handy to have a general method. In #6664 (comment), I wrote and suggested:

I think there is a general question here of how to access test data files. In a package of my own, I "solved" it by having an __init__.py for my data directory that defines variables that hold the paths to the various files, which then can be imported [1]. Not sure that this scales to all of astropy, but I think that instead of

fits_scaledimage_filename = fits.util.get_testdata_filepath('scale.fits')

it is clearer what happens if one sees,

from fits.test_data import scaled_image_file

Another advantage is that it allows the test data files to have docstrings, which can be typeset with sphinx (and I guess with suitable cleverness be made part of the instance).

[1] https://github.com/mhvk/baseband/blob/master/baseband/data/__init__.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants