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] Add Python docstring for SNode #2580

Merged
merged 4 commits into from
Jul 26, 2021
Merged

[Doc] Add Python docstring for SNode #2580

merged 4 commits into from
Jul 26, 2021

Conversation

k-ye
Copy link
Member

@k-ye k-ye commented Jul 25, 2021

Related issue = #2579

In addition to the docstring itself, this PR serves as an example for how to do class/method referencing.

@k-ye
Copy link
Member Author

k-ye commented Jul 25, 2021

/format

@k-ye k-ye requested review from ljcc0930 and rexwangcc July 25, 2021 13:07
Copy link
Collaborator

@rexwangcc rexwangcc left a comment

Choose a reason for hiding this comment

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

I left a few comments but in general looks good!

One minor question: is the reason we don't use type annotations in python/taichi/lang/snode.py that it requires extra import List, ... from typing, or that it simply hasn't happened yet?

python/taichi/lang/snode.py Outdated Show resolved Hide resolved
python/taichi/lang/snode.py Show resolved Hide resolved
@k-ye
Copy link
Member Author

k-ye commented Jul 26, 2021

One minor question: is the reason we don't use type annotations in python/taichi/lang/snode.py that it requires extra import List, ... from typing, or that it simply hasn't happened yet?

It's a combination of me being lazy and the code hierarchy: I was planning to use the Axis type, but then ran into circular import issue...

@rexwangcc
Copy link
Collaborator

One minor question: is the reason we don't use type annotations in python/taichi/lang/snode.py that it requires extra import List, ... from typing, or that it simply hasn't happened yet?

It's a combination of me being lazy and the code hierarchy: I was planning to use the Axis type, but then ran into circular import issue...

Ah, gotcha. I'm fine with leaving them as is then! (we could use forward references to bypass the circular import, but I guess we can solve it once and for all by refactoring the code later?)

Copy link
Collaborator

@rexwangcc rexwangcc left a comment

Choose a reason for hiding this comment

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

LGTM

@k-ye
Copy link
Member Author

k-ye commented Jul 26, 2021

(we could use forward references to bypass the circular import, but I guess we can solve it once and for all by refactoring the code later?)

+1, I feel like the code needs some refactor before we have all the types we need for annotation

@k-ye k-ye merged commit cec53f9 into taichi-dev:master Jul 26, 2021
@k-ye k-ye deleted the docstring branch July 26, 2021 02:55
@Leonz5288 Leonz5288 mentioned this pull request Aug 3, 2021
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