Skip to content

documentation: unknown behavior for week parameter greater than 48 and unknown valid parameters in python api #885

@yblacky

Description

@yblacky

Title: Unknown behavior for week parameter greater than 48 and valid parameters when directly used analyze() via python

Description:

The CLI documentation for birdnet_analyzer.analyze is solid, but when calling analyze() directly as a Python function there is no equivalent documentation.

Example:
the CLI docs state that --week accepts values from 1 to 48 (4 weeks per month).
There is no equivalent note for direct called analyze() via python. External integrations that get the week from a standard ISO calendar (week 1 to 52/53) will pass values above 48. Its unclear for me what happens in that case.
Is the value getting ignored, extrapolated or used by the geo model as the maximum (48)?. I didnt get an error or a warning if i use a week parameter greater than 48.

Questions:

  • What is the actual behavior when week is greater than 48, if called via analyze()?
  • Should out-of-range values raise an error?

Excpected:
Any of that (or all of them) would resolve that:

  • A AnalyzeConfig dataclass or TypedDict for constructing valid calls
  • Good documentation of direct usage of analyzing functions and their valid parameters
  • Validation inside analyze() for out-of-range values

Context:
I'm building a local web UI on top of a local installation of BirdNET-Analyzer wrapped in a FastAPI. The week range is the most concrete example, but in general the lack of a python api affects any programmatic integration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions