Skip to content

Commit

Permalink
update:params (#16)
Browse files Browse the repository at this point in the history
* 适配实验名称逻辑更改
  • Loading branch information
SAKURA-CAT authored Sep 20, 2024
1 parent 8540d8f commit 830b403
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 18 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
19 changes: 8 additions & 11 deletions swankit/callback/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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

Expand Down
12 changes: 6 additions & 6 deletions swankit/log/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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效果以等待传入的函数执行完毕
Expand Down

0 comments on commit 830b403

Please sign in to comment.