-
Notifications
You must be signed in to change notification settings - Fork 203
feat/core python api #1561
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
Merged
Merged
feat/core python api #1561
Changes from 10 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
477e31e
feat: add core_python type def
Nexisato ac900e8
chore: ignore extra ai docs
Nexisato 90bf92d
feat: add util function
Nexisato 3be6e38
feat: add multipart upload util function
Nexisato 6c062cb
feat: add core_python api implementation
Nexisato 04278cd
chore: update type def
Nexisato bd4b63a
chore: switch walrus operator
Nexisato d361dd6
refactor: correct experiment filed
Nexisato cf5bb79
chore: remove unused api
Nexisato c4c9cda
refactor: remove unused api
Nexisato 84d2f6b
chore: remove ununsed imports
Nexisato 5ea0250
chore: remove stop resp data
Nexisato 029f40b
chore: restore init export
Nexisato File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -56,3 +56,5 @@ FEATURE_SUMMARY.md | |
| GEMINI.md | ||
| QWEN.md | ||
| .omx/ | ||
| .opencode/ | ||
| CODEBUDDY.md | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
Nexisato marked this conversation as resolved.
Outdated
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| """Common Type Definition""" | ||
|
|
||
| from typing import TypedDict | ||
|
|
||
|
|
||
| class LabelType(TypedDict): | ||
| name: str |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,38 @@ | ||
| """ | ||
| @author: cunyue | ||
| @file: experiment.py | ||
| @time: 2026/4/18 17:43 | ||
| @time: 2026/3/10 19:02 | ||
| @description: SwanLab 运行时实验API类型 | ||
| """ | ||
|
|
||
| from typing import TypedDict | ||
| from typing import List, Tuple, TypedDict | ||
|
|
||
| from swanlab.sdk.typings.run import RunStateType | ||
|
|
||
| from .common import LabelType | ||
|
|
||
|
|
||
| class InitExperimentType(TypedDict): | ||
| # 实验cuid | ||
| cuid: str | ||
|
|
||
|
|
||
| class ExperimentType(TypedDict): | ||
|
Nexisato marked this conversation as resolved.
Outdated
|
||
| # 实验名称 | ||
| name: str | ||
| # 实验CUID, 唯一标识符 | ||
| cuid: str | ||
| # 实验描述 | ||
| description: str | ||
| # 实验标签列表 | ||
| labels: List[LabelType] | ||
| # 实验状态 | ||
| state: RunStateType | ||
| # 实验组 | ||
| cluster: str | ||
| # 任务类型 | ||
| job: str | ||
| # 创建时间 | ||
| created_at: str | ||
| # 实验颜色 | ||
| colors: Tuple[str, str] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
Nexisato marked this conversation as resolved.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| from swanlab.sdk.typings.run import ColumnType | ||
|
|
||
|
|
||
| def parse_column_type(column: str) -> ColumnType: | ||
| """从前缀中获取指标类型""" | ||
| column_type = column.split(".", 1)[0] | ||
| if column_type == "summary": | ||
| return "SCALAR" | ||
| elif column_type == "config": | ||
| return "CONFIG" | ||
| else: | ||
| return "STABLE" | ||
|
|
||
|
|
||
| def to_camel_case(name: str) -> str: | ||
| """将下划线命名转化为驼峰命名""" | ||
| return "".join([w.capitalize() if i > 0 else w for i, w in enumerate(name.split("_"))]) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.