-
Notifications
You must be signed in to change notification settings - Fork 283
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
Confusing default locations for test_data and sample_data dirs #598
Comments
I would have thought that the intention of these paths is instructional, as it is a template file the implication is you need to fill in the template. As such I think these seem reasonable. Of course if you have filled them in with your own paths and the data still cannot be found, perhaps it would be nice to hear about it from iris instead of going to the default location... |
I suggest we change the paths in the template to:
I think this is clearer. I get the following warning if the dir does not exist:
I'm not sure how to get the silent failure @pp-mo indicates. |
I didn't check myself, I should have. If there is a warning then I don't think we have a problem. @pp-mo what context did this come up in? I know that if iris can't find sample data you get a unintelligible error from matplotlib when you try to build the docs (problem deep inside the plot directive), but other than that I've never had an issue. |
My bad, I think I probably missed the message. |
Seems like the warning is raised appropriately. We can always improve the documentation of the config values so I'd be 👍 if you submitted a PR. Closing this issue as I wouldn't know what to improve to satisfy the ticket. Feel free to re-open with more specifics. |
I thought it might be better to complain whenever the result path is non-existent.
So, I think think best left : instead, errors will emerge when using nonexistent paths. |
In the module docstring for config.py, we have...
This account does seem to be entirely correct. But of course, those directories don't actually exist in the repo. And If you create them on your disk, they are then in an awkward place cluttering up your repo status.
More confusingly, if you leave these values as provided in "site.cfg.template" (e.g.
test_data_dir = /path/to/iris/resources/test_data
), then these are of course non-existent paths.The config module then spots that those paths are non-existent, but instead of complaining about it, it silently reverts to the aove-mentioned default paths -- even though these are also non-existent.
I don't know if this really makes best sense.
An alternative would be for the defaults to be obviously non-existent directories, like the examples, e.g. "test_data_dir = /test-data-not-defined", and not to automatically replace these with another default. Then it would be clear that you must set these to something sensible for any workable usage, but errors will only happen when you try to actually fetch something from a path based on them.
The text was updated successfully, but these errors were encountered: