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

[air] Render trainer docstring signatures #27590

Merged
merged 1 commit into from
Aug 8, 2022

Conversation

richardliaw
Copy link
Contributor

@richardliaw richardliaw commented Aug 5, 2022

Why are these changes needed?

Because we override __new__, we can't render signatures correctly, losing valuable type hints. This is a one-off fix to improve this by rendering the init method manually, but it is not a great fix. Ideally we get rid of our usage of __new__ and render things correctly.

Screen Shot 2022-08-05 at 4 59 36 PM

Related issue number

Checks

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

Signed-off-by: Richard Liaw <[email protected]>
@richardliaw richardliaw marked this pull request as ready for review August 6, 2022 00:41
@richardliaw richardliaw requested a review from a team as a code owner August 6, 2022 00:41
@pcmoritz
Copy link
Contributor

pcmoritz commented Aug 8, 2022

Yeah it is inconsistent with the rest now (__init__ vs showing types in the class constructor), we should try to fix it properly. Fine as a workaround.

@pcmoritz pcmoritz merged commit f15ed38 into ray-project:master Aug 8, 2022
@pcmoritz pcmoritz deleted the trainer-api-fix branch August 8, 2022 16:29
richardliaw added a commit to richardliaw/ray that referenced this pull request Aug 9, 2022
scottsun94 pushed a commit to scottsun94/ray that referenced this pull request Aug 9, 2022
Stefan-1313 pushed a commit to Stefan-1313/ray_mod that referenced this pull request Aug 18, 2022
Signed-off-by: Richard Liaw <[email protected]>
Signed-off-by: Stefan van der Kleij <[email protected]>
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.

3 participants