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

Replace handmade api docs with autogenerated api docs #637

Merged
merged 7 commits into from
Apr 12, 2021

Conversation

aaronayres35
Copy link
Contributor

@aaronayres35 aaronayres35 commented Apr 8, 2021

This PR replaces the hand curated api docs in the api reference with the autogenerated api docs. It then deletes the files for the hand made api docs.

This PR drastically decreases the number of warnings issued when building the docs from 1000+ down to now ~30.

In a follow up PR (possibly to sit on top of this branch), I will take the lists of links to important objects from these remove hand curated api doc files, and add those lists to the corresponding section of the user manual. Having these clear listings is useful but we don't need the redundancy.

UPDATE:
This PR now uses api docs templates following the lead of PRs enthought/envisage#339 and enthought/traits-futures#181

@aaronayres35
Copy link
Contributor Author

One thing this PR has made me notice is that some modules in chaco explicitly define __all__, eg

__all__ = [
"OverlayPlotContainer",
"HPlotContainer",
"VPlotContainer",
"GridPlotContainer",
]

As a result, in this particular case, the base class StackedPlotContainer does not show up in the auto generated api docs. I believe this class shouldn't be used directly, rather is subclasses HPlotContainer/VPlotContainer should. However, having it documented in the api docs could be useful.

@aaronayres35
Copy link
Contributor Author

@rahulporuri I am going to hold up on the follow up PR for now as I want to discuss with you more. We had said offline that we could list these classes in their corresponding pages of he usermanual which makes sense, but what about the corresponding section of the Commonly used Modules and Classes page, as that appears to be sort of the point of that page.

@rahulporuri rahulporuri self-requested a review April 9, 2021 10:41
Copy link
Contributor

@rahulporuri rahulporuri left a comment

Choose a reason for hiding this comment

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

The autogenerated docs themselves look good but there are a couple of comments :

  • can we use the api docs templates (like we do in e.g. traits-futures)
  • can we also ignore the chaco.tests_with_backend module when autogenerating the docs?

Copy link
Contributor

@rahulporuri rahulporuri left a comment

Choose a reason for hiding this comment

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

Still LGTM with a couple of comments

Comment on lines +312 to +318
# Remove any previously autogenerated API documentation.
doc_api_files = os.listdir(api_path)
permanent = ['chaco.api.rst', 'templates']
previously_autogenerated = \
[file for file in doc_api_files if file not in permanent]
for file in previously_autogenerated:
os.remove(os.path.join(api_path, file))
Copy link
Contributor

Choose a reason for hiding this comment

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

This might be overkill but okay (not an actionable comment). I guess this is needed if we rename modules and dont do git clean locally between docs builds.

docs/source/api/chaco.api.rst Outdated Show resolved Hide resolved
docs/source/api/templates/module.rst_t Outdated Show resolved Hide resolved
docs/source/api/templates/package.rst_t Outdated Show resolved Hide resolved
@aaronayres35 aaronayres35 merged commit e5a8594 into master Apr 12, 2021
@rahulporuri rahulporuri deleted the replace-handmade-api-docs branch April 19, 2021 12:51
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.

2 participants