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] Update documentaion on meta programming for #1374 #1389

Merged

Conversation

archibate
Copy link
Collaborator

Related issue = update doc for #1374

[Click here for the format server]


@codecov

This comment has been minimized.

@archibate archibate added doc Documentation related issues & PRs waiting for reply labels Jul 4, 2020
@archibate archibate requested a review from k-ye July 14, 2020 15:36
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.

Looks great! Thank you. Please fix the minor wording issues.

docs/snode.rst Outdated Show resolved Hide resolved
Comment on lines +155 to +162
for i in ti.static(range(4)):
print(i)

# is equivalent to:
print(0)
print(1)
print(2)
print(3)
Copy link
Member

Choose a reason for hiding this comment

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

It seems that we are mixing 2-space and 4-space identation... Maybe we should somehow enforce PEP8 for all the Python code in the doc? I don't have a clear idea how that can be done automatically :-)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't know, e.g.:

.. code-block::

    4tabs

vs

.. code-block::

  2tabs

Is that possible to let ti format take care of that too?

Copy link
Member

Choose a reason for hiding this comment

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

Is that possible to let ti format take care of that too?

We probably can, but I don't think that would be easy. We will need to write an rst parster that extract the code, format using yapf, and the put it back...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No, my idea is: not only parse the code-block, but parse the whole rst, e.g.:

- This  is a  bad line
+ This is a bad line
- This is a bad line that is tooooooooooo long for yapf
+ This is a bad line that is tooooooooooo
+ long for yapf

Copy link
Member

Choose a reason for hiding this comment

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

You probably need a different tool. I don't think yapf can correctly handle rst...

docs/meta.rst Outdated Show resolved Hide resolved
docs/meta.rst Outdated Show resolved Hide resolved
docs/meta.rst Outdated Show resolved Hide resolved
docs/meta.rst Outdated Show resolved Hide resolved
docs/meta.rst Outdated Show resolved Hide resolved
docs/meta.rst Outdated Show resolved Hide resolved
docs/meta.rst Outdated Show resolved Hide resolved
docs/meta.rst Outdated Show resolved Hide resolved
@archibate archibate requested a review from yuanming-hu July 16, 2020 15:24
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.

Looks great. Thank you.

@archibate archibate added the LGTM label Jul 17, 2020
@archibate archibate merged commit 6dc41ce into taichi-dev:master Jul 17, 2020
@yuanming-hu yuanming-hu mentioned this pull request Jul 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Documentation related issues & PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants