-
Notifications
You must be signed in to change notification settings - Fork 224
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
CalcJob
: Extend retrieve_list
syntax with depth=None
#5651
Merged
sphuber
merged 1 commit into
aiidateam:main
from
sphuber:fix/5650/retrieve-list-single-element-glob
Oct 27, 2022
Merged
CalcJob
: Extend retrieve_list
syntax with depth=None
#5651
sphuber
merged 1 commit into
aiidateam:main
from
sphuber:fix/5650/retrieve-list-single-element-glob
Oct 27, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Documentation is now added. |
cdd9146
to
d94c5a3
Compare
d94c5a3
to
3cb5da7
Compare
ltalirz
approved these changes
Oct 27, 2022
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 @sphuber , this is a great improvement
@@ -460,15 +460,27 @@ Pattern matching | |||
|
|||
If the exact file or folder name is not known beforehand, glob patterns can be used. | |||
In the following examples, all files that match ``*c.txt`` in the directory ``path/sub`` will be retrieved. | |||
Since ``depth=0`` the files will be copied without the ``path/sub`` subdirectory. | |||
|
|||
If the exact folder hierarchy should be maintained, the ``depth`` should be disabled by setting it ``None``: |
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.
Suggested change
If the exact folder hierarchy should be maintained, the ``depth`` should be disabled by setting it ``None``: | |
In order to maintain the folder structure, set ``depth`` to ``None``: |
3cb5da7
to
6a44b1c
Compare
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.
6a44b1c
to
c7512f5
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
some/path/with/glob/*.txt
('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
which will copy the files matched by the glob with the exact same file hierarchy, creating the nested directories where needed.