-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[docs] py docstrings: when generating docstrings, ignore old __DOC.py #2578
[docs] py docstrings: when generating docstrings, ignore old __DOC.py #2578
Conversation
Filed as internal issue #USD-8572 |
@pmolodo first of all, huge thanks for doing this change -- I have been burned several times by this issue while testing python doc string builds. I might be paranoid, but I am slightly worried that your change to Tf that accesses the new env var is a little subtle and could result in confusion down the road. I tried an experiment that does things a little differently, specifically, I removed the section of cdWriterDocstring.py -> __getOutputFormat that bails if it finds an existing doc for the given pyobj. In other words, __getOutputFormat just always overwrites existing doc strings. This seems like reasonable behavior to me -- the comment in the code about not overwriting existing docstrings because "it may be custom authored in the C++ wrap files" I think is coming from internal use of the script at Pixar, and I don't think applies to the USD libs. Let me know what you think about this alternate approach. |
@dsyu-pixar - I'm not sure if that's the best approach or not - there are, in fact, some custom-authored python docstrings in USD that would be overwritten - ie, see here and here. It's possible the new docs generated from parsing C++ might be better (?), but we should probably at least confirm that before making this change. As for the env var - I think having the ability to disable using the However - if you really don't like the env var approach, we could try an approach where we delete __DOC.py files in |
Thanks @pmolodo and good point about some of the custom-authored strings in Sdf and Vt. My proposed approach is probably not the way to go. In a review of this change, there was some concern about the Tf-envvar approach. I apologize for the back-and-forth on this change, but would it be possible to try the delete-file approach that you mentioned? |
|
6d1b59b
to
1a7b35b
Compare
Ignore my previous comment... generating the list of files isn't hard, we can figure it out beforehand. I've pushed a version that works in the manner you proposed. It also includes a new flag |
...this significantly speeds up subsequent runs, which is useful when iterating / developing
...otherwise, the old generated python docstrings will cause new docstring generation to be skipped... but the new docstrings are still written out as empty The result was that, before this change, every other run of docstring generation would wipe most of the docstrings
1a7b35b
to
9270d58
Compare
Rebased to fix merge conflicts... |
Description of Change(s)
py docstrings: when generating docstrings, ignore old __DOC.py
...otherwise, the old generated python docstrings will cause new docstring generation to be skipped... but the new docstrings are still written out as empty
The result was that, before this change, every other run of docstring generation would wipe most of the docstrings
NOTE:
This PR is one of several targeting the python docstring generation process. To see all these PRs in a branch, see here.