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

feat: support nest log #808

Merged
merged 2 commits into from
Feb 3, 2025
Merged

feat: support nest log #808

merged 2 commits into from
Feb 3, 2025

Conversation

Zeyi-Lin
Copy link
Member

@Zeyi-Lin Zeyi-Lin commented Feb 3, 2025

Description

This pull request includes changes to the swanlab/data/run/main.py file to add support for logging nested dictionaries by flattening them. The most important changes include adding a helper method to flatten nested dictionaries, updating the log method to handle nested dictionaries, and modifying the key format check to work with the flattened dictionary.

Improvements to nested dictionary handling:

Closes: #806

使用案例:

import swanlab

swanlab.init(project="dev")

data = {'a': {'b': {'c': 1, 'd': 2}, 'e': 3}, 'f': 4}
swanlab.log(data)

@Zeyi-Lin Zeyi-Lin self-assigned this Feb 3, 2025
@Zeyi-Lin Zeyi-Lin merged commit 2a6ba54 into main Feb 3, 2025
5 checks passed
@Zeyi-Lin Zeyi-Lin deleted the feat-nest-log branch February 5, 2025 05:14
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.

[REQUEST] 建议支持嵌套logs
2 participants