Skip to content

Commit

Permalink
Merge pull request #163 from jpgill86/default-data-dir
Browse files Browse the repository at this point in the history
Make data_dir default to metadata file directory
  • Loading branch information
jpgill86 authored Dec 22, 2019
2 parents 0372875 + 2b3985e commit babb882
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions docs/metadata.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,11 @@ Within a dataset's YAML block, paths to data and video files should be
provided.

All files associated with a dataset should be collected into a single
directory. A path to the local copy of this directory must be provided using
the ``data_dir`` key. You may specify ``data_dir`` as an absolute path (e.g.,
directory. A path to the local copy of this directory can be provided using the
``data_dir`` key. You may specify ``data_dir`` as an absolute path (e.g.,
``C:\Users\me\folder``) or as a path relative to the metadata file (e.g.,
``folder``).
``folder``). If left unspecified, the directory containing the metadata file is
used.

Paths to individual files within the dataset are provided using keys listed
below. These paths should be given relative to ``data_dir``. If ``data_dir`` is
Expand Down
4 changes: 2 additions & 2 deletions neurotic/datasets/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def _load_metadata(file = 'metadata.yml', local_data_root = None, remote_data_ro
value passed to this function will override the value provided in the file.
If both are unspecified, it is assumed that no remote data store exists.
The "data_dir" property must be provided for every data set in ``file`` and
The "data_dir" property is optional for every data set in ``file`` and
specifies the directory on the local system containing the data files.
"data_dir" may be an absolute path or a relative path with respect to
``local_data_root``. If it is a relative path, it will be converted to an
Expand Down Expand Up @@ -294,7 +294,7 @@ def _defaults_for_key(key):
# - if it is a relative path, it will be interpreted by _load_metadata
# as relative to local_data_root and will be converted to an absolute
# path
'data_dir': None,
'data_dir': '.',

# the path of the directory containing the data on a remote server
# - this may be a full URL or a relative path, or None if there exists
Expand Down

0 comments on commit babb882

Please sign in to comment.