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

[📝] Autogenerate Documentation #184

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# https://github.com/mitmproxy/pdoc/blob/main/.github/workflows/docs.yml

name: PyHa Documentation

# build the documentation whenever there are new commits on main
on:
push:
branches:
- main
- np-generate-docs
natmfat marked this conversation as resolved.
Show resolved Hide resolved

# security: restrict permissions for CI jobs.
permissions:
contents: read

jobs:
# Build the documentation and upload the static HTML files as an artifact.
build:
runs-on: windows-latest
Copy link
Contributor

Choose a reason for hiding this comment

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

Generally, we would prefer jobs run on ubuntu-latest unless you absolutely need Windows.

Copy link
Author

Choose a reason for hiding this comment

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

I used ubuntu-latest but I couldn't figure out this error

terminate called after throwing an instance of 'std::runtime_error'
  what():  random_device could not be read
/home/runner/work/_temp/aa96a6f4-a556-45f5-a8b1-05d0770bba35.sh: line 1:  1882 Aborted                 (core dumped) poetry run python -m pdoc ./PyHa -o docs/
Error: Process completed with exit code 134.

I suspect it has something to do with this issue but I figured generating docs worked on my machine (windows) so it would work on the action

Copy link
Contributor

Choose a reason for hiding this comment

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

Please add an issue to PyHa referencing that issue then resolve this conversation.

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Install dependencies
run: |
python -m pip install --upgrade pip poetry
poetry install

- name: Build Documentation
run: poetry run python -m pdoc ./PyHa --docformat google -o docs/
env:
PDOC_ALLOW_EXEC: 1
natmfat marked this conversation as resolved.
Show resolved Hide resolved

- uses: actions/upload-pages-artifact@v3
with:
path: docs/

# Deploy the artifact to GitHub pages.
# This is a separate job so that only actions/deploy-pages has the necessary permissions.
deploy:
needs: build
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4
natmfat marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ outputs/*
/mixed_bird/*
TEST/*

docs/

*.csv
*.flac
*.ipynb
Expand Down
7 changes: 7 additions & 0 deletions PyHa/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
r"""
A tool designed to convert audio-based "weak" labels to "strong" moment-to-moment labels. Provides a pipeline to compare automated moment-to-moment labels to human labels. Current proof of concept work being fulfilled on Bird Audio clips using Microfaune predictions.

This package is being developed and maintained by the [Engineers for Exploration Acoustic Species Identification Team](http://e4e.ucsd.edu/acoustic-species-identification) in collaboration with the [San Diego Zoo Wildlife Alliance](https://sandiegozoowildlifealliance.org/).
natmfat marked this conversation as resolved.
Show resolved Hide resolved

PyHa = Python + Piha (referring to a bird species of our interest known as the screaming-piha)
natmfat marked this conversation as resolved.
Show resolved Hide resolved
"""
24 changes: 22 additions & 2 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Copy link
Contributor

Choose a reason for hiding this comment

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

If you modify pyproject.toml, you need to update poetry.lock using poetry lock!

Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,4 @@ tensorflow-io-gcs-filesystem = [
{ version = "< 0.32.0", markers = "platform_system == 'Windows'" }
]
resampy = "^0.4.2"
pdoc = "^14.4.0"
natmfat marked this conversation as resolved.
Show resolved Hide resolved