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

Final Sphinx documentation w/ ReadTheDocs #172

Closed
wants to merge 20 commits into from
Closed
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
32 changes: 32 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the version of Python and other tools you might need
build:
os: ubuntu-20.04
apt_packages:
- libsndfile1
- ffmpeg
tools:
python: "3.9"
# You can also specify other tool versions:
# nodejs: "16"
# rust: "1.55"
# golang: "1.17"

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/source/conf.py

# If using Sphinx, optionally build your docs in additional formats such as PDF
# formats:
# - pdf

# Optionally declare the Python requirements required to build your docs
python:
install:
- requirements: docs/requirements.txt
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build

if "%1" == "" goto help

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
18 changes: 18 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
iopath>=0.1.8
nlpaug==1.1.3
numpy>=1.19.5
Pillow>=8.2.0
python-magic>=0.4.22
regex>=2021.4.4
vidgear>=0.2.4
audioread>=2.1.9
ffmpeg-python>=0.2.0
librosa>=0.8.1
opencv-python>=4.5.2.54
SoundFile>=0.10.3.post1
torch>=1.9.0
torchaudio>=0.9.0
sphinx
sphinx-epytext
sphinx-autodoc-typehints
myst-parser
Copy link
Contributor

Choose a reason for hiding this comment

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

instead of copying/pasting this from the requirements.txt on the base level of this repo, is there any way we could populate this dynamically from the original requirements?

this will allow for less human error/forgetting to update dependencies in both locations

Copy link
Contributor

Choose a reason for hiding this comment

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

+1 strongly agree!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jbitton There is a possible route but I'm not too sure if it will work. So basically we could require the ReadTheDocs build to run setup.py and within that file, the docs/requirements.txt is dynamically generated.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm personally okay with that. As long as we only do this for readthedocs builds :)

4 changes: 4 additions & 0 deletions docs/source/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Get Started

```{include} ../../README.md
```
2 changes: 2 additions & 0 deletions docs/source/README_audio.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
```{include} ../../augly/audio/README.md
```
2 changes: 2 additions & 0 deletions docs/source/README_image.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
```{include} ../../augly/image/README.md
```
2 changes: 2 additions & 0 deletions docs/source/README_text.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
```{include} ../../augly/text/README.md
```
2 changes: 2 additions & 0 deletions docs/source/README_video.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
```{include} ../../augly/video/README.md
```
Binary file added docs/source/_static/logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 53 additions & 0 deletions docs/source/augly.audio.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
augly.audio package
===================

Submodules
----------

augly.audio.composition module
------------------------------

.. automodule:: augly.audio.composition
:members:
:undoc-members:
:show-inheritance:

augly.audio.functional module
-----------------------------

.. automodule:: augly.audio.functional
:members:
:undoc-members:
:show-inheritance:

augly.audio.intensity module
----------------------------

.. automodule:: augly.audio.intensity
:members:
:undoc-members:
:show-inheritance:

augly.audio.transforms module
-----------------------------

.. automodule:: augly.audio.transforms
:members:
:undoc-members:
:show-inheritance:

augly.audio.utils module
------------------------

.. automodule:: augly.audio.utils
:members:
:undoc-members:
:show-inheritance:
Copy link
Contributor

Choose a reason for hiding this comment

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

i don't think it's needed to publicize the utils module, since that's meant for internal development as opposed to external use. tagging @zpapakipos to ensure she agrees


Module contents
---------------

.. automodule:: augly.audio
:members:
:undoc-members:
:show-inheritance:
61 changes: 61 additions & 0 deletions docs/source/augly.image.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
augly.image package
===================

Subpackages
-----------

.. toctree::
:maxdepth: 4

augly.image.utils
Copy link
Contributor

Choose a reason for hiding this comment

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

since augly.image.utils doesn't exist anymore as an .rst file, should this be deleted too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jbitton Yep I'll delete that


Submodules
----------

augly.image.composition module
------------------------------

.. automodule:: augly.image.composition
:members:
:undoc-members:
:show-inheritance:

augly.image.functional module
-----------------------------

.. automodule:: augly.image.functional
:members:
:undoc-members:
:show-inheritance:

augly.image.helpers module
--------------------------

.. automodule:: augly.image.helpers
:members:
:undoc-members:
:show-inheritance:

augly.image.intensity module
----------------------------

.. automodule:: augly.image.intensity
:members:
:undoc-members:
:show-inheritance:

augly.image.transforms module
-----------------------------

.. automodule:: augly.image.transforms
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

.. automodule:: augly.image
:members:
:undoc-members:
:show-inheritance:
37 changes: 37 additions & 0 deletions docs/source/augly.image.utils.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
augly.image.utils package
Copy link
Contributor

Choose a reason for hiding this comment

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

same comment as audio lib -- i don't think we need to publicize this, as it's for internal development not external use (cc: @zpapakipos)

=========================

Submodules
----------

augly.image.utils.bboxes module
-------------------------------

.. automodule:: augly.image.utils.bboxes
:members:
:undoc-members:
:show-inheritance:

augly.image.utils.metadata module
---------------------------------

.. automodule:: augly.image.utils.metadata
:members:
:undoc-members:
:show-inheritance:

augly.image.utils.utils module
------------------------------

.. automodule:: augly.image.utils.utils
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

.. automodule:: augly.image.utils
:members:
:undoc-members:
:show-inheritance:
23 changes: 23 additions & 0 deletions docs/source/augly.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
augly package
=============

Subpackages
-----------

.. toctree::
:maxdepth: 4

augly.audio
augly.image
augly.tests
Copy link
Contributor

Choose a reason for hiding this comment

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

i dont think we need to publicize augly.tests (cc: @zpapakipos)

augly.text
augly.utils
Copy link
Contributor

Choose a reason for hiding this comment

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

im borderline about augly.utils -- i think it's nice to show off what assets we have, but maybe we don't need to publicize every file in there

augly.video

Module contents
---------------

.. automodule:: augly
:members:
:undoc-members:
:show-inheritance: