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

refactor(client): refactor handler args with @starwhale.argument decorator #3100

Merged
merged 1 commit into from
Jan 2, 2024

Conversation

tianweidut
Copy link
Member

@tianweidut tianweidut commented Dec 27, 2023

Description

depends on: #3095
Changes:

  • Replace IntInput, BoolInput... with Python typing hint
  • Expand the capability to customize argument mechanisms across all functions, as currently only the @handler decorator supports external arguments.
  • Employ dataclasses for bundling arguments, leveraging a feature that is widely adopted in machine learning libraries.

Modules

  • Client

Checklist

  • run code format and lint check
  • add unit test
  • add necessary doc

@tianweidut tianweidut self-assigned this Dec 27, 2023
@tianweidut tianweidut force-pushed the refactor/handler-args branch 2 times, most recently from 5bf6a55 to 5d3b8aa Compare December 29, 2023 03:28
@tianweidut tianweidut marked this pull request as ready for review December 29, 2023 03:30
Copy link

codecov bot commented Dec 29, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (e6a498b) 82.71% compared to head (6749c1f) 91.84%.

Files Patch % Lines
client/starwhale/base/scheduler/task.py 66.66% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #3100      +/-   ##
============================================
+ Coverage     82.71%   91.84%   +9.13%     
============================================
  Files           575      139     -436     
  Lines         32088    16174   -15914     
  Branches       1865        0    -1865     
============================================
- Hits          26540    14855   -11685     
+ Misses         4723     1319    -3404     
+ Partials        825        0     -825     
Flag Coverage Δ
console ?
controller ?
standalone 91.84% <91.66%> (-0.01%) ⬇️
unittests 91.84% <91.66%> (+0.25%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tianweidut tianweidut changed the title refactor(client): refactor handler args with @starwhale.argument decorator refactor(client): refactor handler args with @starwhale.argument decorator Dec 29, 2023
@tianweidut tianweidut force-pushed the refactor/handler-args branch 9 times, most recently from 76dd0b7 to 5b8ac74 Compare January 2, 2024 06:30
Copy link
Member

@anda-ren anda-ren left a comment

Choose a reason for hiding this comment

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

LGTM

@anda-ren anda-ren merged commit 28cc7aa into star-whale:main Jan 2, 2024
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants