Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update:params #16

Merged
merged 2 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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