Fix Python 3 compatibility and logging initialization#232
Open
alexhegit wants to merge 1 commit into
Open
Conversation
Two bugs fixed:
1. simulator/newton/simulator.py:
- Pass list() to ArticulationView.include_joints instead of dict_keys view.
In Python 3, dict.keys() returns a view object, not a list. The Omni
API expects an actual sequence type, causing a TypeError when creating
NewtonSimulator with non-empty robot dof names.
2. train_agent.py:
- Add logging.basicConfig() so log.info() calls actually produce output.
Without basicConfig, all logging calls are silently dropped.
- Enable faulthandler for better crash traceback reporting.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two independent bug fixes:
1. Fix
dict.keys()→list()for OmniArticulationView(simulator/newton/simulator.py)In Python 3,
dict.keys()returns adict_keysview object, not a list. The Omni API'sArticulationView(include_joints=...)expects an actual sequence type (list/tuple). When_newton_dof_namesis non-empty, passingdict.keys()directly causes aTypeError.Before:
After:
2. Enable logging and faulthandler (
train_agent.py)log.info()and other logging calls were silently dropped becauselogging.basicConfig()was never called. This made debugging very difficult — all log messages simply vanished with no output.Added:
Testing