aiida-core
aiida-core copied to clipboard
`CalcJob`: Extend `retrieve_list` syntax with `depth=None`
Fixes #5650
There is currently no way to retrieve files using glob patterns while maintaining the exact file hierarchy of the remote working directory. The only supported syntaxes are:
- Single string:
some/path/with/glob/*.txt
- Three-element tuple:
('glob/*.txt', '.', 1)
For the former, the matched file will be retrieved without any subfolders. For the latter, the levels of nesting to be kept is indicated by the final depth
integer, but it has to be specified and needs to be 0 or larger.
It would be far easier if one didn't have to specify the depth and the file hierarchy would be kept as is. This functionality is added, so it is now possible to specify
retrieve_list = [('some/*.txt', '.', None)]
which will copy the files matched by the glob with the exact same file hierarchy, creating the nested directories where needed.
~~Will add documentation once decided on the new syntax.~~
Documentation is now added.