Skip to content

Commit f1b07aa

Browse files
committed
add gh-action
1 parent dd64f27 commit f1b07aa

7 files changed

Lines changed: 68 additions & 13 deletions

File tree

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: documentation
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
7+
pull_request:
8+
branches: ["main"]
9+
10+
# Allows you to run this workflow manually from the Actions tab
11+
workflow_dispatch:
12+
13+
permissions:
14+
contents: write
15+
16+
jobs:
17+
docs:
18+
runs-on: ubuntu-latest
19+
env:
20+
IS_GITHUB_RUNNER: "true"
21+
steps:
22+
- uses: actions/checkout@v4
23+
- uses: actions/setup-python@v5
24+
with:
25+
python-version: "3.12"
26+
27+
- name: Upgrade pip
28+
run: python -m pip install --upgrade pip
29+
30+
- name: Install dependencies
31+
run: |
32+
python -m pip install uv --upgrade
33+
python -m uv pip install --system .[docs]
34+
35+
- name: Sphinx build
36+
run: |
37+
sphinx-build -b html docs/ docs/_build/html -j auto
38+
39+
- name: Deploy to GitHub Pages
40+
uses: peaceiris/actions-gh-pages@v4
41+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
42+
with:
43+
publish_branch: gh-pages
44+
github_token: ${{ secrets.GITHUB_TOKEN }}
45+
publish_dir: ./_build/html
46+
# force_orphan: true

docs/changelog.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.. include:: ../CHANGELOG.md
2+
:parser: myst

docs/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"sphinx.ext.autodoc",
1919
"sphinx_autodoc_typehints",
2020
"numpydoc",
21+
"myst_parser",
2122
]
2223

2324
templates_path = ["_templates"]

docs/index.rst

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,18 @@ Documentation for the birdnet package.
1414

1515
birdnet
1616
models
17+
changelog
1718

1819
Introduction
1920
------------
2021

2122
A Python library for identifying bird species by their sounds.
2223

