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

[xdoctest] reformat example code with google style in No.65-68 #55953

Merged
merged 11 commits into from
Aug 16, 2023

Conversation

enkilee
Copy link
Contributor

@enkilee enkilee commented Aug 3, 2023

PR types

Others

PR changes

Others

Description

  • ./python/paddle/hapi/dynamic_flops.py
  • ./python/paddle/hapi/hub.py
  • ./python/paddle/hapi/model.py
  • ./python/paddle/hapi/model_summary.py

预览:

en: http://preview-paddle-pr-55953.paddle-docs-preview.paddlepaddle.org.cn/documentation/docs/en/api/paddle/abs_en.html
zh: http://preview-paddle-pr-55953.paddle-docs-preview.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/abs_cn.html

关联 PR:
#55629
#55295

@sunzhongkai588 @SigureMo @megemini

@paddle-bot
Copy link

paddle-bot bot commented Aug 3, 2023

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@paddle-bot paddle-bot bot added contributor External developers status: proposed labels Aug 3, 2023
@luotao1 luotao1 added the HappyOpenSource 快乐开源活动issue与PR label Aug 3, 2023
@enkilee
Copy link
Contributor Author

enkilee commented Aug 4, 2023

model.py 的 save原始示例代码有问题,所以重写了,改动较大。

@luotao1 luotao1 added HappyOpenSource Pro 进阶版快乐开源活动,更具挑战性的任务 and removed HappyOpenSource 快乐开源活动issue与PR labels Aug 7, 2023
python/paddle/hapi/model.py Show resolved Hide resolved
python/paddle/hapi/model_summary.py Outdated Show resolved Hide resolved
Copy link
Contributor

@megemini megemini left a comment

Choose a reason for hiding this comment

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

有个笔误,其他 OK ~ 辛苦 ~:)

python/paddle/hapi/model.py Outdated Show resolved Hide resolved
python/paddle/hapi/dynamic_flops.py Outdated Show resolved Hide resolved
python/paddle/hapi/hub.py Outdated Show resolved Hide resolved
python/paddle/hapi/hub.py Outdated Show resolved Hide resolved
python/paddle/hapi/model.py Outdated Show resolved Hide resolved
SigureMo
SigureMo previously approved these changes Aug 10, 2023
Copy link
Member

@SigureMo SigureMo left a comment

Choose a reason for hiding this comment

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

LGTMeow 🐾

Copy link
Contributor

@megemini megemini left a comment

Choose a reason for hiding this comment

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

其他都 OK,就是那个参数的缩进还要改一下,不然文档根据缩进抓取参数,里面是错的:
image

python/paddle/hapi/hub.py Outdated Show resolved Hide resolved
Comment on lines 180 to 183
repo_dir(str): Github or local path.
github path (str): A string with format "repo_owner/repo_name[:tag_name]" with an optional
tag/branch. The default branch is `main` if not specified.
local path (str): Local repo path.
Copy link
Contributor

Choose a reason for hiding this comment

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

这个地方的缩进还是有点问题 ~
image

tag/branch. The default branch is main if not specified. 这行不去手动换行试试看?

Copy link
Member

Choose a reason for hiding this comment

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

这行不去手动换行试试看?

不建议不换行,代码里应该适当折行

image

按照这种格式写吧,我在本地的 sphinx 环境是没问题的

注意空格要是 2,否则会出问题,注意列表上下都要有空行,否则会出问题

image

Copy link
Contributor

Choose a reason for hiding this comment

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

@enkilee sphinx 语法务必 十分注意 空行和缩进。

源码中一句话换行时,需要和上一行对齐(比如这里的tag/branch 和 github 对齐),这样前端显示会仍旧保持是连着的一句话。

另外,每个缩进都代表一个层级,请注意~

Copy link
Contributor Author

Choose a reason for hiding this comment

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

收到

Copy link
Contributor Author

Choose a reason for hiding this comment

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

谢谢各位大佬解惑

Copy link
Contributor

Choose a reason for hiding this comment

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

赞!!!

Copy link
Contributor

@megemini megemini left a comment

Choose a reason for hiding this comment

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

LGTM ~ 赞!

@luotao1 luotao1 merged commit 14b1374 into PaddlePaddle:develop Aug 16, 2023
@enkilee enkilee deleted the xdoctest65-68 branch August 24, 2023 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers HappyOpenSource Pro 进阶版快乐开源活动,更具挑战性的任务
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants