Return the absolute path to the proxystore home directory.
If set, $PROXYSTORE_HOME
is preferred. Otherwise,
$XDG_DATA_HOME/proxystore
is returned where $XDG_DATA_HOME
defaults
to $HOME/.local/share
if unset.
Source code in proxystore/utils/environment.py
| def home_dir() -> str:
"""Return the absolute path to the proxystore home directory.
If set, `$PROXYSTORE_HOME` is preferred. Otherwise,
`$XDG_DATA_HOME/proxystore` is returned where `$XDG_DATA_HOME` defaults
to `$HOME/.local/share` if unset.
"""
path = os.environ.get('PROXYSTORE_HOME')
if path is None:
prefix = os.environ.get('XDG_DATA_HOME') or os.path.expanduser(
'~/.local/share',
)
path = os.path.join(prefix, 'proxystore')
return os.path.abspath(path)
|