Skip to content
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

Better error message when passing in unknown scene #977

Merged
merged 1 commit into from
Feb 6, 2022

Conversation

mattdeitke
Copy link
Contributor

There is currently a pretty ugly error message on main when an unknown scene in passed in:
image

The error message occurs because we try to sort by the pattern re.search(r"FloorPlan[_]?([a-zA-Z\-]*)([0-9]+)_?([0-9]+)?.*$", scene_name). But, not all scenes in the main build work with the pattern anymore. For instance, trying it with FloorPlan_ExpRoom results in None, which then results in the AttributeError: 'NoneType' object has no attribute 'group'.

This PR just calls sorted() instead of trying to sort by key_sort_func. The downside is that it may be a little less natural, where FloorPlan10 might come before FloorPlan1, but it's much more robust to new scene names in the build.

Full notebook: https://colab.research.google.com/drive/1207Px1enUPqzJ2mTIkvrc-OA7eygpEyT?usp=sharing

@mattdeitke mattdeitke requested a review from ekolve February 2, 2022 20:05
@mattdeitke mattdeitke merged commit 1d35fba into main Feb 6, 2022
@mattdeitke mattdeitke deleted the sceneNameFailure branch February 6, 2022 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants