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

Fix:Remove ANSI sequences and format issues in RBC.__repr #186

Merged
merged 1 commit into from
Dec 22, 2024

Conversation

JonnyDing
Copy link
Contributor

Problem description

ANSI escape sequences (color and format control characters) used in the __repr__ method may appear garbled in unsupported environments in debugging or terminal output, affecting the readability of debugger output or logging.

Problem

  • The console of a debugger such as PyCharm or VSCode does not parse ANSI escape sequences correctly.
  • Attribute values are displayed inconsistently across multiple lines, with some members being displayed as “gibberish”.
  • Some property values may throw exceptions when accessed, resulting in no display.
    before

Changes

Determine whether the current environment is a debug environment, so as to solve the problem of ANSI garbled code in the debug environment.

Example of modified output:

<gs.Scene> t=<int>: 0 dt=<float>: 0.02 requires_grad=<bool>: False substeps=<int>: 2 visualizer=<gs.
![after](https://github.com/user-attachments/assets/b8d3a6d9-d9f3-4ccf-988c-7f7e6d607545)


@JonnyDing JonnyDing closed this Dec 21, 2024
@JonnyDing JonnyDing deleted the fix/repr-ansi-issue branch December 21, 2024 07:31
@JonnyDing
Copy link
Contributor Author

Problem description

ANSI escape sequences (color and format control characters) used in the __repr__ method may appear garbled in unsupported environments in debugging or terminal output, affecting the readability of debugger output or logging.

Problem

  • The console of a debugger such as PyCharm or VSCode does not parse ANSI escape sequences correctly.
  • Attribute values are displayed inconsistently across multiple lines, with some members being displayed as “gibberish”.
  • Some property values may throw exceptions when accessed, resulting in no display.
    before

Changes

Determine whether the current environment is a debug environment, so as to solve the problem of ANSI garbled code in the debug environment.

Example of modified output:
after

@JonnyDing JonnyDing restored the fix/repr-ansi-issue branch December 21, 2024 07:37
@JonnyDing JonnyDing reopened this Dec 21, 2024
@zhouxian
Copy link
Collaborator

Looks useful! @zswang666 could you double check and merge?

@zswang666 zswang666 merged commit 31c074d into Genesis-Embodied-AI:main Dec 22, 2024
1 check failed
zswang666 added a commit that referenced this pull request Dec 22, 2024
This reverts commit 31c074d, reversing
changes made to da3d38b.
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.

3 participants