Hi,
In an example file structure that I received from Habib, the data in the source (eg. in dropbox) are arranged under either raw or processed directories.
The lochness.tree.get function returns the path of a directory, where the data should be saved locally. It also creates the folder if the folder does not exist locally.
However, lochness.tree.get function always returns raw_folder variable, which results all files, including the files in the processed folder to be downloaded in the raw directory.
I thought the files which were saved under the processed folder in the source, should return processed_folder variable rather than the raw_folder variable in the tree.get function.
|
def get(type, base, **kwargs): |
|
'''get phoenix folder for a subject and datatype''' |
|
if type not in Templates: |
|
raise TreeError('no tree templates defined for {0}'.format(type)) |
|
raw_folder = None |
|
processed_folder = None |
|
if 'raw' in Templates[type]: |
|
raw_folder = Templates[type]['raw'].substitute(base=base, **kwargs) |
|
if 'processed' in Templates[type]: |
|
processed_folder = Templates[type]['processed'].substitute(base=base, **kwargs) |
|
if kwargs.get('makedirs', True): |
|
if raw_folder and not os.path.exists(raw_folder): |
|
logger.debug('creating raw folder {0}'.format(raw_folder)) |
|
os.makedirs(raw_folder) |
|
if processed_folder and not os.path.exists(processed_folder): |
|
logger.debug('creating processed folder {0}'.format(processed_folder)) |
|
os.makedirs(processed_folder) |
|
os.chmod(processed_folder, 0o01777) |
|
return raw_folder |
Hi,
In an example file structure that I received from Habib, the data in the source (eg. in dropbox) are arranged under either
raworprocesseddirectories.The
lochness.tree.getfunction returns the path of a directory, where the data should be saved locally. It also creates the folder if the folder does not exist locally.However,
lochness.tree.getfunction always returnsraw_foldervariable, which results all files, including the files in theprocessedfolder to be downloaded in therawdirectory.I thought the files which were saved under the
processedfolder in the source, should returnprocessed_foldervariable rather than theraw_foldervariable in thetree.getfunction.lochness/lochness/tree/__init__.py
Lines 65 to 83 in 26fae81