Skip to content

Conversation

@SAKURA-CAT
Copy link
Member

@SAKURA-CAT SAKURA-CAT commented Oct 10, 2025

删除swankit依赖,将相关代码放在swanlab主包中,同时更新swanboard依赖,做了适配

在文档中的自定义插件部分,需要更改导入代码为:

from swanlab.toolkit import SwanKitCallback

for #1063

Changed the required swanboard package version from 0.1.8b1 to 0.1.9b0 to ensure compatibility with the latest release.
Moved get_swanlog_dir to swanlab.toolkit and refactored swanlab/env.py to remove toolkit alias usage. Added SwanLabMode enum and implemented is_windows, is_macos, get_mode, and get_save_dir directly in env.py. Updated related imports in dashboard/watch.py and data/sdk.py for consistency.
Moved get_swanlog_dir and create_swanlog_dir implementations into env.py, removing toolkit dependency. Added create_time utility and extended unit tests to cover new and existing environment functions, including folder and mode handling.
Moved several environment-related functions and constants from swanlab.toolkit to swanlab.env in multiple files for better separation of concerns and code organization. Updated imports to reflect this change and removed redundant exports from toolkit.
Moved model definitions from swanlab/toolkit to swanlab/toolkit/models, including config, data, log, and metric. Updated all relevant imports to use the new module paths. Added SwanKitCallback and restructured __init__.py to re-export from models. This improves code organization and modularity.
Replaced imports of is_macos and create_time from swanlab.toolkit with swanlab.env in test_apple.py and test_models.py for consistency with updated module structure.
Introduced test_toolkit_metric.py to validate ColumnConfig, ColumnInfo, and MetricInfo in the toolkit models. Added test_toolkit_logger.py to test logging functionality, including log enabling, disabling, and level setting in SwanKitLogger.
Refactored imports in model.py to consolidate toolkit imports. Updated swanboard version check in local.py to require 0.1.9b1. Improved documentation in proto/v0.py and proto/v1.py to clarify model conversion processes and field mapping requirements.
Updated the swanboard dependency in requirements-dashboard.txt from 0.1.8b1 to 0.1.9b1.
@SAKURA-CAT SAKURA-CAT requested a review from Zeyi-Lin October 10, 2025 16:03
@SAKURA-CAT SAKURA-CAT self-assigned this Oct 10, 2025
@SAKURA-CAT SAKURA-CAT added the 💪 enhancement New feature or request label Oct 10, 2025
@SAKURA-CAT SAKURA-CAT merged commit 27997e6 into main Oct 10, 2025
9 of 10 checks passed
@SAKURA-CAT SAKURA-CAT deleted the feat/toolkit branch October 10, 2025 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💪 enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants