Skip to content

Conversation

SAKURA-CAT
Copy link
Member

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

Description

Change backup mode to offline and fix #1033

@SAKURA-CAT SAKURA-CAT requested a review from Copilot June 6, 2025 11:05
@SAKURA-CAT SAKURA-CAT self-assigned this Jun 6, 2025
@SAKURA-CAT SAKURA-CAT added the 💪 enhancement New feature or request label Jun 6, 2025
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 renames the “backup” mode to “offline” across the SDK, callbacks, environment checks, and tests to better reflect its behavior of local-only logging without cloud uploads.

  • Update mode enumeration, documentation, and type hints from “backup” to “offline”
  • Rename BackupCallback class to OfflineCallback and adjust imports
  • Adjust test names and assertions to use the new “offline” mode

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
test/unit/data/test_sdk.py Renamed test methods and calls from backup to offline
swanlab/env.py Updated allowed mode list and docstring to include offline
swanlab/data/utils.py Swapped BackupCallback for OfflineCallback and updated mode check
swanlab/data/sdk.py Changed MODES literal, doc strings, and init logic to use offline
swanlab/data/run/main.py Replaced backup mode branch with offline
swanlab/data/callbacker/backup.py Renamed BackupCallback to OfflineCallback and its __str__
Comments suppressed due to low confidence (3)

swanlab/data/sdk.py:195

  • Update this inline comment to reference the new offline mode instead of backup (e.g., # 校验 mode 参数并适配 offline 模式).
# 校验mode参数并适配 backup 模式

swanlab/data/utils.py:211

  • The comment still refers to '备份模式'; please update it to '离线模式' (offline mode) to match the code changes.
# 1.4 . 备份模式

swanlab/data/callbacker/backup.py:18

  • [nitpick] The module file is named backup.py but defines OfflineCallback; consider renaming this file to offline.py (and updating import paths) to keep filenames consistent with class names.
class OfflineCallback(SwanLabRunCallback):

@SAKURA-CAT SAKURA-CAT marked this pull request as ready for review June 6, 2025 11:06
@SAKURA-CAT SAKURA-CAT merged commit c67b17a into feature/backup Jun 6, 2025
5 checks passed
@SAKURA-CAT SAKURA-CAT deleted the refactor/offline-mode branch June 6, 2025 11:35
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.

1 participant