23-
The library is geared towards providing a robust workflow for ecological data analysis in bioacoustic projects. While it covers essential functionalities, it doesn’t include all the features found in BirdNET-Analyzer, which is available [here](https://github.com/birdnet-team/BirdNET-Analyzer). Some features might only be available in the BirdNET Analyzer and not in this package.
24+
The library is geared towards providing a robust workflow for ecological data analysis in bioacoustic projects. While it covers essential functionalities, it doesn’t include all the features found in BirdNET-Analyzer, which is available `here <https://github.com/birdnet-team/BirdNET-Analyzer>`__. Some features might only be available in the BirdNET Analyzer and not in this package.
2425

2526
This project is under active development, so you might encounter changes that could affect your current workflow. We recommend checking for updates regularly.
2627

27-
The package is also available as an R package at: [birdnetR](https://github.com/birdnet-team/birdnetR).
28+
The package is also available as an R package at: `birdnetR <https://github.com/birdnet-team/birdnetR>`__.
2829

2930
Citing BirdNET-Analyzer
3031
-----------------------
@@ -46,37 +47,37 @@ Feel free to use BirdNET for your acoustic analyses and research. If you do, ple
4647
About
4748
-----
4849

49-
Developed by the `K. Lisa Yang Center for Conservation Bioacoustics <https://www.birds.cornell.edu/ccb/>`_ at the `Cornell Lab of Ornithology <https://www.birds.cornell.edu/home>`_ in collaboration with `Chemnitz University of Technology <https://www.tu-chemnitz.de/index.html>`_.
50+
Developed by the `K. Lisa Yang Center for Conservation Bioacoustics <https://www.birds.cornell.edu/ccb/>`__ at the `Cornell Lab of Ornithology <https://www.birds.cornell.edu/home>`__ in collaboration with `Chemnitz University of Technology <https://www.tu-chemnitz.de/index.html.en>`__.
5051

5152
Go to https://birdnet.cornell.edu to learn more about the project.
5253

5354
Want to use BirdNET to analyze a large dataset? Don't hesitate to contact us: ccb-birdnet@cornell.edu
5455

55-
We also have a discussion forum on `Reddit <https://www.reddit.com/r/BirdNET_Analyzer/>`_ if you have a general question or just want to chat.
56+
We also have a discussion forum on `Reddit <https://www.reddit.com/r/BirdNET_Analyzer/>`__ if you have a general question or just want to chat.
5657

5758
Have a question, remark, or feature request? Please start a new issue thread to let us know. Feel free to submit a pull request.
5859

5960
More tools and resources
6061
------------------------
6162

62-
We also provide Python and R packages to interact with BirdNET models, as well as training and deployment tools for microcontrollers. Make sure to check out our other repositories at `https://github.com/birdnet-team <https://github.com/birdnet-team>`_.
63+
We also provide Python and R packages to interact with BirdNET models, as well as training and deployment tools for microcontrollers. Make sure to check out our other repositories at `https://github.com/birdnet-team <https://github.com/birdnet-team>`__.
6364

6465

6566
Projects map
6667
------------
6768

6869
We have created an interactive map of projects that use BirdNET. If you are working on a project that uses BirdNET, please let us know and we can add your project to the map.
6970

70-
You can access the map here: `Open projects map <https://birdnet-team.github.io/BirdNET-Analyzer/projects.html>`_
71+
You can access the map here: `Open projects map <https://birdnet-team.github.io/BirdNET-Analyzer/projects.html>`__
7172

72-
Please refer to the `projects map documentation <usage/projects-map.html>`_ for more information on how to contribute.
73+
Please refer to the `projects map documentation <usage/projects-map.html>`__ for more information on how to contribute.
7374

7475
License
7576
-------
7677

77-
**Source Code**: The source code for this project is licensed under the `MIT License <https://opensource.org/licenses/MIT>`_
78+
**Source Code**: The source code for this project is licensed under the `MIT License <https://opensource.org/licenses/MIT>`__
7879

79-
**Models**: The models used in this project are licensed under the `Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License (CC BY-NC-SA 4.0) <https://creativecommons.org/licenses/by-nc-sa/4.0/>`_
80+
**Models**: The models used in this project are licensed under the `Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License (CC BY-NC-SA 4.0) <https://creativecommons.org/licenses/by-nc-sa/4.0/>`__
8081

8182
Please ensure you review and adhere to the specific license terms provided with each model.
8283

docs/models.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,19 @@ Technical details
2525

2626
* both spectrograms have a final resolution of 96x511 pixels
2727
* raw audio will be normalized between -1 and 1 before spectrogram conversion
28-
* we use non-linear magnitude scaling as mentioned in `Schlüter 2018 <http://ceur-ws.org/Vol-2125/paper_181.pdf>`_
28+
* we use non-linear magnitude scaling as mentioned in `Schlüter 2018 <http://ceur-ws.org/Vol-2125/paper_181.pdf>`__
2929
* V2.4 uses an EfficienNetB0-like backbone with a final embedding size of 1024
30-
* See `this comment <https://github.com/birdnet-team/BirdNET-Analyzer/issues/177#issuecomment-1772538736>`_ for more details
30+
* See `this comment <https://github.com/birdnet-team/BirdNET-Analyzer/issues/177#issuecomment-1772538736>`__ for more details
3131

3232
Geo model (species range model) V2.4 - V2, Jan 2024
3333
---------------------------------------
3434

3535
* updated species range model based on eBird data
3636
* more accurate (spatial) species range prediction
3737
* slightly increased long-tail distribution in the temporal resolution
38-
* see `this discussion post <https://github.com/birdnet-team/BirdNET-Analyzer/discussions/234>`_ for more details
38+
* see `this discussion post <https://github.com/birdnet-team/BirdNET-Analyzer/discussions/234>`__ for more details
3939

4040
Using older models
4141
------------------
4242

43-
Older models are not supported in the current version of the package. If you need to use an older model, please refer to the `BirdNET-Analyzer repository <https://github.com/birdnet-team/BirdNET-Analyzer>`_.
43+
Older models are not supported in the current version of the package. If you need to use an older model, please refer to the `BirdNET-Analyzer repository <https://github.com/birdnet-team/BirdNET-Analyzer>`__.

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ tests = [
118118
"ruff >= 0.14.4"
119119
]
120120
dev = ["jupyter", "uv", "ruff", "mypy", "rope", "build", "twine", "scipy-stubs", "tuna", "pyarrow-stubs", "types-tqdm", "types-requests", "pandas-stubs", "types-tensorflow"]
121+
docs = ["sphinx==9.0.4", "numpydoc", "sphinx-autodoc-typehints", "sphinx-autobuild", "myst-parser"]
121122

122123
[project.urls]
123124
Homepage = "https://github.com/birdnet-team/birdnet"

src/birdnet/model_loader.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
"""Module for loading models.
2+
Provides functions to load official and custom models.
3+
"""
4+
15
from os import PathLike
26
from pathlib import Path
37
from typing import Any, Literal, cast

0 commit comments

Comments
 (0)