From 845252758914c4a314c2910132153902869cb9b5 Mon Sep 17 00:00:00 2001 From: Sam Freund Date: Sat, 12 Apr 2025 16:44:25 -0500 Subject: [PATCH 01/49] Update photon-api-docs.yml --- .github/workflows/photon-api-docs.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/photon-api-docs.yml b/.github/workflows/photon-api-docs.yml index 332490c140..0b70c15ecd 100644 --- a/.github/workflows/photon-api-docs.yml +++ b/.github/workflows/photon-api-docs.yml @@ -39,11 +39,11 @@ jobs: run: npm run build-demo - uses: actions/upload-artifact@v4 with: - name: built-demo + name: demo path: photon-client/dist/ - run_api_docs: - name: Build API Docs + run_java_cpp_docs: + name: Build API Docs For Java and C++ runs-on: "ubuntu-22.04" steps: - name: Checkout code @@ -63,18 +63,18 @@ jobs: ./gradlew photon-docs:generateJavaDocs photon-docs:doxygen - uses: actions/upload-artifact@v4 with: - name: built-docs + name: docs-java-cpp path: photon-docs/build/docs publish_api_docs: name: Publish API Docs - needs: [run_api_docs] + needs: [run_java_cpp_docs] runs-on: ubuntu-22.04 steps: # Download docs artifact - uses: actions/download-artifact@v4 with: - name: built-docs + pattern: docs-* - run: find . - name: Publish Docs To Development if: github.ref == 'refs/heads/main' @@ -100,7 +100,7 @@ jobs: steps: - uses: actions/download-artifact@v4 with: - name: built-demo + name: demo - run: find . - name: Publish demo if: github.ref == 'refs/heads/main' From c440ce57ce2f16061241097e1e14995acab239fc Mon Sep 17 00:00:00 2001 From: Sam Freund Date: Sat, 12 Apr 2025 16:49:06 -0500 Subject: [PATCH 02/49] Update photon-api-docs.yml --- .github/workflows/photon-api-docs.yml | 29 ++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/.github/workflows/photon-api-docs.yml b/.github/workflows/photon-api-docs.yml index 0b70c15ecd..539af1b30c 100644 --- a/.github/workflows/photon-api-docs.yml +++ b/.github/workflows/photon-api-docs.yml @@ -3,7 +3,7 @@ name: Photon API Documentation on: # Run on pushes to main and pushed tags, and on pull requests against main, but ignore the docs folder push: - branches: [ main ] + branches: [ main, py-docs ] tags: - 'v*' pull_request: @@ -66,6 +66,33 @@ jobs: name: docs-java-cpp path: photon-docs/build/docs + run_py_docs: + name: Build Python API Docs + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install mkdocs mkdocs-material + + - name: Build MkDocs site + run: mkdocs build --clean + + - name: Upload built site as artifact + uses: actions/upload-artifact@v4 + with: + name: docs-python + path: site/ + publish_api_docs: name: Publish API Docs needs: [run_java_cpp_docs] From 35c72e8446881313013a16170b1ca1cedfd72966 Mon Sep 17 00:00:00 2001 From: Sam Freund Date: Sat, 12 Apr 2025 16:49:42 -0500 Subject: [PATCH 03/49] Update photon-api-docs.yml --- .github/workflows/photon-api-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/photon-api-docs.yml b/.github/workflows/photon-api-docs.yml index 539af1b30c..12613621fe 100644 --- a/.github/workflows/photon-api-docs.yml +++ b/.github/workflows/photon-api-docs.yml @@ -95,7 +95,7 @@ jobs: publish_api_docs: name: Publish API Docs - needs: [run_java_cpp_docs] + needs: [ run_java_cpp_docs, run_py_docs ] runs-on: ubuntu-22.04 steps: # Download docs artifact From 47b799a0ceb16b3cf35b092f92c55e9dea857e50 Mon Sep 17 00:00:00 2001 From: samfreund Date: Sat, 12 Apr 2025 17:12:13 -0500 Subject: [PATCH 04/49] add docs for python --- photon-lib/py/docs/estimatedRobotPose.md | 3 +++ photon-lib/py/docs/index.md | 17 +++++++++++++++++ photon-lib/py/docs/packet.md | 3 +++ photon-lib/py/docs/photonCamera.md | 3 +++ photon-lib/py/docs/photonPoseEstimator.md | 3 +++ photon-lib/py/mkdocs.yml | 18 ++++++++++++++++++ 6 files changed, 47 insertions(+) create mode 100644 photon-lib/py/docs/estimatedRobotPose.md create mode 100644 photon-lib/py/docs/index.md create mode 100644 photon-lib/py/docs/packet.md create mode 100644 photon-lib/py/docs/photonCamera.md create mode 100644 photon-lib/py/docs/photonPoseEstimator.md create mode 100644 photon-lib/py/mkdocs.yml diff --git a/photon-lib/py/docs/estimatedRobotPose.md b/photon-lib/py/docs/estimatedRobotPose.md new file mode 100644 index 0000000000..506e8adf85 --- /dev/null +++ b/photon-lib/py/docs/estimatedRobotPose.md @@ -0,0 +1,3 @@ +# EstimatedRobotPose API + +::: photonlibpy.estimatedRobotPose diff --git a/photon-lib/py/docs/index.md b/photon-lib/py/docs/index.md new file mode 100644 index 0000000000..000ea3455f --- /dev/null +++ b/photon-lib/py/docs/index.md @@ -0,0 +1,17 @@ +# Welcome to MkDocs + +For full documentation visit [mkdocs.org](https://www.mkdocs.org). + +## Commands + +* `mkdocs new [dir-name]` - Create a new project. +* `mkdocs serve` - Start the live-reloading docs server. +* `mkdocs build` - Build the documentation site. +* `mkdocs -h` - Print help message and exit. + +## Project layout + + mkdocs.yml # The configuration file. + docs/ + index.md # The documentation homepage. + ... # Other markdown pages, images and other files. diff --git a/photon-lib/py/docs/packet.md b/photon-lib/py/docs/packet.md new file mode 100644 index 0000000000..50602fc625 --- /dev/null +++ b/photon-lib/py/docs/packet.md @@ -0,0 +1,3 @@ +# Packet API + +::: photonlibpy.packet diff --git a/photon-lib/py/docs/photonCamera.md b/photon-lib/py/docs/photonCamera.md new file mode 100644 index 0000000000..2c1fcdd88f --- /dev/null +++ b/photon-lib/py/docs/photonCamera.md @@ -0,0 +1,3 @@ +# PhotonCamera API + +::: photonlibpy.photonCamera diff --git a/photon-lib/py/docs/photonPoseEstimator.md b/photon-lib/py/docs/photonPoseEstimator.md new file mode 100644 index 0000000000..5075a84c02 --- /dev/null +++ b/photon-lib/py/docs/photonPoseEstimator.md @@ -0,0 +1,3 @@ +# Photon Pose Estimator API + +::: photonlibpy.photonPoseEstimator diff --git a/photon-lib/py/mkdocs.yml b/photon-lib/py/mkdocs.yml new file mode 100644 index 0000000000..80626c158d --- /dev/null +++ b/photon-lib/py/mkdocs.yml @@ -0,0 +1,18 @@ +site_name: PhotonVision Python API Docs + +theme: + name: material + +plugins: + - search + - mkdocstrings: + default_handler: python + +nav: + - Home: index.md + - API Reference: + - PhotonCamera: photonCamera.md + - EstimatedRobotPose: estimatedRobotPose.md + - Packet: packet.md + - PhotonPoseEstimator: photonPoseEstimator.md + From 462a2aa629a3be6e6604422d4ae55e0d549a0aed Mon Sep 17 00:00:00 2001 From: Sam Freund Date: Sat, 12 Apr 2025 17:16:07 -0500 Subject: [PATCH 05/49] Update photon-api-docs.yml --- .github/workflows/photon-api-docs.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/photon-api-docs.yml b/.github/workflows/photon-api-docs.yml index 12613621fe..308fdec0e5 100644 --- a/.github/workflows/photon-api-docs.yml +++ b/.github/workflows/photon-api-docs.yml @@ -86,12 +86,13 @@ jobs: - name: Build MkDocs site run: mkdocs build --clean + working-directory: photon-lib/py - name: Upload built site as artifact uses: actions/upload-artifact@v4 with: name: docs-python - path: site/ + path: photon-lib/py/site/ publish_api_docs: name: Publish API Docs From 7c6bab1dfa10ca8b765edb6312b390d8b16f01b3 Mon Sep 17 00:00:00 2001 From: Sam Freund Date: Sat, 12 Apr 2025 17:17:21 -0500 Subject: [PATCH 06/49] Update photon-api-docs.yml --- .github/workflows/photon-api-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/photon-api-docs.yml b/.github/workflows/photon-api-docs.yml index 308fdec0e5..21b8100216 100644 --- a/.github/workflows/photon-api-docs.yml +++ b/.github/workflows/photon-api-docs.yml @@ -82,7 +82,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install mkdocs mkdocs-material + pip install mkdocs mkdocs-material mkdocstrings[python] - name: Build MkDocs site run: mkdocs build --clean From 6d816b5053d2d0a9334f06844b5b4b21bd72c39a Mon Sep 17 00:00:00 2001 From: Sam Freund Date: Sat, 12 Apr 2025 17:19:46 -0500 Subject: [PATCH 07/49] Update photon-api-docs.yml --- .github/workflows/photon-api-docs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/photon-api-docs.yml b/.github/workflows/photon-api-docs.yml index 21b8100216..0db159882e 100644 --- a/.github/workflows/photon-api-docs.yml +++ b/.github/workflows/photon-api-docs.yml @@ -43,7 +43,7 @@ jobs: path: photon-client/dist/ run_java_cpp_docs: - name: Build API Docs For Java and C++ + name: Build Java and C++ API Docs runs-on: "ubuntu-22.04" steps: - name: Checkout code @@ -105,7 +105,7 @@ jobs: pattern: docs-* - run: find . - name: Publish Docs To Development - if: github.ref == 'refs/heads/main' + # if: github.ref == 'refs/heads/main' uses: up9cloud/action-rsync@v1.4 env: HOST: ${{ secrets.WEBMASTER_SSH_HOST }} From 3c73b68ba38c292c83164cca346400c66116967f Mon Sep 17 00:00:00 2001 From: Sam Freund Date: Sat, 12 Apr 2025 17:33:37 -0500 Subject: [PATCH 08/49] Update index.md --- photon-lib/py/docs/index.md | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/photon-lib/py/docs/index.md b/photon-lib/py/docs/index.md index 000ea3455f..619103f67d 100644 --- a/photon-lib/py/docs/index.md +++ b/photon-lib/py/docs/index.md @@ -1,17 +1,3 @@ -# Welcome to MkDocs +# PhotonLib Python Docs -For full documentation visit [mkdocs.org](https://www.mkdocs.org). - -## Commands - -* `mkdocs new [dir-name]` - Create a new project. -* `mkdocs serve` - Start the live-reloading docs server. -* `mkdocs build` - Build the documentation site. -* `mkdocs -h` - Print help message and exit. - -## Project layout - - mkdocs.yml # The configuration file. - docs/ - index.md # The documentation homepage. - ... # Other markdown pages, images and other files. +For full documentation visit [docs.photonvision.org](https://docs.photonvision.org). From 55303ccd9cc54ccdfc3a6fe41ba6bc6fed46ca88 Mon Sep 17 00:00:00 2001 From: Sam Freund Date: Sat, 12 Apr 2025 17:33:57 -0500 Subject: [PATCH 09/49] Update index.md --- photon-lib/py/docs/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/photon-lib/py/docs/index.md b/photon-lib/py/docs/index.md index 619103f67d..06545b8e27 100644 --- a/photon-lib/py/docs/index.md +++ b/photon-lib/py/docs/index.md @@ -1,3 +1,3 @@ # PhotonLib Python Docs -For full documentation visit [docs.photonvision.org](https://docs.photonvision.org). +For the full PhotonVision documentation visit [docs.photonvision.org](https://docs.photonvision.org). From 34057f223d097b1e02c7f31460d67fbac427424d Mon Sep 17 00:00:00 2001 From: samfreund Date: Sat, 12 Apr 2025 22:29:41 -0500 Subject: [PATCH 10/49] autogen files --- .gitignore | 3 +++ photon-lib/py/docs/SUMMARY.md | 32 +++++++++++++++++++++++ photon-lib/py/docs/estimatedRobotPose.md | 3 --- photon-lib/py/docs/packet.md | 3 --- photon-lib/py/docs/photonCamera.md | 3 --- photon-lib/py/docs/photonPoseEstimator.md | 3 --- photon-lib/py/gen_api_docs.py | 29 ++++++++++++++++++++ photon-lib/py/mkdocs.yml | 22 ++++++++++------ 8 files changed, 78 insertions(+), 20 deletions(-) create mode 100644 photon-lib/py/docs/SUMMARY.md delete mode 100644 photon-lib/py/docs/estimatedRobotPose.md delete mode 100644 photon-lib/py/docs/packet.md delete mode 100644 photon-lib/py/docs/photonCamera.md delete mode 100644 photon-lib/py/docs/photonPoseEstimator.md create mode 100644 photon-lib/py/gen_api_docs.py diff --git a/.gitignore b/.gitignore index eaa45f922f..1ac8577cdb 100644 --- a/.gitignore +++ b/.gitignore @@ -154,3 +154,6 @@ networktables.json website/node_modules website/dist + +photon-lib/py/site +photon-lib/py/docs/reference diff --git a/photon-lib/py/docs/SUMMARY.md b/photon-lib/py/docs/SUMMARY.md new file mode 100644 index 0000000000..101cd07c9a --- /dev/null +++ b/photon-lib/py/docs/SUMMARY.md @@ -0,0 +1,32 @@ +* [estimatedRobotPose](reference/estimatedRobotPose.md) +* estimation + * [cameraTargetRelation](reference/estimation/cameraTargetRelation.md) + * [openCVHelp](reference/estimation/openCVHelp.md) + * [rotTrlTransform3d](reference/estimation/rotTrlTransform3d.md) + * [targetModel](reference/estimation/targetModel.md) + * [visionEstimation](reference/estimation/visionEstimation.md) +* generated + * [MultiTargetPNPResultSerde](reference/generated/MultiTargetPNPResultSerde.md) + * [PhotonPipelineMetadataSerde](reference/generated/PhotonPipelineMetadataSerde.md) + * [PhotonPipelineResultSerde](reference/generated/PhotonPipelineResultSerde.md) + * [PhotonTrackedTargetSerde](reference/generated/PhotonTrackedTargetSerde.md) + * [PnpResultSerde](reference/generated/PnpResultSerde.md) + * [TargetCornerSerde](reference/generated/TargetCornerSerde.md) +* networktables + * [NTTopicSet](reference/networktables/NTTopicSet.md) +* [packet](reference/packet.md) +* [photonCamera](reference/photonCamera.md) +* [photonPoseEstimator](reference/photonPoseEstimator.md) +* simulation + * [photonCameraSim](reference/simulation/photonCameraSim.md) + * [simCameraProperties](reference/simulation/simCameraProperties.md) + * [videoSimUtil](reference/simulation/videoSimUtil.md) + * [visionSystemSim](reference/simulation/visionSystemSim.md) + * [visionTargetSim](reference/simulation/visionTargetSim.md) +* targeting + * [TargetCorner](reference/targeting/TargetCorner.md) + * [multiTargetPNPResult](reference/targeting/multiTargetPNPResult.md) + * [photonPipelineResult](reference/targeting/photonPipelineResult.md) + * [photonTrackedTarget](reference/targeting/photonTrackedTarget.md) +* timesync + * [timeSyncServer](reference/timesync/timeSyncServer.md) diff --git a/photon-lib/py/docs/estimatedRobotPose.md b/photon-lib/py/docs/estimatedRobotPose.md deleted file mode 100644 index 506e8adf85..0000000000 --- a/photon-lib/py/docs/estimatedRobotPose.md +++ /dev/null @@ -1,3 +0,0 @@ -# EstimatedRobotPose API - -::: photonlibpy.estimatedRobotPose diff --git a/photon-lib/py/docs/packet.md b/photon-lib/py/docs/packet.md deleted file mode 100644 index 50602fc625..0000000000 --- a/photon-lib/py/docs/packet.md +++ /dev/null @@ -1,3 +0,0 @@ -# Packet API - -::: photonlibpy.packet diff --git a/photon-lib/py/docs/photonCamera.md b/photon-lib/py/docs/photonCamera.md deleted file mode 100644 index 2c1fcdd88f..0000000000 --- a/photon-lib/py/docs/photonCamera.md +++ /dev/null @@ -1,3 +0,0 @@ -# PhotonCamera API - -::: photonlibpy.photonCamera diff --git a/photon-lib/py/docs/photonPoseEstimator.md b/photon-lib/py/docs/photonPoseEstimator.md deleted file mode 100644 index 5075a84c02..0000000000 --- a/photon-lib/py/docs/photonPoseEstimator.md +++ /dev/null @@ -1,3 +0,0 @@ -# Photon Pose Estimator API - -::: photonlibpy.photonPoseEstimator diff --git a/photon-lib/py/gen_api_docs.py b/photon-lib/py/gen_api_docs.py new file mode 100644 index 0000000000..61b7517736 --- /dev/null +++ b/photon-lib/py/gen_api_docs.py @@ -0,0 +1,29 @@ +# gen_api_docs.py + +from pathlib import Path +import mkdocs_gen_files + +nav = mkdocs_gen_files.Nav() + +for path in sorted(Path("photonlibpy").rglob("*.py")): + if path.name == "py.typed": + continue + + module_path = path.with_suffix("").as_posix().replace("/", ".") + parts = tuple(path.relative_to("photonlibpy").with_suffix("").parts) + + if path.name == "__init__.py": + continue + else: + doc_path = Path("reference", *parts).with_suffix(".md") + + nav[parts] = doc_path.as_posix() + + with mkdocs_gen_files.open(doc_path, "w") as f: + f.write(f"# `{module_path}`\n\n::: {module_path}") + + mkdocs_gen_files.set_edit_path(doc_path, path) + +with mkdocs_gen_files.open("reference/SUMMARY.md", "w") as nav_file: + nav_file.writelines(nav.build_literate_nav()) + diff --git a/photon-lib/py/mkdocs.yml b/photon-lib/py/mkdocs.yml index 80626c158d..e31618aff2 100644 --- a/photon-lib/py/mkdocs.yml +++ b/photon-lib/py/mkdocs.yml @@ -1,18 +1,24 @@ -site_name: PhotonVision Python API Docs - +site_name: PhotonLibPy Docs theme: name: material + favicon: images/favicon.ico # If you want a favicon + logo: images/logo.png # Optional logo plugins: - search - mkdocstrings: - default_handler: python + handlers: + python: + paths: ["."] + setup_commands: + - import sys; sys.path.append(".") + - gen-files: + scripts: + - gen_api_docs.py + - literate-nav + - section-index nav: - Home: index.md - - API Reference: - - PhotonCamera: photonCamera.md - - EstimatedRobotPose: estimatedRobotPose.md - - Packet: packet.md - - PhotonPoseEstimator: photonPoseEstimator.md + - Reference: reference/SUMMARY.md From ddacff7079b4be292c244cda234d6309d699c438 Mon Sep 17 00:00:00 2001 From: Sam Freund Date: Sat, 12 Apr 2025 22:32:18 -0500 Subject: [PATCH 11/49] Update photon-api-docs.yml --- .github/workflows/photon-api-docs.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/photon-api-docs.yml b/.github/workflows/photon-api-docs.yml index 0db159882e..b5978bb0db 100644 --- a/.github/workflows/photon-api-docs.yml +++ b/.github/workflows/photon-api-docs.yml @@ -77,15 +77,15 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: '3.11' + python-version: '3.10' - name: Install dependencies run: | python -m pip install --upgrade pip - pip install mkdocs mkdocs-material mkdocstrings[python] + pip install mkdocs mkdocs-material mkdocstrings[python] mkdocs-gen-files mkdocs-literate-nav mkdocs-section-index - name: Build MkDocs site - run: mkdocs build --clean + run: mkdocs build working-directory: photon-lib/py - name: Upload built site as artifact From 05309b1e259514dec98278feba52064243f7d47e Mon Sep 17 00:00:00 2001 From: Sam Freund Date: Sat, 12 Apr 2025 22:35:20 -0500 Subject: [PATCH 12/49] Update mkdocs.yml --- photon-lib/py/mkdocs.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/photon-lib/py/mkdocs.yml b/photon-lib/py/mkdocs.yml index e31618aff2..45ff0e0ad7 100644 --- a/photon-lib/py/mkdocs.yml +++ b/photon-lib/py/mkdocs.yml @@ -9,9 +9,8 @@ plugins: - mkdocstrings: handlers: python: - paths: ["."] - setup_commands: - - import sys; sys.path.append(".") + paths: + - "." - gen-files: scripts: - gen_api_docs.py From abc67bdd959d8173f8a50dd4d2603da2dfc0b32e Mon Sep 17 00:00:00 2001 From: samfreund Date: Sat, 12 Apr 2025 22:37:18 -0500 Subject: [PATCH 13/49] add logo --- photon-lib/py/docs/logo.svg | 23 +++++++++++++++++++++++ photon-lib/py/mkdocs.yml | 4 ++-- 2 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 photon-lib/py/docs/logo.svg diff --git a/photon-lib/py/docs/logo.svg b/photon-lib/py/docs/logo.svg new file mode 100644 index 0000000000..88643de263 --- /dev/null +++ b/photon-lib/py/docs/logo.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/photon-lib/py/mkdocs.yml b/photon-lib/py/mkdocs.yml index 45ff0e0ad7..dcd081c3d1 100644 --- a/photon-lib/py/mkdocs.yml +++ b/photon-lib/py/mkdocs.yml @@ -1,8 +1,8 @@ site_name: PhotonLibPy Docs theme: name: material - favicon: images/favicon.ico # If you want a favicon - logo: images/logo.png # Optional logo + favicon: docs/favicon.ico # If you want a favicon + logo: docs/logo.png # Optional logo plugins: - search From 88a1e789ad8bd5c4365721fd18153af08cf778f4 Mon Sep 17 00:00:00 2001 From: samfreund Date: Sat, 12 Apr 2025 22:41:36 -0500 Subject: [PATCH 14/49] actually add the logo --- photon-lib/py/mkdocs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/photon-lib/py/mkdocs.yml b/photon-lib/py/mkdocs.yml index dcd081c3d1..d86e2c07a4 100644 --- a/photon-lib/py/mkdocs.yml +++ b/photon-lib/py/mkdocs.yml @@ -2,7 +2,7 @@ site_name: PhotonLibPy Docs theme: name: material favicon: docs/favicon.ico # If you want a favicon - logo: docs/logo.png # Optional logo + logo: logo.svg # Optional logo plugins: - search From 77d5388a350125791ae19d57a4d93307ed6d401c Mon Sep 17 00:00:00 2001 From: Sam Freund Date: Sat, 12 Apr 2025 22:46:27 -0500 Subject: [PATCH 15/49] Update photon-api-docs.yml --- .github/workflows/photon-api-docs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/photon-api-docs.yml b/.github/workflows/photon-api-docs.yml index b5978bb0db..1a888260af 100644 --- a/.github/workflows/photon-api-docs.yml +++ b/.github/workflows/photon-api-docs.yml @@ -3,7 +3,7 @@ name: Photon API Documentation on: # Run on pushes to main and pushed tags, and on pull requests against main, but ignore the docs folder push: - branches: [ main, py-docs ] + branches: [ main ] tags: - 'v*' pull_request: @@ -105,7 +105,7 @@ jobs: pattern: docs-* - run: find . - name: Publish Docs To Development - # if: github.ref == 'refs/heads/main' + if: github.ref == 'refs/heads/main' uses: up9cloud/action-rsync@v1.4 env: HOST: ${{ secrets.WEBMASTER_SSH_HOST }} From e334d2645953facb3cebb24b0cc78943dac3449f Mon Sep 17 00:00:00 2001 From: Sam Freund Date: Sat, 12 Apr 2025 22:53:16 -0500 Subject: [PATCH 16/49] Update python.yml --- .github/workflows/python.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index ddb5bf4d38..c56eb96fda 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -34,7 +34,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install setuptools wheel pytest mypy + pip install setuptools wheel pytest mypy mkdocs mkdocs-gen-files - name: Build wheel working-directory: ./photon-lib/py From 358f5747ab49389c262c70b3004c2c07edcde54b Mon Sep 17 00:00:00 2001 From: samfreund Date: Sat, 12 Apr 2025 22:54:50 -0500 Subject: [PATCH 17/49] man I hate linting --- photon-lib/py/gen_api_docs.py | 2 +- photon-lib/py/mkdocs.yml | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/photon-lib/py/gen_api_docs.py b/photon-lib/py/gen_api_docs.py index 61b7517736..4bba82f008 100644 --- a/photon-lib/py/gen_api_docs.py +++ b/photon-lib/py/gen_api_docs.py @@ -1,6 +1,7 @@ # gen_api_docs.py from pathlib import Path + import mkdocs_gen_files nav = mkdocs_gen_files.Nav() @@ -26,4 +27,3 @@ with mkdocs_gen_files.open("reference/SUMMARY.md", "w") as nav_file: nav_file.writelines(nav.build_literate_nav()) - diff --git a/photon-lib/py/mkdocs.yml b/photon-lib/py/mkdocs.yml index d86e2c07a4..65ce7e39d9 100644 --- a/photon-lib/py/mkdocs.yml +++ b/photon-lib/py/mkdocs.yml @@ -9,7 +9,7 @@ plugins: - mkdocstrings: handlers: python: - paths: + paths: - "." - gen-files: scripts: @@ -20,4 +20,3 @@ plugins: nav: - Home: index.md - Reference: reference/SUMMARY.md - From eb85834180416d012ac8e4fdebe1c2ddcc6c6728 Mon Sep 17 00:00:00 2001 From: samfreund Date: Sun, 13 Apr 2025 08:09:17 -0500 Subject: [PATCH 18/49] add brand color --- photon-lib/py/docs/stylesheets/extra.css | 3 +++ photon-lib/py/mkdocs.yml | 5 +++++ 2 files changed, 8 insertions(+) create mode 100644 photon-lib/py/docs/stylesheets/extra.css diff --git a/photon-lib/py/docs/stylesheets/extra.css b/photon-lib/py/docs/stylesheets/extra.css new file mode 100644 index 0000000000..30bbccf687 --- /dev/null +++ b/photon-lib/py/docs/stylesheets/extra.css @@ -0,0 +1,3 @@ +:root > * { + --md-primary-fg-color: #3498DB; +} diff --git a/photon-lib/py/mkdocs.yml b/photon-lib/py/mkdocs.yml index 65ce7e39d9..f5cd4f1e1c 100644 --- a/photon-lib/py/mkdocs.yml +++ b/photon-lib/py/mkdocs.yml @@ -3,6 +3,8 @@ theme: name: material favicon: docs/favicon.ico # If you want a favicon logo: logo.svg # Optional logo + palette: + primary: custom plugins: - search @@ -20,3 +22,6 @@ plugins: nav: - Home: index.md - Reference: reference/SUMMARY.md + +extra_css: + - stylesheets/extra.css From d1761d07e95596ac284a34c209b83e419acf53b6 Mon Sep 17 00:00:00 2001 From: samfreund Date: Sun, 13 Apr 2025 10:22:10 -0500 Subject: [PATCH 19/49] update to exclude packet.py --- .github/workflows/photon-api-docs.yml | 4 ++-- photon-lib/py/docs/SUMMARY.md | 1 - photon-lib/py/mkdocs.yml | 3 +++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/photon-api-docs.yml b/.github/workflows/photon-api-docs.yml index 1a888260af..3360f93b33 100644 --- a/.github/workflows/photon-api-docs.yml +++ b/.github/workflows/photon-api-docs.yml @@ -82,7 +82,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install mkdocs mkdocs-material mkdocstrings[python] mkdocs-gen-files mkdocs-literate-nav mkdocs-section-index + pip install mkdocs mkdocs-material mkdocstrings[python] mkdocs-gen-files mkdocs-literate-nav mkdocs-section-index mkdocs-exclude - name: Build MkDocs site run: mkdocs build @@ -105,7 +105,7 @@ jobs: pattern: docs-* - run: find . - name: Publish Docs To Development - if: github.ref == 'refs/heads/main' + # if: github.ref == 'refs/heads/main' uses: up9cloud/action-rsync@v1.4 env: HOST: ${{ secrets.WEBMASTER_SSH_HOST }} diff --git a/photon-lib/py/docs/SUMMARY.md b/photon-lib/py/docs/SUMMARY.md index 101cd07c9a..09d9d83aac 100644 --- a/photon-lib/py/docs/SUMMARY.md +++ b/photon-lib/py/docs/SUMMARY.md @@ -14,7 +14,6 @@ * [TargetCornerSerde](reference/generated/TargetCornerSerde.md) * networktables * [NTTopicSet](reference/networktables/NTTopicSet.md) -* [packet](reference/packet.md) * [photonCamera](reference/photonCamera.md) * [photonPoseEstimator](reference/photonPoseEstimator.md) * simulation diff --git a/photon-lib/py/mkdocs.yml b/photon-lib/py/mkdocs.yml index f5cd4f1e1c..b3396b79cb 100644 --- a/photon-lib/py/mkdocs.yml +++ b/photon-lib/py/mkdocs.yml @@ -18,6 +18,9 @@ plugins: - gen_api_docs.py - literate-nav - section-index + - exclude: + glob: + - "reference/packet.md" nav: - Home: index.md From 228caf47f21c17e2e934f623789cd63469d66eff Mon Sep 17 00:00:00 2001 From: Sam Freund Date: Sun, 13 Apr 2025 10:30:34 -0500 Subject: [PATCH 20/49] Update photon-api-docs.yml --- .github/workflows/photon-api-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/photon-api-docs.yml b/.github/workflows/photon-api-docs.yml index 3360f93b33..81d44865f1 100644 --- a/.github/workflows/photon-api-docs.yml +++ b/.github/workflows/photon-api-docs.yml @@ -113,7 +113,7 @@ jobs: KEY: ${{secrets.WEBMASTER_SSH_KEY}} TARGET: /var/www/html/photonvision-docs/development - name: Publish Docs To Release - if: startsWith(github.ref, 'refs/tags/v') + # if: startsWith(github.ref, 'refs/tags/v') uses: up9cloud/action-rsync@v1.4 env: HOST: ${{ secrets.WEBMASTER_SSH_HOST }} From 3cdda8a84e4f1a5aca95f0d5f0c920775cd81500 Mon Sep 17 00:00:00 2001 From: Sam Freund Date: Sun, 13 Apr 2025 10:38:44 -0500 Subject: [PATCH 21/49] Add instructions for excluding a file --- photon-lib/py/mkdocs.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/photon-lib/py/mkdocs.yml b/photon-lib/py/mkdocs.yml index b3396b79cb..a347e4f4c3 100644 --- a/photon-lib/py/mkdocs.yml +++ b/photon-lib/py/mkdocs.yml @@ -18,6 +18,9 @@ plugins: - gen_api_docs.py - literate-nav - section-index + # To exclude files, add them under glob using their + # path from photonlibpy prepended by reference/ + # Additionally, change the extension from .py to .md - exclude: glob: - "reference/packet.md" From e522642a483bbc303b60e25cfb6d7c92b6337a3e Mon Sep 17 00:00:00 2001 From: samfreund Date: Sun, 13 Apr 2025 10:43:40 -0500 Subject: [PATCH 22/49] linting --- photon-lib/py/mkdocs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/photon-lib/py/mkdocs.yml b/photon-lib/py/mkdocs.yml index a347e4f4c3..0f20cd8b8c 100644 --- a/photon-lib/py/mkdocs.yml +++ b/photon-lib/py/mkdocs.yml @@ -18,7 +18,7 @@ plugins: - gen_api_docs.py - literate-nav - section-index - # To exclude files, add them under glob using their + # To exclude files, add them under glob using their # path from photonlibpy prepended by reference/ # Additionally, change the extension from .py to .md - exclude: From 40815020de4d43ecf6b877180ca12c1c63e7382c Mon Sep 17 00:00:00 2001 From: Sam Freund Date: Sun, 13 Apr 2025 10:47:52 -0500 Subject: [PATCH 23/49] Update photon-api-docs.yml --- .github/workflows/photon-api-docs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/photon-api-docs.yml b/.github/workflows/photon-api-docs.yml index 81d44865f1..499fbcdec2 100644 --- a/.github/workflows/photon-api-docs.yml +++ b/.github/workflows/photon-api-docs.yml @@ -105,7 +105,7 @@ jobs: pattern: docs-* - run: find . - name: Publish Docs To Development - # if: github.ref == 'refs/heads/main' + if: github.ref == 'refs/heads/main' uses: up9cloud/action-rsync@v1.4 env: HOST: ${{ secrets.WEBMASTER_SSH_HOST }} @@ -113,7 +113,7 @@ jobs: KEY: ${{secrets.WEBMASTER_SSH_KEY}} TARGET: /var/www/html/photonvision-docs/development - name: Publish Docs To Release - # if: startsWith(github.ref, 'refs/tags/v') + if: startsWith(github.ref, 'refs/tags/v') uses: up9cloud/action-rsync@v1.4 env: HOST: ${{ secrets.WEBMASTER_SSH_HOST }} From 3547d0584bc84e27033904ceb1e59aaf97731b6b Mon Sep 17 00:00:00 2001 From: samfreund Date: Sun, 13 Apr 2025 10:51:39 -0500 Subject: [PATCH 24/49] exclude generated files --- photon-lib/py/docs/SUMMARY.md | 7 ------- photon-lib/py/mkdocs.yml | 1 + 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/photon-lib/py/docs/SUMMARY.md b/photon-lib/py/docs/SUMMARY.md index 09d9d83aac..cd684b0583 100644 --- a/photon-lib/py/docs/SUMMARY.md +++ b/photon-lib/py/docs/SUMMARY.md @@ -5,13 +5,6 @@ * [rotTrlTransform3d](reference/estimation/rotTrlTransform3d.md) * [targetModel](reference/estimation/targetModel.md) * [visionEstimation](reference/estimation/visionEstimation.md) -* generated - * [MultiTargetPNPResultSerde](reference/generated/MultiTargetPNPResultSerde.md) - * [PhotonPipelineMetadataSerde](reference/generated/PhotonPipelineMetadataSerde.md) - * [PhotonPipelineResultSerde](reference/generated/PhotonPipelineResultSerde.md) - * [PhotonTrackedTargetSerde](reference/generated/PhotonTrackedTargetSerde.md) - * [PnpResultSerde](reference/generated/PnpResultSerde.md) - * [TargetCornerSerde](reference/generated/TargetCornerSerde.md) * networktables * [NTTopicSet](reference/networktables/NTTopicSet.md) * [photonCamera](reference/photonCamera.md) diff --git a/photon-lib/py/mkdocs.yml b/photon-lib/py/mkdocs.yml index 0f20cd8b8c..aac628470e 100644 --- a/photon-lib/py/mkdocs.yml +++ b/photon-lib/py/mkdocs.yml @@ -24,6 +24,7 @@ plugins: - exclude: glob: - "reference/packet.md" + - "reference/generated/*" nav: - Home: index.md From aacbdf5010f5d46ddcdeabda8ee2677838fa2f96 Mon Sep 17 00:00:00 2001 From: Sam Freund Date: Sun, 13 Apr 2025 10:53:34 -0500 Subject: [PATCH 25/49] Update index.md --- docs/source/index.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/source/index.md b/docs/source/index.md index 8917825487..09e16472d5 100644 --- a/docs/source/index.md +++ b/docs/source/index.md @@ -135,5 +135,7 @@ docs/contributing/index Java - C++ + C++ + + Python ``` From a5b1cc0ded649c92164a58f2ec6937c46476fcc6 Mon Sep 17 00:00:00 2001 From: Sam Freund Date: Sun, 13 Apr 2025 14:48:39 -0500 Subject: [PATCH 26/49] Update photon-api-docs.yml --- .github/workflows/photon-api-docs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/photon-api-docs.yml b/.github/workflows/photon-api-docs.yml index 499fbcdec2..81d44865f1 100644 --- a/.github/workflows/photon-api-docs.yml +++ b/.github/workflows/photon-api-docs.yml @@ -105,7 +105,7 @@ jobs: pattern: docs-* - run: find . - name: Publish Docs To Development - if: github.ref == 'refs/heads/main' + # if: github.ref == 'refs/heads/main' uses: up9cloud/action-rsync@v1.4 env: HOST: ${{ secrets.WEBMASTER_SSH_HOST }} @@ -113,7 +113,7 @@ jobs: KEY: ${{secrets.WEBMASTER_SSH_KEY}} TARGET: /var/www/html/photonvision-docs/development - name: Publish Docs To Release - if: startsWith(github.ref, 'refs/tags/v') + # if: startsWith(github.ref, 'refs/tags/v') uses: up9cloud/action-rsync@v1.4 env: HOST: ${{ secrets.WEBMASTER_SSH_HOST }} From ffdda9ddfa7be953fbe8f1b4d59f5b960e35843b Mon Sep 17 00:00:00 2001 From: Sam Freund Date: Sun, 13 Apr 2025 14:57:00 -0500 Subject: [PATCH 27/49] Update photon-api-docs.yml --- .github/workflows/photon-api-docs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/photon-api-docs.yml b/.github/workflows/photon-api-docs.yml index 81d44865f1..499fbcdec2 100644 --- a/.github/workflows/photon-api-docs.yml +++ b/.github/workflows/photon-api-docs.yml @@ -105,7 +105,7 @@ jobs: pattern: docs-* - run: find . - name: Publish Docs To Development - # if: github.ref == 'refs/heads/main' + if: github.ref == 'refs/heads/main' uses: up9cloud/action-rsync@v1.4 env: HOST: ${{ secrets.WEBMASTER_SSH_HOST }} @@ -113,7 +113,7 @@ jobs: KEY: ${{secrets.WEBMASTER_SSH_KEY}} TARGET: /var/www/html/photonvision-docs/development - name: Publish Docs To Release - # if: startsWith(github.ref, 'refs/tags/v') + if: startsWith(github.ref, 'refs/tags/v') uses: up9cloud/action-rsync@v1.4 env: HOST: ${{ secrets.WEBMASTER_SSH_HOST }} From 44b46cf11751706d7ebd40adbdb275092253d6f2 Mon Sep 17 00:00:00 2001 From: samfreund Date: Sun, 13 Apr 2025 23:29:32 -0500 Subject: [PATCH 28/49] yeah that's good enough --- photon-lib/py/mkdocs.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/photon-lib/py/mkdocs.yml b/photon-lib/py/mkdocs.yml index aac628470e..23e84301b3 100644 --- a/photon-lib/py/mkdocs.yml +++ b/photon-lib/py/mkdocs.yml @@ -1,13 +1,13 @@ site_name: PhotonLibPy Docs theme: - name: material + name: readthedocs favicon: docs/favicon.ico # If you want a favicon logo: logo.svg # Optional logo palette: primary: custom plugins: - - search + - search: - mkdocstrings: handlers: python: @@ -32,3 +32,6 @@ nav: extra_css: - stylesheets/extra.css + +extra_javascript: + - js/exclude-details.js From 0bec1f239c7e3a08f136c666aba966a6711ff164 Mon Sep 17 00:00:00 2001 From: Sam Freund Date: Sun, 13 Apr 2025 23:31:09 -0500 Subject: [PATCH 29/49] Update photon-api-docs.yml --- .github/workflows/photon-api-docs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/photon-api-docs.yml b/.github/workflows/photon-api-docs.yml index 499fbcdec2..81d44865f1 100644 --- a/.github/workflows/photon-api-docs.yml +++ b/.github/workflows/photon-api-docs.yml @@ -105,7 +105,7 @@ jobs: pattern: docs-* - run: find . - name: Publish Docs To Development - if: github.ref == 'refs/heads/main' + # if: github.ref == 'refs/heads/main' uses: up9cloud/action-rsync@v1.4 env: HOST: ${{ secrets.WEBMASTER_SSH_HOST }} @@ -113,7 +113,7 @@ jobs: KEY: ${{secrets.WEBMASTER_SSH_KEY}} TARGET: /var/www/html/photonvision-docs/development - name: Publish Docs To Release - if: startsWith(github.ref, 'refs/tags/v') + # if: startsWith(github.ref, 'refs/tags/v') uses: up9cloud/action-rsync@v1.4 env: HOST: ${{ secrets.WEBMASTER_SSH_HOST }} From 0147a4410020d046b4c62c15ccdaf0cb9281dce5 Mon Sep 17 00:00:00 2001 From: samfreund Date: Mon, 14 Apr 2025 00:36:02 -0500 Subject: [PATCH 30/49] remove source --- photon-lib/py/mkdocs.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/photon-lib/py/mkdocs.yml b/photon-lib/py/mkdocs.yml index 23e84301b3..d877b4a9bb 100644 --- a/photon-lib/py/mkdocs.yml +++ b/photon-lib/py/mkdocs.yml @@ -1,6 +1,6 @@ site_name: PhotonLibPy Docs theme: - name: readthedocs + name: material favicon: docs/favicon.ico # If you want a favicon logo: logo.svg # Optional logo palette: @@ -11,6 +11,8 @@ plugins: - mkdocstrings: handlers: python: + options: + show_source: false paths: - "." - gen-files: From abcd6b8f50ad94cbb1809dd38044f7f0508e644d Mon Sep 17 00:00:00 2001 From: samfreund Date: Thu, 8 May 2025 17:30:16 -0500 Subject: [PATCH 31/49] add docs to readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 060010aed2..843639a5a3 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ If you are interested in contributing code or documentation to the project, plea - Photon UI demo: [http://photonvision.global/](http://photonvision.global/) (or [manual link](https://photonvision.github.io/photonvision/built-client/)) - Javadocs: [javadocs.photonvision.org](https://javadocs.photonvision.org) (or [manual link](https://photonvision.github.io/photonvision/built-docs/javadoc/)) - C++ Doxygen [cppdocs.photonvision.org](https://cppdocs.photonvision.org) (or [manual link](https://photonvision.github.io/photonvision/built-docs/doxygen/html/)) - +- Python Documentation [pydocs.photonvision.org](https://pydocs.photonvision.org) ## Building Gradle is used for all C++ and Java code, and NPM is used for the web UI. Instructions to compile PhotonVision yourself can be found [in our docs](https://docs.photonvision.org/en/latest/docs/contributing/building-photon.html#compiling-instructions). From 697e52f886552922cb53591ed9a99256272af945 Mon Sep 17 00:00:00 2001 From: samfreund Date: Thu, 8 May 2025 18:30:42 -0500 Subject: [PATCH 32/49] lint --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 843639a5a3..977d8a3340 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ If you are interested in contributing code or documentation to the project, plea - Photon UI demo: [http://photonvision.global/](http://photonvision.global/) (or [manual link](https://photonvision.github.io/photonvision/built-client/)) - Javadocs: [javadocs.photonvision.org](https://javadocs.photonvision.org) (or [manual link](https://photonvision.github.io/photonvision/built-docs/javadoc/)) - C++ Doxygen [cppdocs.photonvision.org](https://cppdocs.photonvision.org) (or [manual link](https://photonvision.github.io/photonvision/built-docs/doxygen/html/)) -- Python Documentation [pydocs.photonvision.org](https://pydocs.photonvision.org) +- Python Documentation [pydocs.photonvision.org](https://pydocs.photonvision.org) ## Building Gradle is used for all C++ and Java code, and NPM is used for the web UI. Instructions to compile PhotonVision yourself can be found [in our docs](https://docs.photonvision.org/en/latest/docs/contributing/building-photon.html#compiling-instructions). From c2581f3e9942c6a1e019b13ce5a6a7fb927654e1 Mon Sep 17 00:00:00 2001 From: Sam Freund Date: Thu, 8 May 2025 18:34:20 -0500 Subject: [PATCH 33/49] limit publishing --- .github/workflows/photon-api-docs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/photon-api-docs.yml b/.github/workflows/photon-api-docs.yml index 553cca3588..48d2c85a03 100644 --- a/.github/workflows/photon-api-docs.yml +++ b/.github/workflows/photon-api-docs.yml @@ -105,7 +105,7 @@ jobs: pattern: docs-* - run: find . - name: Publish Docs To Development - # if: github.ref == 'refs/heads/main' + if: github.ref == 'refs/heads/main' uses: up9cloud/action-rsync@v1.4 env: HOST: ${{ secrets.WEBMASTER_SSH_HOST }} @@ -113,7 +113,7 @@ jobs: KEY: ${{secrets.WEBMASTER_SSH_KEY}} TARGET: /var/www/html/photonvision-docs/development - name: Publish Docs To Release - # if: startsWith(github.ref, 'refs/tags/v') + if: startsWith(github.ref, 'refs/tags/v') uses: up9cloud/action-rsync@v1.4 env: HOST: ${{ secrets.WEBMASTER_SSH_HOST }} From fa8b60fe27659fef85da54a9c51c8540747ed2ad Mon Sep 17 00:00:00 2001 From: samfreund Date: Thu, 8 May 2025 23:33:00 -0500 Subject: [PATCH 34/49] convert to requirements.txt --- .github/workflows/photon-api-docs.yml | 2 +- photon-lib/py/docs/requirements.txt | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 photon-lib/py/docs/requirements.txt diff --git a/.github/workflows/photon-api-docs.yml b/.github/workflows/photon-api-docs.yml index 48d2c85a03..89e2d8953a 100644 --- a/.github/workflows/photon-api-docs.yml +++ b/.github/workflows/photon-api-docs.yml @@ -82,7 +82,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install mkdocs mkdocs-material mkdocstrings[python] mkdocs-gen-files mkdocs-literate-nav mkdocs-section-index mkdocs-exclude + pip install -r photon-lib/py/docs/requirements.txt - name: Build MkDocs site run: mkdocs build diff --git a/photon-lib/py/docs/requirements.txt b/photon-lib/py/docs/requirements.txt new file mode 100644 index 0000000000..7f95f31315 --- /dev/null +++ b/photon-lib/py/docs/requirements.txt @@ -0,0 +1,7 @@ +mkdocs==1.4.0 +mkdocs-material==9.0.0 +mkdocstrings[python]==0.19.0 +mkdocs-gen-files==0.5.0 +mkdocs-literate-nav==0.5.0 +mkdocs-section-index==0.3.5 +mkdocs-exclude==1.0.2 From 416e2f7607b021f2c0992ac7675b328137467b91 Mon Sep 17 00:00:00 2001 From: samfreund Date: Thu, 8 May 2025 23:36:23 -0500 Subject: [PATCH 35/49] update versions --- photon-lib/py/docs/requirements.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/photon-lib/py/docs/requirements.txt b/photon-lib/py/docs/requirements.txt index 7f95f31315..6280a794a3 100644 --- a/photon-lib/py/docs/requirements.txt +++ b/photon-lib/py/docs/requirements.txt @@ -1,7 +1,7 @@ -mkdocs==1.4.0 -mkdocs-material==9.0.0 -mkdocstrings[python]==0.19.0 +mkdocs==1.6.1 +mkdocs-material==9.6.12 +mkdocstrings[python]==0.29.1 mkdocs-gen-files==0.5.0 -mkdocs-literate-nav==0.5.0 -mkdocs-section-index==0.3.5 +mkdocs-literate-nav==0.6.2 +mkdocs-section-index==0.3.10 mkdocs-exclude==1.0.2 From 476cd6df8b7f220eaf4d7ebae48c3394bbde93f5 Mon Sep 17 00:00:00 2001 From: Sam Freund Date: Fri, 9 May 2025 10:17:00 -0500 Subject: [PATCH 36/49] Update photon-api-docs.yml --- .github/workflows/photon-api-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/photon-api-docs.yml b/.github/workflows/photon-api-docs.yml index 89e2d8953a..8f27bccfe0 100644 --- a/.github/workflows/photon-api-docs.yml +++ b/.github/workflows/photon-api-docs.yml @@ -105,7 +105,7 @@ jobs: pattern: docs-* - run: find . - name: Publish Docs To Development - if: github.ref == 'refs/heads/main' + # if: github.ref == 'refs/heads/main' uses: up9cloud/action-rsync@v1.4 env: HOST: ${{ secrets.WEBMASTER_SSH_HOST }} From 8fb29ff5c40f1dc65e551db07cf5bf901881862b Mon Sep 17 00:00:00 2001 From: Sam Freund Date: Fri, 9 May 2025 10:17:45 -0500 Subject: [PATCH 37/49] Update photon-api-docs.yml --- .github/workflows/photon-api-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/photon-api-docs.yml b/.github/workflows/photon-api-docs.yml index 8f27bccfe0..8703cf8a3a 100644 --- a/.github/workflows/photon-api-docs.yml +++ b/.github/workflows/photon-api-docs.yml @@ -111,7 +111,7 @@ jobs: HOST: ${{ secrets.WEBMASTER_SSH_HOST }} USER: ${{ secrets.WEBMASTER_SSH_USERNAME }} KEY: ${{secrets.WEBMASTER_SSH_KEY}} - TARGET: /var/www/html/photonvision-docs/development + TARGET: /var/www/html/photonvision-docs/development/ - name: Publish Docs To Release if: startsWith(github.ref, 'refs/tags/v') uses: up9cloud/action-rsync@v1.4 From dc0985dfb568f9c955fe7106c1c19551061ff0cf Mon Sep 17 00:00:00 2001 From: samfreund Date: Fri, 9 May 2025 11:01:05 -0500 Subject: [PATCH 38/49] fix docstrings style --- photon-lib/py/mkdocs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/photon-lib/py/mkdocs.yml b/photon-lib/py/mkdocs.yml index d877b4a9bb..7e57fa0d3a 100644 --- a/photon-lib/py/mkdocs.yml +++ b/photon-lib/py/mkdocs.yml @@ -13,6 +13,7 @@ plugins: python: options: show_source: false + docstring_style: sphinx paths: - "." - gen-files: From 50adef1672de99fd2fcb34d71b799ecbbb25f1dd Mon Sep 17 00:00:00 2001 From: Sam Freund Date: Fri, 9 May 2025 11:04:26 -0500 Subject: [PATCH 39/49] publish release docs --- .github/workflows/photon-api-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/photon-api-docs.yml b/.github/workflows/photon-api-docs.yml index 8703cf8a3a..49007785ec 100644 --- a/.github/workflows/photon-api-docs.yml +++ b/.github/workflows/photon-api-docs.yml @@ -113,7 +113,7 @@ jobs: KEY: ${{secrets.WEBMASTER_SSH_KEY}} TARGET: /var/www/html/photonvision-docs/development/ - name: Publish Docs To Release - if: startsWith(github.ref, 'refs/tags/v') + # if: startsWith(github.ref, 'refs/tags/v') uses: up9cloud/action-rsync@v1.4 env: HOST: ${{ secrets.WEBMASTER_SSH_HOST }} From abb8ccf4e988b239e589804c79de91b22c79bf80 Mon Sep 17 00:00:00 2001 From: Sam Freund Date: Fri, 9 May 2025 11:06:18 -0500 Subject: [PATCH 40/49] add conditionals for publishing --- .github/workflows/photon-api-docs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/photon-api-docs.yml b/.github/workflows/photon-api-docs.yml index 49007785ec..f93d5b6e5c 100644 --- a/.github/workflows/photon-api-docs.yml +++ b/.github/workflows/photon-api-docs.yml @@ -105,7 +105,7 @@ jobs: pattern: docs-* - run: find . - name: Publish Docs To Development - # if: github.ref == 'refs/heads/main' + if: github.ref == 'refs/heads/main' uses: up9cloud/action-rsync@v1.4 env: HOST: ${{ secrets.WEBMASTER_SSH_HOST }} @@ -113,7 +113,7 @@ jobs: KEY: ${{secrets.WEBMASTER_SSH_KEY}} TARGET: /var/www/html/photonvision-docs/development/ - name: Publish Docs To Release - # if: startsWith(github.ref, 'refs/tags/v') + if: startsWith(github.ref, 'refs/tags/v') uses: up9cloud/action-rsync@v1.4 env: HOST: ${{ secrets.WEBMASTER_SSH_HOST }} From 26f08a6fdf03c8621135cd9f5470ab6a596c790c Mon Sep 17 00:00:00 2001 From: samfreund Date: Fri, 9 May 2025 12:26:44 -0500 Subject: [PATCH 41/49] switch to sphinx --- .github/workflows/photon-api-docs.yml | 10 +-- .gitignore | 3 +- photon-lib/py/docs/Makefile | 20 ++++++ photon-lib/py/docs/SUMMARY.md | 24 -------- photon-lib/py/docs/index.md | 3 - photon-lib/py/docs/logo.svg | 23 ------- photon-lib/py/docs/make.bat | 35 +++++++++++ photon-lib/py/docs/requirements.txt | 11 ++-- photon-lib/py/docs/source/conf.py | 35 +++++++++++ photon-lib/py/docs/source/index.rst | 16 +++++ photon-lib/py/docs/source/modules.rst | 7 +++ .../py/docs/source/photonlibpy.estimation.rst | 53 ++++++++++++++++ .../py/docs/source/photonlibpy.generated.rst | 61 +++++++++++++++++++ .../docs/source/photonlibpy.networktables.rst | 21 +++++++ photon-lib/py/docs/source/photonlibpy.rst | 58 ++++++++++++++++++ .../py/docs/source/photonlibpy.simulation.rst | 53 ++++++++++++++++ .../py/docs/source/photonlibpy.targeting.rst | 45 ++++++++++++++ .../py/docs/source/photonlibpy.timesync.rst | 21 +++++++ photon-lib/py/docs/stylesheets/extra.css | 3 - photon-lib/py/gen_api_docs.py | 29 --------- photon-lib/py/mkdocs.yml | 40 ------------ 21 files changed, 436 insertions(+), 135 deletions(-) create mode 100644 photon-lib/py/docs/Makefile delete mode 100644 photon-lib/py/docs/SUMMARY.md delete mode 100644 photon-lib/py/docs/index.md delete mode 100644 photon-lib/py/docs/logo.svg create mode 100644 photon-lib/py/docs/make.bat create mode 100644 photon-lib/py/docs/source/conf.py create mode 100644 photon-lib/py/docs/source/index.rst create mode 100644 photon-lib/py/docs/source/modules.rst create mode 100644 photon-lib/py/docs/source/photonlibpy.estimation.rst create mode 100644 photon-lib/py/docs/source/photonlibpy.generated.rst create mode 100644 photon-lib/py/docs/source/photonlibpy.networktables.rst create mode 100644 photon-lib/py/docs/source/photonlibpy.rst create mode 100644 photon-lib/py/docs/source/photonlibpy.simulation.rst create mode 100644 photon-lib/py/docs/source/photonlibpy.targeting.rst create mode 100644 photon-lib/py/docs/source/photonlibpy.timesync.rst delete mode 100644 photon-lib/py/docs/stylesheets/extra.css delete mode 100644 photon-lib/py/gen_api_docs.py delete mode 100644 photon-lib/py/mkdocs.yml diff --git a/.github/workflows/photon-api-docs.yml b/.github/workflows/photon-api-docs.yml index f93d5b6e5c..e61608f609 100644 --- a/.github/workflows/photon-api-docs.yml +++ b/.github/workflows/photon-api-docs.yml @@ -84,15 +84,17 @@ jobs: python -m pip install --upgrade pip pip install -r photon-lib/py/docs/requirements.txt - - name: Build MkDocs site - run: mkdocs build + - name: Build Sphinx site + run: | + sphinx-apidocs -o docs/source photonlibpy + make -C docs html working-directory: photon-lib/py - name: Upload built site as artifact uses: actions/upload-artifact@v4 with: name: docs-python - path: photon-lib/py/site/ + path: photon-lib/py/docs/build/html publish_api_docs: name: Publish API Docs @@ -105,7 +107,7 @@ jobs: pattern: docs-* - run: find . - name: Publish Docs To Development - if: github.ref == 'refs/heads/main' + # if: github.ref == 'refs/heads/main' uses: up9cloud/action-rsync@v1.4 env: HOST: ${{ secrets.WEBMASTER_SSH_HOST }} diff --git a/.gitignore b/.gitignore index 78aa69b113..920c550086 100644 --- a/.gitignore +++ b/.gitignore @@ -149,5 +149,4 @@ dist components.d.ts # Py docs stuff -photon-lib/py/site -photon-lib/py/docs/reference +photon-lib/py/docs/build diff --git a/photon-lib/py/docs/Makefile b/photon-lib/py/docs/Makefile new file mode 100644 index 0000000000..d0c3cbf102 --- /dev/null +++ b/photon-lib/py/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 = 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) diff --git a/photon-lib/py/docs/SUMMARY.md b/photon-lib/py/docs/SUMMARY.md deleted file mode 100644 index cd684b0583..0000000000 --- a/photon-lib/py/docs/SUMMARY.md +++ /dev/null @@ -1,24 +0,0 @@ -* [estimatedRobotPose](reference/estimatedRobotPose.md) -* estimation - * [cameraTargetRelation](reference/estimation/cameraTargetRelation.md) - * [openCVHelp](reference/estimation/openCVHelp.md) - * [rotTrlTransform3d](reference/estimation/rotTrlTransform3d.md) - * [targetModel](reference/estimation/targetModel.md) - * [visionEstimation](reference/estimation/visionEstimation.md) -* networktables - * [NTTopicSet](reference/networktables/NTTopicSet.md) -* [photonCamera](reference/photonCamera.md) -* [photonPoseEstimator](reference/photonPoseEstimator.md) -* simulation - * [photonCameraSim](reference/simulation/photonCameraSim.md) - * [simCameraProperties](reference/simulation/simCameraProperties.md) - * [videoSimUtil](reference/simulation/videoSimUtil.md) - * [visionSystemSim](reference/simulation/visionSystemSim.md) - * [visionTargetSim](reference/simulation/visionTargetSim.md) -* targeting - * [TargetCorner](reference/targeting/TargetCorner.md) - * [multiTargetPNPResult](reference/targeting/multiTargetPNPResult.md) - * [photonPipelineResult](reference/targeting/photonPipelineResult.md) - * [photonTrackedTarget](reference/targeting/photonTrackedTarget.md) -* timesync - * [timeSyncServer](reference/timesync/timeSyncServer.md) diff --git a/photon-lib/py/docs/index.md b/photon-lib/py/docs/index.md deleted file mode 100644 index 06545b8e27..0000000000 --- a/photon-lib/py/docs/index.md +++ /dev/null @@ -1,3 +0,0 @@ -# PhotonLib Python Docs - -For the full PhotonVision documentation visit [docs.photonvision.org](https://docs.photonvision.org). diff --git a/photon-lib/py/docs/logo.svg b/photon-lib/py/docs/logo.svg deleted file mode 100644 index 88643de263..0000000000 --- a/photon-lib/py/docs/logo.svg +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/photon-lib/py/docs/make.bat b/photon-lib/py/docs/make.bat new file mode 100644 index 0000000000..dc1312ab09 --- /dev/null +++ b/photon-lib/py/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=source +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/photon-lib/py/docs/requirements.txt b/photon-lib/py/docs/requirements.txt index 6280a794a3..0a149a3033 100644 --- a/photon-lib/py/docs/requirements.txt +++ b/photon-lib/py/docs/requirements.txt @@ -1,7 +1,4 @@ -mkdocs==1.6.1 -mkdocs-material==9.6.12 -mkdocstrings[python]==0.29.1 -mkdocs-gen-files==0.5.0 -mkdocs-literate-nav==0.6.2 -mkdocs-section-index==0.3.10 -mkdocs-exclude==1.0.2 +sphinx==7.2.6 +sphinx-autodoc-typehints==1.25.2 +sphinx-rtd-theme==1.3.0 +sphinx-apidoc==1.0.0 diff --git a/photon-lib/py/docs/source/conf.py b/photon-lib/py/docs/source/conf.py new file mode 100644 index 0000000000..078ed31d02 --- /dev/null +++ b/photon-lib/py/docs/source/conf.py @@ -0,0 +1,35 @@ +# Configuration file for the Sphinx documentation builder. +# +# For the full list of built-in configuration values, see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Project information ----------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information + +project = "PhotonVision" +copyright = "2025, Matt Morley, Banks Troutman" +author = "Matt Morley, Banks Troutman" + +# -- General configuration --------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration + +extensions = [ + "sphinx.ext.autodoc", + "sphinx.ext.napoleon", # for Google/NumPy docstrings + "sphinx_autodoc_typehints", # for type hints in docs +] + +import os +import sys + +sys.path.insert(0, os.path.abspath("../..")) # adjust based on your project layout + +templates_path = ["_templates"] +exclude_patterns = [] + + +# -- Options for HTML output ------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output + +html_theme = "alabaster" +html_static_path = ["_static"] diff --git a/photon-lib/py/docs/source/index.rst b/photon-lib/py/docs/source/index.rst new file mode 100644 index 0000000000..78b78862c3 --- /dev/null +++ b/photon-lib/py/docs/source/index.rst @@ -0,0 +1,16 @@ +.. PhotonVision documentation master file, created by + sphinx-quickstart on Fri May 9 12:16:37 2025. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +PhotonVision documentation +========================== + +Add your content using ``reStructuredText`` syntax. See the +`reStructuredText `_ +documentation for details. + + +.. toctree:: + :maxdepth: 2 + :caption: Contents: diff --git a/photon-lib/py/docs/source/modules.rst b/photon-lib/py/docs/source/modules.rst new file mode 100644 index 0000000000..486e417877 --- /dev/null +++ b/photon-lib/py/docs/source/modules.rst @@ -0,0 +1,7 @@ +photonlibpy +=========== + +.. toctree:: + :maxdepth: 4 + + photonlibpy diff --git a/photon-lib/py/docs/source/photonlibpy.estimation.rst b/photon-lib/py/docs/source/photonlibpy.estimation.rst new file mode 100644 index 0000000000..05004e2f41 --- /dev/null +++ b/photon-lib/py/docs/source/photonlibpy.estimation.rst @@ -0,0 +1,53 @@ +photonlibpy.estimation package +============================== + +Submodules +---------- + +photonlibpy.estimation.cameraTargetRelation module +-------------------------------------------------- + +.. automodule:: photonlibpy.estimation.cameraTargetRelation + :members: + :undoc-members: + :show-inheritance: + +photonlibpy.estimation.openCVHelp module +---------------------------------------- + +.. automodule:: photonlibpy.estimation.openCVHelp + :members: + :undoc-members: + :show-inheritance: + +photonlibpy.estimation.rotTrlTransform3d module +----------------------------------------------- + +.. automodule:: photonlibpy.estimation.rotTrlTransform3d + :members: + :undoc-members: + :show-inheritance: + +photonlibpy.estimation.targetModel module +----------------------------------------- + +.. automodule:: photonlibpy.estimation.targetModel + :members: + :undoc-members: + :show-inheritance: + +photonlibpy.estimation.visionEstimation module +---------------------------------------------- + +.. automodule:: photonlibpy.estimation.visionEstimation + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: photonlibpy.estimation + :members: + :undoc-members: + :show-inheritance: diff --git a/photon-lib/py/docs/source/photonlibpy.generated.rst b/photon-lib/py/docs/source/photonlibpy.generated.rst new file mode 100644 index 0000000000..bc21eb9fab --- /dev/null +++ b/photon-lib/py/docs/source/photonlibpy.generated.rst @@ -0,0 +1,61 @@ +photonlibpy.generated package +============================= + +Submodules +---------- + +photonlibpy.generated.MultiTargetPNPResultSerde module +------------------------------------------------------ + +.. automodule:: photonlibpy.generated.MultiTargetPNPResultSerde + :members: + :undoc-members: + :show-inheritance: + +photonlibpy.generated.PhotonPipelineMetadataSerde module +-------------------------------------------------------- + +.. automodule:: photonlibpy.generated.PhotonPipelineMetadataSerde + :members: + :undoc-members: + :show-inheritance: + +photonlibpy.generated.PhotonPipelineResultSerde module +------------------------------------------------------ + +.. automodule:: photonlibpy.generated.PhotonPipelineResultSerde + :members: + :undoc-members: + :show-inheritance: + +photonlibpy.generated.PhotonTrackedTargetSerde module +----------------------------------------------------- + +.. automodule:: photonlibpy.generated.PhotonTrackedTargetSerde + :members: + :undoc-members: + :show-inheritance: + +photonlibpy.generated.PnpResultSerde module +------------------------------------------- + +.. automodule:: photonlibpy.generated.PnpResultSerde + :members: + :undoc-members: + :show-inheritance: + +photonlibpy.generated.TargetCornerSerde module +---------------------------------------------- + +.. automodule:: photonlibpy.generated.TargetCornerSerde + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: photonlibpy.generated + :members: + :undoc-members: + :show-inheritance: diff --git a/photon-lib/py/docs/source/photonlibpy.networktables.rst b/photon-lib/py/docs/source/photonlibpy.networktables.rst new file mode 100644 index 0000000000..88327af972 --- /dev/null +++ b/photon-lib/py/docs/source/photonlibpy.networktables.rst @@ -0,0 +1,21 @@ +photonlibpy.networktables package +================================= + +Submodules +---------- + +photonlibpy.networktables.NTTopicSet module +------------------------------------------- + +.. automodule:: photonlibpy.networktables.NTTopicSet + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: photonlibpy.networktables + :members: + :undoc-members: + :show-inheritance: diff --git a/photon-lib/py/docs/source/photonlibpy.rst b/photon-lib/py/docs/source/photonlibpy.rst new file mode 100644 index 0000000000..8d14d19830 --- /dev/null +++ b/photon-lib/py/docs/source/photonlibpy.rst @@ -0,0 +1,58 @@ +photonlibpy package +=================== + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + photonlibpy.estimation + photonlibpy.generated + photonlibpy.networktables + photonlibpy.simulation + photonlibpy.targeting + photonlibpy.timesync + +Submodules +---------- + +photonlibpy.estimatedRobotPose module +------------------------------------- + +.. automodule:: photonlibpy.estimatedRobotPose + :members: + :undoc-members: + :show-inheritance: + +photonlibpy.packet module +------------------------- + +.. automodule:: photonlibpy.packet + :members: + :undoc-members: + :show-inheritance: + +photonlibpy.photonCamera module +------------------------------- + +.. automodule:: photonlibpy.photonCamera + :members: + :undoc-members: + :show-inheritance: + +photonlibpy.photonPoseEstimator module +-------------------------------------- + +.. automodule:: photonlibpy.photonPoseEstimator + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: photonlibpy + :members: + :undoc-members: + :show-inheritance: diff --git a/photon-lib/py/docs/source/photonlibpy.simulation.rst b/photon-lib/py/docs/source/photonlibpy.simulation.rst new file mode 100644 index 0000000000..4d691df70a --- /dev/null +++ b/photon-lib/py/docs/source/photonlibpy.simulation.rst @@ -0,0 +1,53 @@ +photonlibpy.simulation package +============================== + +Submodules +---------- + +photonlibpy.simulation.photonCameraSim module +--------------------------------------------- + +.. automodule:: photonlibpy.simulation.photonCameraSim + :members: + :undoc-members: + :show-inheritance: + +photonlibpy.simulation.simCameraProperties module +------------------------------------------------- + +.. automodule:: photonlibpy.simulation.simCameraProperties + :members: + :undoc-members: + :show-inheritance: + +photonlibpy.simulation.videoSimUtil module +------------------------------------------ + +.. automodule:: photonlibpy.simulation.videoSimUtil + :members: + :undoc-members: + :show-inheritance: + +photonlibpy.simulation.visionSystemSim module +--------------------------------------------- + +.. automodule:: photonlibpy.simulation.visionSystemSim + :members: + :undoc-members: + :show-inheritance: + +photonlibpy.simulation.visionTargetSim module +--------------------------------------------- + +.. automodule:: photonlibpy.simulation.visionTargetSim + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: photonlibpy.simulation + :members: + :undoc-members: + :show-inheritance: diff --git a/photon-lib/py/docs/source/photonlibpy.targeting.rst b/photon-lib/py/docs/source/photonlibpy.targeting.rst new file mode 100644 index 0000000000..2619708e17 --- /dev/null +++ b/photon-lib/py/docs/source/photonlibpy.targeting.rst @@ -0,0 +1,45 @@ +photonlibpy.targeting package +============================= + +Submodules +---------- + +photonlibpy.targeting.TargetCorner module +----------------------------------------- + +.. automodule:: photonlibpy.targeting.TargetCorner + :members: + :undoc-members: + :show-inheritance: + +photonlibpy.targeting.multiTargetPNPResult module +------------------------------------------------- + +.. automodule:: photonlibpy.targeting.multiTargetPNPResult + :members: + :undoc-members: + :show-inheritance: + +photonlibpy.targeting.photonPipelineResult module +------------------------------------------------- + +.. automodule:: photonlibpy.targeting.photonPipelineResult + :members: + :undoc-members: + :show-inheritance: + +photonlibpy.targeting.photonTrackedTarget module +------------------------------------------------ + +.. automodule:: photonlibpy.targeting.photonTrackedTarget + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: photonlibpy.targeting + :members: + :undoc-members: + :show-inheritance: diff --git a/photon-lib/py/docs/source/photonlibpy.timesync.rst b/photon-lib/py/docs/source/photonlibpy.timesync.rst new file mode 100644 index 0000000000..5c111332f4 --- /dev/null +++ b/photon-lib/py/docs/source/photonlibpy.timesync.rst @@ -0,0 +1,21 @@ +photonlibpy.timesync package +============================ + +Submodules +---------- + +photonlibpy.timesync.timeSyncServer module +------------------------------------------ + +.. automodule:: photonlibpy.timesync.timeSyncServer + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: photonlibpy.timesync + :members: + :undoc-members: + :show-inheritance: diff --git a/photon-lib/py/docs/stylesheets/extra.css b/photon-lib/py/docs/stylesheets/extra.css deleted file mode 100644 index 30bbccf687..0000000000 --- a/photon-lib/py/docs/stylesheets/extra.css +++ /dev/null @@ -1,3 +0,0 @@ -:root > * { - --md-primary-fg-color: #3498DB; -} diff --git a/photon-lib/py/gen_api_docs.py b/photon-lib/py/gen_api_docs.py deleted file mode 100644 index 4bba82f008..0000000000 --- a/photon-lib/py/gen_api_docs.py +++ /dev/null @@ -1,29 +0,0 @@ -# gen_api_docs.py - -from pathlib import Path - -import mkdocs_gen_files - -nav = mkdocs_gen_files.Nav() - -for path in sorted(Path("photonlibpy").rglob("*.py")): - if path.name == "py.typed": - continue - - module_path = path.with_suffix("").as_posix().replace("/", ".") - parts = tuple(path.relative_to("photonlibpy").with_suffix("").parts) - - if path.name == "__init__.py": - continue - else: - doc_path = Path("reference", *parts).with_suffix(".md") - - nav[parts] = doc_path.as_posix() - - with mkdocs_gen_files.open(doc_path, "w") as f: - f.write(f"# `{module_path}`\n\n::: {module_path}") - - mkdocs_gen_files.set_edit_path(doc_path, path) - -with mkdocs_gen_files.open("reference/SUMMARY.md", "w") as nav_file: - nav_file.writelines(nav.build_literate_nav()) diff --git a/photon-lib/py/mkdocs.yml b/photon-lib/py/mkdocs.yml deleted file mode 100644 index 7e57fa0d3a..0000000000 --- a/photon-lib/py/mkdocs.yml +++ /dev/null @@ -1,40 +0,0 @@ -site_name: PhotonLibPy Docs -theme: - name: material - favicon: docs/favicon.ico # If you want a favicon - logo: logo.svg # Optional logo - palette: - primary: custom - -plugins: - - search: - - mkdocstrings: - handlers: - python: - options: - show_source: false - docstring_style: sphinx - paths: - - "." - - gen-files: - scripts: - - gen_api_docs.py - - literate-nav - - section-index - # To exclude files, add them under glob using their - # path from photonlibpy prepended by reference/ - # Additionally, change the extension from .py to .md - - exclude: - glob: - - "reference/packet.md" - - "reference/generated/*" - -nav: - - Home: index.md - - Reference: reference/SUMMARY.md - -extra_css: - - stylesheets/extra.css - -extra_javascript: - - js/exclude-details.js From 8cf48bee5727bdf28dbbed5a36cbd89537ea057b Mon Sep 17 00:00:00 2001 From: samfreund Date: Fri, 9 May 2025 12:35:33 -0500 Subject: [PATCH 42/49] update requirements.txt --- photon-lib/py/docs/requirements.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/photon-lib/py/docs/requirements.txt b/photon-lib/py/docs/requirements.txt index 0a149a3033..a50ed8933e 100644 --- a/photon-lib/py/docs/requirements.txt +++ b/photon-lib/py/docs/requirements.txt @@ -1,4 +1,3 @@ sphinx==7.2.6 sphinx-autodoc-typehints==1.25.2 sphinx-rtd-theme==1.3.0 -sphinx-apidoc==1.0.0 From 326c77fa38360ccad364db996d10eef353af310d Mon Sep 17 00:00:00 2001 From: samfreund Date: Fri, 9 May 2025 12:41:57 -0500 Subject: [PATCH 43/49] dammit, it was a typo --- .github/workflows/photon-api-docs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/photon-api-docs.yml b/.github/workflows/photon-api-docs.yml index e61608f609..78abb74b91 100644 --- a/.github/workflows/photon-api-docs.yml +++ b/.github/workflows/photon-api-docs.yml @@ -85,8 +85,8 @@ jobs: pip install -r photon-lib/py/docs/requirements.txt - name: Build Sphinx site - run: | - sphinx-apidocs -o docs/source photonlibpy + run: | + sphinx-apidoc -o docs/source photonlibpy make -C docs html working-directory: photon-lib/py From 892e240b18976efb091aa43ff8d79aa8fa41cb9c Mon Sep 17 00:00:00 2001 From: samfreund Date: Fri, 9 May 2025 12:44:31 -0500 Subject: [PATCH 44/49] change theme --- photon-lib/py/docs/source/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/photon-lib/py/docs/source/conf.py b/photon-lib/py/docs/source/conf.py index 078ed31d02..42b3cf6c3f 100644 --- a/photon-lib/py/docs/source/conf.py +++ b/photon-lib/py/docs/source/conf.py @@ -31,5 +31,5 @@ # -- Options for HTML output ------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output -html_theme = "alabaster" +html_theme = "sphinx_rtd_theme" html_static_path = ["_static"] From 6f2fd19351c490be4231686977afcba271e4f127 Mon Sep 17 00:00:00 2001 From: samfreund Date: Fri, 9 May 2025 12:47:58 -0500 Subject: [PATCH 45/49] add files to index --- .github/workflows/photon-api-docs.yml | 2 +- photon-lib/py/docs/source/index.rst | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/photon-api-docs.yml b/.github/workflows/photon-api-docs.yml index 78abb74b91..0f3de5cae7 100644 --- a/.github/workflows/photon-api-docs.yml +++ b/.github/workflows/photon-api-docs.yml @@ -85,7 +85,7 @@ jobs: pip install -r photon-lib/py/docs/requirements.txt - name: Build Sphinx site - run: | + run: | sphinx-apidoc -o docs/source photonlibpy make -C docs html working-directory: photon-lib/py diff --git a/photon-lib/py/docs/source/index.rst b/photon-lib/py/docs/source/index.rst index 78b78862c3..51c0a8e447 100644 --- a/photon-lib/py/docs/source/index.rst +++ b/photon-lib/py/docs/source/index.rst @@ -6,11 +6,12 @@ PhotonVision documentation ========================== -Add your content using ``reStructuredText`` syntax. See the -`reStructuredText `_ -documentation for details. +The main documentation for PhotonVision can be found at [docs.photonvision.org](https://docs.photonvision.org) .. toctree:: :maxdepth: 2 :caption: Contents: + + modules + photonlibpy # if you have these .rst files from sphinx-apidoc From 1637be6044e123ef37b97cb61ea989691ec0b294 Mon Sep 17 00:00:00 2001 From: samfreund Date: Fri, 9 May 2025 12:57:42 -0500 Subject: [PATCH 46/49] change path --- photon-lib/py/docs/source/conf.py | 4 +++- photon-lib/py/docs/source/index.rst | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/photon-lib/py/docs/source/conf.py b/photon-lib/py/docs/source/conf.py index 42b3cf6c3f..5eaebeacf4 100644 --- a/photon-lib/py/docs/source/conf.py +++ b/photon-lib/py/docs/source/conf.py @@ -22,7 +22,9 @@ import os import sys -sys.path.insert(0, os.path.abspath("../..")) # adjust based on your project layout +sys.path.insert( + 0, os.path.abspath("../../photonlibpy") +) # adjust based on your project layout templates_path = ["_templates"] exclude_patterns = [] diff --git a/photon-lib/py/docs/source/index.rst b/photon-lib/py/docs/source/index.rst index 51c0a8e447..c388e49886 100644 --- a/photon-lib/py/docs/source/index.rst +++ b/photon-lib/py/docs/source/index.rst @@ -3,11 +3,11 @@ You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. -PhotonVision documentation +PhotonLib Python Documentation ========================== -The main documentation for PhotonVision can be found at [docs.photonvision.org](https://docs.photonvision.org) +The main documentation for PhotonVision can be found at `photonvision.org `_. .. toctree:: :maxdepth: 2 From 05fcf876cd0ad36d9e58c92494e0311854a7238c Mon Sep 17 00:00:00 2001 From: samfreund Date: Fri, 9 May 2025 13:03:05 -0500 Subject: [PATCH 47/49] debugggggging --- photon-lib/py/docs/source/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/photon-lib/py/docs/source/conf.py b/photon-lib/py/docs/source/conf.py index 5eaebeacf4..6b3b95e58f 100644 --- a/photon-lib/py/docs/source/conf.py +++ b/photon-lib/py/docs/source/conf.py @@ -25,7 +25,7 @@ sys.path.insert( 0, os.path.abspath("../../photonlibpy") ) # adjust based on your project layout - +print(sys.path) templates_path = ["_templates"] exclude_patterns = [] From 6fbb41fb7678db406a33a9fda1d7304a5c4dfe3e Mon Sep 17 00:00:00 2001 From: samfreund Date: Fri, 9 May 2025 13:06:42 -0500 Subject: [PATCH 48/49] this should fix importing? --- photon-lib/py/docs/source/conf.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/photon-lib/py/docs/source/conf.py b/photon-lib/py/docs/source/conf.py index 6b3b95e58f..3ae4477506 100644 --- a/photon-lib/py/docs/source/conf.py +++ b/photon-lib/py/docs/source/conf.py @@ -1,3 +1,9 @@ +import os +import sys + +# This adds the 'py/' directory to the Python path +sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..'))) + # Configuration file for the Sphinx documentation builder. # # For the full list of built-in configuration values, see the documentation: From 46e71703efc3ef0fd0392959b44ac887c767d1f0 Mon Sep 17 00:00:00 2001 From: samfreund Date: Wed, 18 Jun 2025 16:06:54 -0500 Subject: [PATCH 49/49] trigger docs run