-
Notifications
You must be signed in to change notification settings - Fork 12
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
a few more bind/copy fixes #41
Conversation
WIldcards in the target path are not being handled and mapped. To illustrate, I added some print statements to
which has the output
Since copy and bind use the same mapping rules, I am going to put the wildcard parsing logic into the |
…or copy/bind rule syntax.
To summarize the changes here:
|
# determine how to construct absolute path to destination object | ||
# if no destination rule is given, use the path from source rule | ||
if rd == "": | ||
dest = lambda src: os.path.join(root_path, src[1:]) |
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.
where are lambdas being used?
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.
The dictionary comprehension in the return line on 139.
return {src: os.path.normpath(dest(src)) for src in iglob(rs)}
If you don't like that, we could either wrap the whole if
block in a loop (but then the if
block would be executed unnecessarily for every file in the glob), or the if
block could set a enum parameter, and the dest
function could be defined with a def
and take the enum as an argument.
We could also use def
inside the if
block, but I thought that would be too verbose.
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.
I had a few questions
@scanon if there are changes you want, let me know, and I'm happy to make a revision PR |
Changes
bind
torbind
to address #40Another lingering change needed to fix the wildcard bind-mount logic in #36
There are some situations where we might always have something to copy or bind (like in the NCCL module), so I added logic to handle this via
if mod["copy"] is not None:
etc