-
Notifications
You must be signed in to change notification settings - Fork 426
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
Fixed dataset download re-linking. #1989
Fixed dataset download re-linking. #1989
Conversation
print(f"Note, {default_data_path} is a symbolic link that points to {data_path}.") | ||
|
||
try: | ||
os.makedirs(data_path, exist_ok=True) |
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.
What kind of errors can arise here? I think it would just be permission errors?
What is the advantage of printing these messages over just raising the error?
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.
To be honest, I didn't ask myself these questions during fixing, but it seems to me that this is a "graceful way" to exit a program. Exceptions should be raised on program errors. Here everything is fine, user specified wrong path and we inform him about it. Why the program should fail with exception?
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.
@rpartsey probably should still be restricted to IOException? LIke no reason to catch SystemError exceptions from Python etc.
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 for this fix. 👍
Motivation and Context
Assume you already have all the assets downloaded.
When the habitat-sim data download utility is run again for the same type of assets without specifying '--data-path' argument, the
data_path
variable defaults todata_path = os.path.abspath("./data/")
andos.path.exists(data_path)
is True for a data symlink. Code checks whether the assets exist the same wayos.path.exists(data_path+path_to_asset)
and command also returns True and all of the assets are accessible via symlink (note that at this step some of the assets in /path/to/data may be symlinks but all will have"/path/to/data"
as their prefix (as expected)). However, then the symlinks to the assets are unlinked and linked back but with "/path/to/habitat-lab/data" .All this is caused because at the beginning, this command
os.path.abspath("./data/")
treats data not as symlink but as actual path (directory). More context in this Slack thread.How Has This Been Tested
Types of changes
Checklist