-
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
[WIP] Move settings.py to habitat_sim.utils #1832
Conversation
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.
Great to see the tests no longer pulling in examples. Mostly I suggest we extend both default_settings and make_cfg() in examples and move some things there.
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
One task I have to do frequently is to start a “default” simulator (mostly for writing custom viewers). The only option I am aware of is to use the code in
habitat-sim/examples/settings.py
to get a default configuration. Having to rely on this file has been a pain point. I have to either run my scripts from the examples folder or the sim folder (this leads to inconsistent imports: on some files the statement isfrom settings import ...
, on others it isfrom examples.settings import ...
). I can also play around withsys.path
orPYTHONPATH
, but this not a viable solution since it can clash with other packages that also have folders namedexamples
or files namedsettings
.This PR moves the
settings.py
file intohabitat_sim.utils
, thus making its functionality unambiguously available everywhere. I kept a file namedsettings.py
insideexamples
that simply imports the original settings file to make sure existing scripts that rely on it don't break.How Has This Been Tested
Tests (some of which rely on this file) pass. The existing examples also continue working.
Types of changes
Checklist