Skip to content

Conversation

hyYY-1024
Copy link
Collaborator

Description

获取一个exp状态,将三个参数都暴露出去让用户填写。第一次接触这个项目,如有开发不符请及时联系我,谢谢

🎯 PRs Should Target Issues

开发openapis

@hyYY-1024 hyYY-1024 requested a review from kites262 May 7, 2025 08:37
@kites262 kites262 changed the base branch from main to feature/openapis May 7, 2025 09:09
@kites262
Copy link
Member

kites262 commented May 7, 2025

可以合并下自动处理异常的代码, git pull origin feature/openapis --rebase

hyYY-1024 added 3 commits May 7, 2025 21:46
获取一个exp状态,将所需参数暴露出去给用户填写
修改代码
修改代码
@hyYY-1024 hyYY-1024 requested a review from kites262 May 7, 2025 13:55
hyYY-1024 and others added 2 commits May 7, 2025 22:00
上一版代码没有合并进来,这一版已经合并
@kites262 kites262 requested a review from Copilot May 7, 2025 15:12
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a new API endpoint to retrieve experiment status and adds corresponding unit tests.

  • Exposes three parameters for the experiment status API call.
  • Adds a new method get_exp_state in OpenApi that delegates to ExperimentAPI.
  • Introduces unit tests to verify handling of both successful status responses and error (404) conditions.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
test/unit/api/openapi/test_experiment.py Adds a unit test exercising the new exp state retrieval API.
swanlab/api/openapi/main.py Introduces get_exp_state in OpenApi with optional workspace use.
swanlab/api/openapi/experiment.py Implements experiment state retrieval with basic empty-check.
Comments suppressed due to low confidence (1)

swanlab/api/openapi/main.py:71

  • [nitpick] Consider aligning the parameter naming between OpenApi.get_exp_state and ExperimentAPI.get_exp_state (using 'expid' vs 'exp_cuid') for consistency across the API.
def get_exp_state(self, project: str, exp_cuid: str, workspace: Optional[str] = None):

@kites262 kites262 merged commit 108f994 into feature/openapis May 7, 2025
5 checks passed
@kites262 kites262 changed the title Add exp status feat(OpenApi): Add exp state api May 7, 2025
@kites262 kites262 changed the title feat(OpenApi): Add exp state api feat(openapi): add exp state api May 7, 2025
@kites262 kites262 deleted the add_exp_status branch May 8, 2025 01:34
SAKURA-CAT added a commit that referenced this pull request May 12, 2025
* feat(openapi): list workspaces (#961)

* feat(openapi): list workspaces

* refa(openapi): login logic

* docs(openapi): revise

* fix(test): no cloud

* feat(openapi): auto catch ApiError

* Add `get_exp_state` for OpenAPI

Add `get_exp_state` for OpenAPI (#963)

---------

Co-authored-by: kites262 <kites262@qq.com>

* feat(openapi): get experiment (#964)

* feature: get experiment
* fix some

* feat(openapi): get project exps

* feat(openapi): types

* fix: py<3.8

* refa(openapi): types for ide

* feat(openapi): list projects (#966)

* feat(openapi): list project

* refactor(openapi): list projects with apiresponse type

* refactor(openapi): rewrite list comprehension

* fix: typo

* refa(openapi): general fetch paginated api

* fix(openapi): test & default value

---------

Co-authored-by: kites262 <kites262@qq.com>

* chore: fix desc & comment

---------

Co-authored-by: hyYY-1024 <75209465+hyYY-1024@users.noreply.github.com>
Co-authored-by: Kaikai <98205900+Kaikaikaifang@users.noreply.github.com>
Co-authored-by: CaddiesNew <50736785+Nexisato@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants