Add presets - #955
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces reusable “presets” in the GUI and a unified parameters-file format/loader so users can restore settings from saved presets or from prior analysis/training runs (CLI and GUI).
Changes:
- Add GUI preset save/load/delete controls for tabs, plus loading settings from prior-run params CSV files.
- Standardize params CSV output to a two-column
Parameter,Valueformat and add robust loaders for both new and legacy formats. - Extend CLI entrypoints to optionally load params files as argument defaults (
--load_params), with explicit CLI flags taking precedence.
Reviewed changes
Copilot reviewed 28 out of 29 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_params.py | Adds tests for reading analysis/training params files and applying them as CLI defaults. |
| tests/gui/test_presets.py | Adds GUI tests for preset CRUD, applying presets, and loading settings from params files. |
| docs/best-practices/training.rst | Updates documented training params filename to the new convention. |
| birdnet_analyzer/utils.py | Adds read_classifier_labels() and replaces legacy params CSV writer with save_params_file(). |
| birdnet_analyzer/train/utils.py | Writes training params to *.birdnet.train-params.csv and removes passing params into model save helpers. |
| birdnet_analyzer/train/cli.py | Applies --load_params defaults before parsing and avoids passing load_params into train(). |
| birdnet_analyzer/settings.py | Adds preset storage/validation and batch tab-settings persistence helper. |
| birdnet_analyzer/params.py | New module to load analysis/training params from both new and legacy CSV layouts. |
| birdnet_analyzer/model.py | Removes params-file writing from model save paths (now handled in training utils). |
| birdnet_analyzer/lang/zh_TW.json | Adds localized preset UI strings. |
| birdnet_analyzer/lang/tlh.json | Adds localized preset UI strings. |
| birdnet_analyzer/lang/se.json | Adds localized preset UI strings. |
| birdnet_analyzer/lang/ru.json | Adds localized preset UI strings. |
| birdnet_analyzer/lang/pt-br.json | Adds localized preset UI strings. |
| birdnet_analyzer/lang/id.json | Adds localized preset UI strings. |
| birdnet_analyzer/lang/fr.json | Adds localized preset UI strings. |
| birdnet_analyzer/lang/fi.json | Adds localized preset UI strings. |
| birdnet_analyzer/lang/en.json | Adds localized preset UI strings. |
| birdnet_analyzer/lang/de.json | Adds localized preset UI strings. |
| birdnet_analyzer/gui/utils.py | Improves model/species selection interactions and reuses read_classifier_labels(). |
| birdnet_analyzer/gui/train.py | Adds preset controls to the training tab, including load-from-params-file. |
| birdnet_analyzer/gui/state.py | Adds component inventory/snapshot + safe “apply settings” update generation for presets. |
| birdnet_analyzer/gui/presets.py | New preset UI wiring + load-from-params mapping for analysis and training tabs. |
| birdnet_analyzer/gui/multi_file.py | Adds preset controls to the multi-file analysis tab (including file components). |
| birdnet_analyzer/config.py | Updates analysis params filename and introduces training params filename suffix constant. |
| birdnet_analyzer/cli.py | Adds --load_params arg injection and a pre-parse defaults application helper. |
| birdnet_analyzer/analyze/core.py | Writes analysis params using the new two-column params CSV layout (including additional columns). |
| birdnet_analyzer/analyze/cli.py | Applies --load_params defaults before parsing and avoids passing load_params into analyze(). |
| .gitignore | Ignores the new params filenames (birdnet.analyze-params.csv, *.birdnet.train-params.csv). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.