CODAIT / text-extensions-for-pandas

Natural language processing support for Pandas dataframes.
Apache License 2.0
217 stars 34 forks source link

Adjust package structure to get Sphinx working properly #119

Closed frreiss closed 4 years ago

frreiss commented 4 years ago

This PR modifies the __init__.py files throughout the project so that Sphinx autodoc will correctly pick up the names of API functions. These changes address the problems I noted in #118, as well as getting the repository closer to a point where we can generate API docs from the https://readthedocs.org/ Github hooks.

Since I was mucking with package headers anyhow, I also made the naming changes to cover issue #97. The contents of the io directory are now exposed as a collection of sub-packages, one package for each library we integrate with. I've also given the spanner and jupyter sub-packages their own portions of the namespace, instead of having everything there imported to the top-level namespace. Now the only thing directly under text_extensions_for_pandas is the classes that comprise the extension types.

I've modified the notebooks to account for new subpackage names where needed.

I replaced our previous usage of sphinx-apidoc with a hard-coded index.rst file that pulls in all the public packages. That approach seems to be simpler and easier than the additional code changes we would need for apidoc to output a usable set of files. We may want to go in at a later date and re-enable apidoc. If we do re-enable it, we should invoke it from the conf.py file via the sphinxcontrib.apidoc extension (https://github.com/sphinx-contrib/apidoc). I've left a dependency on sphinxcontrib-apidoc in config/dev_reqs.txt to support such an eventual change.

For now, all the API documentation is ends up in single HTML file (plus some auxiliary files for indexes and searching). We can change that layout in the future by splitting index.rst into multiple files if needed.

review-notebook-app[bot] commented 4 years ago

Check out this pull request on  ReviewNB

Review Jupyter notebook visual diffs & provide feedback on notebooks.


Powered by ReviewNB

BryanCutler commented 4 years ago

I'll merge now so we can make progress on the docs, the minior nit about the comments can be looked at later.