Skip to content

Commit e60cab9

Browse files
committed
chore: some misc
1 parent bc50fe6 commit e60cab9

File tree

4 files changed

+6
-9
lines changed

4 files changed

+6
-9
lines changed

requirements.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ pydantic>=2.9.0
1212
pyecharts>=2.0.0
1313
wrapt>=1.17.0
1414
platformdirs>=4.2.0
15-
eval_type_backport; python_version < '3.10'
16-
typing_extensions; python_version <= '3.9'
15+
typing_extensions; python_version < '3.9'
1716
protobuf>=3.12.0,!=4.21.0,!=5.28.0,<7; python_version < '3.9' and sys_platform == 'linux'
1817
protobuf>=3.15.0,!=4.21.0,!=5.28.0,<7; python_version == '3.9' and sys_platform == 'linux'
1918
protobuf>=3.19.0,!=4.21.0,!=5.28.0,<7; python_version > '3.9' and sys_platform == 'linux'

swanlab/data/callbacker/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22
@author: cunyue
33
@file: __init__.py
44
@time: 2025/6/21 17:10
5-
@description: 回调器模块,分为三大回调器:
5+
@description: 回调器模块,四大回调器对应 swanlab 的四种运行模式。
66
1. local: 本地模式回调器
77
2. cloud: 云端模式回调器
88
3. offline: 离线模式回调器
9+
4. disabled: 禁用回调器
910
"""
1011

1112
from .cloud import CloudPyCallback
13+
from .disabled import DisabledCallback
1214
from .local import LocalRunCallback
1315
from .offline import OfflineCallback

swanlab/data/utils.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111
from rich.text import Text
1212

1313
from swanlab.core_python import auth
14-
from swanlab.data.callbacker.cloud import CloudPyCallback
15-
from swanlab.data.callbacker.disabled import DisabledCallback
16-
from swanlab.data.callbacker.offline import OfflineCallback
14+
from swanlab.data.callbacker import *
1715
from swanlab.data.formatter import check_load_json_yaml
1816
from swanlab.data.run import SwanLabRun
1917
from swanlab.data.run.helper import SwanLabRunOperator

test/unit/data/test_sdk.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -348,10 +348,8 @@ def test_init_logdir_settings_backup(self):
348348
# 如果通过 settings 设置为 False,则不会生成文件夹
349349
del os.environ[LOG_DIR]
350350
run = S.init(mode="cloud", settings=Settings(backup=False))
351+
assert run.public.swanlog_dir == platformdirs.user_cache_dir(appname="swanlab", appauthor="SwanHubX")
351352
assert run.public.swanlog_dir != logdir
352-
assert run.public.swanlog_dir == os.path.join(os.getcwd(), "swanlog")
353-
# 此时文件夹不存在,因为关闭了backup功能
354-
assert not os.path.exists(run.public.swanlog_dir)
355353

356354

357355
@pytest.mark.skipif(T.is_skip_cloud_test, reason="skip cloud test")

0 commit comments

Comments
 (0)