diff --git a/pyproject.toml b/pyproject.toml index 8ad2ee3..d5f0c85 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ build-backend = "hatchling.build" [project] name = "swankit" -version = "0.1.1b2" +version = "0.1.1b3" dynamic = ["readme"] description = "Base toolkit for SwanLab" license = "Apache-2.0" diff --git a/swankit/callback/__init__.py b/swankit/callback/__init__.py index b6f0f8a..01fef7b 100644 --- a/swankit/callback/__init__.py +++ b/swankit/callback/__init__.py @@ -8,10 +8,10 @@ 回调类,规定回调函数的接口规范。 """ -from typing import Callable from abc import ABC, abstractmethod from .models import * from swankit.core import SwanLabSharedSettings +from typing import Tuple class SwanKitCallback(ABC): @@ -38,23 +38,20 @@ def before_run(self, settings: SwanLabSharedSettings): pass def before_init_experiment( - self, - run_id: str, - exp_name: str, - description: str, - num: int, - suffix: str, - setter: Callable[[str, str, str, str], None], + self, + run_id: str, + exp_name: str, + description: str, + num: int, + colors: Tuple[str, str], ): """ 在初始化实验之前调用,此时SwanLabRun已经初始化完毕 - FIXME setter函数实际上并不应该被传递,现在是因为存在实验名称不能重复的历史遗留问题 :param run_id: str, SwanLabRun的运行id :param exp_name: str, 实验名称 :param description: str, 实验描述 :param num: int, 历史实验数量 - :param suffix: str, 实验后缀 - :param setter: Callable[[str, str, str, str], None], 设置实验信息的函数,在这里设置实验信息 + :param colors: Tuple[str, str], 实验颜色,[light, dark] """ pass diff --git a/swankit/log/utils.py b/swankit/log/utils.py index 6bef1bb..f09f616 100644 --- a/swankit/log/utils.py +++ b/swankit/log/utils.py @@ -18,12 +18,12 @@ class FONT: @staticmethod def loading( - s: str, - func: Callable, - args: Tuple = (), - interval: float = 0.4, - prefix: str = None, - brush_length: int = 100 + s: str, + func: Callable, + args: Tuple = (), + interval: float = 0.4, + prefix: str = None, + brush_length: int = 100, ): """ 实现终端打印的加载效果,输入的字符串会在开头出现loading效果以等待传入的函数执行完毕