From 29351443fe8ed5f3d15c4c03302fe1fef9f1cf01 Mon Sep 17 00:00:00 2001 From: Jason Parham Date: Thu, 5 Feb 2026 14:06:44 -0500 Subject: [PATCH 1/4] Fixes for pyastar2d dependency and documentation --- .gitignore | 2 ++ .readthedocs.yaml | 2 +- README.rst | 1 - docs/Makefile | 20 +++++++++++++++++ docs/conf.py | 39 ++++++---------------------------- docs/index.rst | 18 ++++++++++++++-- docs/make.bat | 35 ++++++++++++++++++++++++++++++ requirements/documentation.txt | 4 ++++ requirements/optional.txt | 2 -- requirements/runtime.txt | 3 +-- setup.cfg | 2 +- 11 files changed, 87 insertions(+), 41 deletions(-) create mode 100644 docs/Makefile create mode 100644 docs/make.bat create mode 100644 requirements/documentation.txt diff --git a/.gitignore b/.gitignore index fde0cdc..bc5bf9f 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,5 @@ docs/_build/ example*.jpg example*.json .vscode/* + +assets/*.key diff --git a/.readthedocs.yaml b/.readthedocs.yaml index fc0fde9..c156481 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -18,6 +18,6 @@ sphinx: # Optionally declare the Python requirements required to build your docs python: install: - - requirements: requirements.txt + - requirements: requirements/documentation.txt - method: pip path: . diff --git a/README.rst b/README.rst index 7d703d7..a6d0102 100644 --- a/README.rst +++ b/README.rst @@ -1,4 +1,3 @@ -============== Kitware BatBot ============== diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..d4bb2cb --- /dev/null +++ b/docs/Makefile @@ -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 = . +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) diff --git a/docs/conf.py b/docs/conf.py index 4377d6d..f514f9b 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,29 +1,17 @@ # Configuration file for the Sphinx documentation builder. # -# This file only contains a selection of the most common options. For a full -# list see the documentation: +# For the full list of built-in configuration values, see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html -# -- Path setup -------------------------------------------------------------- - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -# -# import os -# import sys -# sys.path.insert(0, os.path.abspath('.')) - - # -- Project information ----------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information -project = 'Kitware BatBot' -copyright = '2025' -author = 'Kitware' - +project = 'batbot' +copyright = '2026, Kitware, Inc.' +author = 'Kitware, Inc.' # -- General configuration --------------------------------------------------- -# -- General configuration +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration extensions = [ 'sphinx.ext.duration', @@ -49,22 +37,13 @@ intersphinx_disabled_domains = ['std'] templates_path = ['_templates'] - -# -- Options for EPUB output epub_show_urls = 'footnote' -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -# This pattern also affects html_static_path and html_extra_path. exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] -autosectionlabel_prefix_document = True - # -- Options for HTML output ------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -# html_theme = 'sphinx_rtd_theme' html_theme_path = [ @@ -80,10 +59,6 @@ 'donate.html', ] } - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] html_css_files = [ 'theme.css', diff --git a/docs/index.rst b/docs/index.rst index 986d853..606784e 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,16 +1,30 @@ +.. batbot documentation master file, created by + sphinx-quickstart on Thu Feb 5 13:49:59 2026. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + .. include:: ../README.rst .. include:: ../CHANGELOG.rst .. include:: ../ISSUES.rst -======== Contents -======== +-------- .. toctree:: :maxdepth: 3 + :caption: Contents: Home batbot cli + +Indices and tables +------------------ + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` + +.. include:: colors.rst diff --git a/docs/make.bat b/docs/make.bat new file mode 100644 index 0000000..954237b --- /dev/null +++ b/docs/make.bat @@ -0,0 +1,35 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=. +set BUILDDIR=_build + +%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 +) + +if "%1" == "" goto help + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + +:end +popd diff --git a/requirements/documentation.txt b/requirements/documentation.txt new file mode 100644 index 0000000..4eee2cc --- /dev/null +++ b/requirements/documentation.txt @@ -0,0 +1,4 @@ +Sphinx>=5,<6 +sphinx_click +sphinx_rtd_theme +standard-imghdr diff --git a/requirements/optional.txt b/requirements/optional.txt index 8dcdc59..9891401 100644 --- a/requirements/optional.txt +++ b/requirements/optional.txt @@ -20,8 +20,6 @@ pyupgrade pyyaml rstcheck rstcheck[sphinx] -Sphinx>=5,<6 -sphinx_rtd_theme # torch # torchvision xdoctest diff --git a/requirements/runtime.txt b/requirements/runtime.txt index 9f94278..7a7113c 100644 --- a/requirements/runtime.txt +++ b/requirements/runtime.txt @@ -8,9 +8,8 @@ numpy opencv-python-headless Pillow pooch -pyastar2d @ git+https://github.com/bluemellophone/batbot-pyastar2d@master +pyastar2d>=1.1.1 rich scikit-image shapely -sphinx-click tqdm diff --git a/setup.cfg b/setup.cfg index 3cf199b..c706a41 100644 --- a/setup.cfg +++ b/setup.cfg @@ -28,7 +28,7 @@ install_requires = opencv-python-headless Pillow pooch - pyastar2d @ git+https://github.com/bluemellophone/batbot-pyastar2d@master + pyastar2d>=1.1.1 rich scikit-image shapely From af6ee68da83d9a1ab805cc859f26a8a75da06e69 Mon Sep 17 00:00:00 2001 From: "trevor.stout" Date: Tue, 10 Feb 2026 14:34:22 -0500 Subject: [PATCH 2/4] Fix comment parsing for documentation --- batbot/batbot_cli.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/batbot/batbot_cli.py b/batbot/batbot_cli.py index aa5c82f..215e921 100755 --- a/batbot/batbot_cli.py +++ b/batbot/batbot_cli.py @@ -158,14 +158,14 @@ def preprocess( ): """Generate compressed spectrogram images for input wav files into the same or a specified output directory. Takes one or more space separated arguments of filepaths to process. If given a directory name argument, - will recursively search through the directory and all subfolders to find all contained *.wav files. - Alternatively, the argument can be given as a string using wildcard ** for folders and/or * in filenames - (if ** wildcard is used, will recursively search through all subfolders). + will recursively search through the directory and all subfolders to find all contained \*.wav files. + Alternatively, the argument can be given as a string using wildcard \** for folders and/or \* in filenames + (if \** wildcard is used, will recursively search through all subfolders). \b Examples: batbot preprocess ../data -o ./tmp - batbot preprocess "../data/**/*.wav" + batbot preprocess "../data/\**/\*.wav" batbot preprocess ../data -o ./tmp -n 32 batbot preprocess ../data -o ./tmp -n 32 -fm batbot preprocess ../data -o ./tmp -f --dry-run --output-json dry_run.json From 0704154bd87cdbfde6c85a116fa1d3d715a0a4f5 Mon Sep 17 00:00:00 2001 From: "trevor.stout" Date: Tue, 10 Feb 2026 14:34:36 -0500 Subject: [PATCH 3/4] Fix filename --- docs/cli.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/cli.rst b/docs/cli.rst index f89de77..81b7601 100644 --- a/docs/cli.rst +++ b/docs/cli.rst @@ -8,7 +8,7 @@ models that have been pretrained for inference in a production environment. .. toctree:: :maxdepth: 3 -.. click:: batbot.batbot:cli +.. click:: batbot.batbot_cli:cli :prog: batbot :nested: full From 31c9aca7fa68059743a2d298703778b262db349c Mon Sep 17 00:00:00 2001 From: "trevor.stout" Date: Tue, 10 Feb 2026 14:37:30 -0500 Subject: [PATCH 4/4] Linting --- batbot/batbot_cli.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/batbot/batbot_cli.py b/batbot/batbot_cli.py index 215e921..f108ef3 100755 --- a/batbot/batbot_cli.py +++ b/batbot/batbot_cli.py @@ -158,14 +158,14 @@ def preprocess( ): """Generate compressed spectrogram images for input wav files into the same or a specified output directory. Takes one or more space separated arguments of filepaths to process. If given a directory name argument, - will recursively search through the directory and all subfolders to find all contained \*.wav files. - Alternatively, the argument can be given as a string using wildcard \** for folders and/or \* in filenames - (if \** wildcard is used, will recursively search through all subfolders). + will recursively search through the directory and all subfolders to find all contained \\*.wav files. + Alternatively, the argument can be given as a string using wildcard \\** for folders and/or \\* in filenames + (if \\** wildcard is used, will recursively search through all subfolders). \b Examples: batbot preprocess ../data -o ./tmp - batbot preprocess "../data/\**/\*.wav" + batbot preprocess "../data/\\**/\\*.wav" batbot preprocess ../data -o ./tmp -n 32 batbot preprocess ../data -o ./tmp -n 32 -fm batbot preprocess ../data -o ./tmp -f --dry-run --output-json dry_run.json