-
Notifications
You must be signed in to change notification settings - Fork 432
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
--[BUGFIX] -Ellipses in paths #2218
Conversation
If an OS link spans the ellipsis, certain functions, like glob, get lost when attempting to navigate the ellispis.
--glob doesn't know how to back-step across an os link, so it gets lost if it encounters one spanned by an ellipsis.
Nice! This was also causing caching issues in replay rendering, as the same file would sometimes be instantiated from different relative paths. |
In an effort to limit the impact of this change, it has been narrowed to only affect paths prefixed with an ellipse in the scene dataset config. Since the scene dataset config is expected to exist at the root of the dataset, and since the scene dataset may be accessed via a link, having an ellipses from the dataset root back-pedals across a link. Some functions, like glob(), don't handle this properly and get lost. This commit addresses only these cases.
A more rigorous handling of such cases is on my todo - eventually I would like to make all the paths within the system be stored normalized, but that is a bit more than I can handle right now. This PR only addresses the case when someone specifies a path within the scene dataset config path lists with leading ellipses (in order to access assets or configs in another dataset, for instance). Since often datasets are accessed via links, this backpedaling across an OS link was causing glob() to break, which I use to build lists of paths specified in the config (the config handles glob wildcards in path names). |
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.
LGTM!
Motivation and Context
If an ellipsis is specified in a path and this ellipsis attempts to back-step across an OS link, functions that attempt to read this path will get lost. On such function we use is glob(). Such path configurations may be present in our scene dataset configurations, where the user might wish to access assets from another installed dataset that requires navigating to their directory outside the current dataset directory.
This PR adds a function that recursively removes ellipses if it can remove their parent directory (so a path with leading ellipses would be ignored). Tests are also added to verify functionality, and the path data being used for glob calls is now being appropriately filtered, albeit only in the case where the path within the scene dataset config path list starts with leading ellipses (in order to access assets or configs in another dataset, for instance).
For a future TODO I want to normalize all the metadata paths in the system, but that is outside the scope of what I need to do for Habitat 3.0 right now.
How Has This Been Tested
C and python tests pass locally (c test cases have been added to test the functionality)
Types of changes
Checklist