Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Use the C++ string representation for Python dataclass objects#2855

Merged
ahojnnes merged 2 commits intomainfrom
sarlinpe/fix-image-repr
Oct 25, 2024
Merged

Use the C++ string representation for Python dataclass objects#2855
ahojnnes merged 2 commits intomainfrom
sarlinpe/fix-image-repr

Conversation

@sarlinpe
Copy link
Member

#2842 removed the custom __repr__ for some objects like Image. Pycolmap then falls back to enumerating all the attributes, which is suboptimal - for example for Image we don't want to print all 2D points to void bloating the console output. This PR recovers the previous behavior for objects for which stringstream << obj is defined.

@sarlinpe sarlinpe changed the title Use the C++ string representation for Python objects Use the C++ string representation for Python dataclass objects Oct 24, 2024
@B1ueber2y
Copy link
Contributor

B1ueber2y commented Oct 24, 2024

Indeed. Thanks for the catch on the Image class __repr__ issue.

Copy link
Contributor

@B1ueber2y B1ueber2y left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new type traits update works in my test.

@ahojnnes ahojnnes merged commit b64c9a8 into main Oct 25, 2024
@ahojnnes ahojnnes deleted the sarlinpe/fix-image-repr branch October 25, 2024 05:19
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