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

[Doc] Improve description of the pos parameter in gui #1904

Merged
merged 5 commits into from
Oct 4, 2020

Conversation

houkensjtu
Copy link
Contributor

The current description of parameter pos in gui.text doesn't explicitly show it's intended value range.
Same issue exists for other objects. I can make a through chk and update if you think the change is valuable.
Thank you!

Related issue = #

[Click here for the format server]


The current description of parameter pos in gui.text doesn't explicitly show it's intended value range. 
Same issue exists for other objects. I can make a through chk and update if you think the change is valuable.
Thank you!
@houkensjtu houkensjtu changed the title Improve description of the pos parameter in gui [Doc] Improve description of the pos parameter in gui Sep 28, 2020
Copy link
Collaborator

@archibate archibate left a comment

Choose a reason for hiding this comment

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

Good idea! LGTM but I've several concerns:

  1. There're more than one place we have pos in GUI doc, will we modify them too?
  2. Thank for clarifying [0, 1], shall we also claim that X is from left to right and Y is from down to up?

So I'd suggest - instead of repeating ourselves by adding range [0,1] to all pos occasions, how about to add a brief introduction on what's the coordinate system Taichi GUI uses at the beginning of this doc, so that users will automatically know what the following pos means?

docs/gui.rst Outdated
@@ -202,7 +202,7 @@ Paint on a window

:parameter gui: (GUI) the window object
:parameter content: (str) the text to draw
:parameter pos: (tuple of 2) the top-left point position of the fonts / texts
:parameter pos: (tuple of 2, range [0,1] ) the relative position of the top-left point of the fonts / texts
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
:parameter pos: (tuple of 2, range [0,1] ) the relative position of the top-left point of the fonts / texts
:parameter pos: (tuple of 2, range [0,1]) the relative position of the top-left point of the fonts / texts

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree! I submitted a new commit with a brief introduction section. The explanation of pos goes into a Note section. Please review.

@codecov
Copy link

codecov bot commented Sep 29, 2020

Codecov Report

Merging #1904 into master will increase coverage by 0.95%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1904      +/-   ##
==========================================
+ Coverage   43.19%   44.14%   +0.95%     
==========================================
  Files          44       44              
  Lines        6330     6121     -209     
  Branches     1092     1092              
==========================================
- Hits         2734     2702      -32     
+ Misses       3426     3250     -176     
+ Partials      170      169       -1     
Impacted Files Coverage Δ
python/taichi/lang/ast_checker.py 70.58% <0.00%> (-1.64%) ⬇️
python/taichi/testing.py 75.00% <0.00%> (-0.72%) ⬇️
python/taichi/lang/linalg.py 89.33% <0.00%> (-0.67%) ⬇️
python/taichi/lang/meta.py 62.31% <0.00%> (-0.54%) ⬇️
python/taichi/lang/__init__.py 41.94% <0.00%> (-0.51%) ⬇️
python/taichi/misc/util.py 17.48% <0.00%> (-0.26%) ⬇️
python/taichi/misc/task.py 0.00% <0.00%> (ø)
python/taichi/lang/shell.py 0.00% <0.00%> (ø)
python/taichi/tools/patterns.py 0.00% <0.00%> (ø)
python/taichi/lang/kernel.py 71.17% <0.00%> (+0.13%) ⬆️
... and 9 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f2a798d...aab8dc8. Read the comment docs.

@archibate archibate changed the base branch from stable to master September 29, 2020 14:56
Copy link
Collaborator

@archibate archibate left a comment

Choose a reason for hiding this comment

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

LGTMig + 2 nits :)

docs/gui.rst Show resolved Hide resolved
docs/gui.rst Outdated Show resolved Hide resolved
Copy link
Member

@yuanming-hu yuanming-hu left a comment

Choose a reason for hiding this comment

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

Thanks for the PR, and welcome on board!

This mostly LGTM. I added some minor wording fixes. This PR can be merged if the suggestions are committed.

docs/gui.rst Outdated Show resolved Hide resolved
docs/gui.rst Outdated Show resolved Hide resolved
houkensjtu and others added 2 commits October 3, 2020 21:59
Co-authored-by: Yuanming Hu <yuanming-hu@users.noreply.github.com>
Co-authored-by: Yuanming Hu <yuanming-hu@users.noreply.github.com>
@yuanming-hu yuanming-hu merged commit eba3e25 into taichi-dev:master Oct 4, 2020
@yuanming-hu yuanming-hu mentioned this pull request Oct 7, 2020
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