-
Notifications
You must be signed in to change notification settings - Fork 145
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: Started a data module, to eventually replace the data folder. #25
base: master
Are you sure you want to change the base?
Conversation
from urllib.request import urlopen, urljoin | ||
|
||
# Set a user-writeable file-system location to put files: | ||
SHABLONA_HOME = op.join(os.path.expanduser('~'), '.shablona') |
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.
How about pulling from an environment variable (SHABLONA_DATA_PATH
), and defaulting to this?
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.
Also, I tend to avoid putting data in a hidden directory--I use those for settings only, in general. Just a note about my preference, no request for change :)
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.
Scikit-learn allows an optional environment variable; see https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/datasets/base.py#L72
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.
If it's going to be hidden, please use an XDG-compliant directory instead of cluttering ~
.
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.
Thanks for taking a look, and thanks for the comment. What is an XDG compliant directory?
From a brief look around, it seems that these are often directories like /usr/local/
, which are not always user-writeable. This needs to be user-writeable! But if I got it all wrong, please educate me. Better yet, a proposal for what to replace this with would be much appreciated.
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.
Something that follows the XDG basedir standard.
Basically, if it's data, it goes in $XDG_DATA_HOME
, if it's cache, it can go in $XDG_CACHE_HOME
. If these variables are not defined, they default to $HOME/.local/share
and $HOME/.cache
, respectively. And then you'd place it in an application-defined subdirectory of those.
There's also the appdirs package that will find the correct location for these sorts of things on all platforms.
Should eventually deal with #16