Skip to content

Conversation

SAKURA-CAT
Copy link
Member

@SAKURA-CAT SAKURA-CAT commented Jun 19, 2025

本 PR 清理了 swankit 的导入代码,接下来我们考虑将 swankit 部分的代码合并进入 swanlab 源码中,不再分包,导入方式为:

from swanlab.toolkit import ...

就目前而言 swankit 依旧存在,在此过渡期本质上swanlab/toolkit只是导入了 swankit 中的工具函数并暴露——但是未来 swankit 会被抛弃。


此外,使用 rich 代替了原本自己写的高亮格式化工具,现在不会再出现 windows 字符乱码的情况。

@SAKURA-CAT SAKURA-CAT self-assigned this Jun 19, 2025
@SAKURA-CAT SAKURA-CAT added 🐛 bug Something isn't working 💪 enhancement New feature or request labels Jun 19, 2025
@SAKURA-CAT SAKURA-CAT marked this pull request as ready for review June 19, 2025 13:56
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the codebase by replacing all references to swankit with swanlab.toolkit and updates the logging/formatting functions to use rich. It prepares for a future merge of swankit code into swanlab by centralizing imports and cleaning up the legacy code.

  • Migrated swankit imports to swanlab.toolkit across multiple modules.
  • Replaced custom logging formatting with rich’s Text and Status for improved consistency and reliability.
  • Updated documentation to reflect the new import paths.

Reviewed Changes

Copilot reviewed 20 out of 52 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
swanlab/data/modules/text/init.py Updated import from swankit to swanlab.toolkit.
swanlab/data/modules/object3d/point_cloud.py Replaced swankit imports with swanlab.toolkit equivalents.
swanlab/data/modules/object3d/object3d.py Migrated MediaType import to swanlab.toolkit.
swanlab/data/modules/object3d/molecule.py Updated DataSuite, MediaBuffer and MediaType imports.
swanlab/data/modules/object3d/model3d.py Similar migration of imports to swanlab.toolkit.
swanlab/data/modules/line/init.py Reordered and updated import lines to use swanlab.toolkit.
swanlab/data/modules/image/init.py Updated to new import order and references.
swanlab/data/modules/custom_charts/init.py Replaced swankit with swanlab.toolkit in chart module imports.
swanlab/data/modules/audio/init.py Migrated import references to swanlab.toolkit.
swanlab/data/modules/init.py Centralized module imports via swanlab.toolkit.
swanlab/data/formatter.py Updated callback import to reference swanlab.toolkit.
swanlab/data/callbacker/offline.py Revised logging to use rich Text formatting.
swanlab/data/callbacker/local.py Updated logging and callback imports.
swanlab/data/callbacker/cloud.py Changed logging calls to use rich Text and Status components.
swanlab/core_python/uploader/model.py Updated ColumnClass and ColumnConfig imports to swanlab.toolkit.
swanlab/core_python/client/init.py Replaced FONT.loading with a Status context; updated MediaBuffer import.
swanlab/core_python/auth/providers/api_key.py Migrated logging and import references to rich and swanlab.toolkit.
swanlab/cli/commands/auth/logout.py Updated logout messaging using rich Text; ensure consistency in output.
swanlab/cli/commands/auth/login.py Refactored login messaging to use rich Text formatting.
docs/插件化设计.md Updated documentation to reflect the new import path for callbacks.

@SAKURA-CAT SAKURA-CAT merged commit 676e1bd into main Jun 20, 2025
5 checks passed
@SAKURA-CAT SAKURA-CAT deleted the feature/swankit branch June 20, 2025 04:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working 💪 enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants