pamflow 0.6.1
Patch release made in response to the CRAN review of 0.6.0 (which was not published on CRAN).
Breaking change
-
No default write locations (breaking).
pam_config_read()andpam_load_config()now need the path to your config file; they no longer look forconfig/config.ymlin the working directory or fall back to the template. A relativepaths$project_rootis resolved against the folder holding the config file (the template now uses"..", the folder aboveconfig/), never the working directory.pam_standardize()andpam_standardization_app()have no defaultdata/...folders: give the folders as arguments or incfg(a dry run needs onlyraw_dir). The soundscape functions stop with a message when the configuration has noproject_root.
Bug fixes
-
pam_report(): allhas_*guards are defined at the top of the report template, so sections whose chunk options refer to them no longer fail when they are rendered before their check chunks. -
data.table (>= 1.16.0)is now required:rbindlist(ignore.attr = TRUE), used bypam_inspect_raw()andpam_standardize(), does not exist in older versions. -
pam_check_ffmpeg()runs its filter test with-nostdin, so ‘FFmpeg’ can no longer read from R’s standard input (this corrupted the example script underR CMD checkon machines with ‘FFmpeg’ installed).
CRAN compliance
- The Description no longer starts with “Tools for”, and software names are in single quotes (‘BirdNET’, ‘Python’, ‘shiny’, ‘Excel’, ‘HTML’, ‘PDF’).
- Internal helpers no longer use
<<-; results are collected in a local environment. Parallel filter workers runpam_filter_one()in the base environment instead of the global one.
pamflow 0.6.0
Ecological products
-
pam_species_thresholds()chooses a confidence threshold for each species from the Stage 5 validation. For each species it takes the lowest confidence whose estimated precision is withintolerance(0.05) of that species’ own best, so no precision target is needed. Species with too little validation get the global threshold (thereasoncolumn says why), and amanualtable overrides any species.write = TRUEsavesspecies_thresholds.csv, which can be used asprocessing.species_thresholds_file. -
pam_detection_table()gives one row per site, time bin and species with detections, recordings with a detection, recording effort and detections per hour (zeros included). The bin length defaults tooccupancy.occasion_length_days(1 day) and can be set withbin_days. It is the base for the planned activity, richness and abundance functions. -
pam_activity()gives detections per recorded hour for each species by hour of the day, day, week or month (pooled over sites or per site), for daily and seasonal activity patterns. Recording effort is split over the clock hours each recording covers, so recordings that start part way through an hour or cross midnight are counted correctly. It accepts the same species selection and thresholds as the table, and returns a relative activity index (1 = the species’ peak).pam_plot_activity()draws it. -
pam_richness()gives species richness and Hill numbers (orders you choose, default 1 and 2) for every site and time bin and for every site over the whole survey, the expected species accumulation over sites, and the Chao2 estimate of how many species were missed. A species counts as present in a bin only with at leastmin_eventsevents (default 1), and Hill numbers can weight species by their event counts or by presence only. The site table can be joined to habitat covariates bysite_id.pam_plot_richness()draws the accumulation curve or richness per site.
Stage 7: input for occupancy and abundance models
pamflow prepares the data; it does not fit the models and does not depend on any modeling package.
-
pam_count_history()builds the count history of one species (detections or recordings with a detection per site and occasion,NAwhere a site was not surveyed) with matching matrices of recording effort and days.pam_count_histories()does it for many species in one pass over the detections, on a shared grid of sites and occasions.pam_as_count_history()wraps counts from another source, andpam_add_site_covariates()attaches covariates bysite_idlater. -
pam_model_input()turns histories intoy,siteCovsandobsCovs(counts or detection / non-detection, optionally standardized and written to CSV). For several speciesyis a species x site x occasion array. Withseasonsit groups occasions into primary periods for multi-season models and returns both the wide matrix (forunmarkedandubms) and arrays (forspOccupancy), padded to equal length, with optional season covariates as yearly site covariates.pam_define_seasons()builds seasons by year or month. -
pam_check_model_input()checks dimensions, site and occasion matching, response values and missing values before the input goes to a modeling package.
Shiny apps
- The standardization, validation and annotation apps now look like the training app: a centered page with the pamflow logo, a light and dark mode switch, one card per setting, pill-style choices and the same pastel colors. The standardization app has folder buttons and number cards for the scan; the validation and annotation apps show a progress bar, the spectrogram and the audio above the controls. What the apps save and how they work is unchanged.
-
All app texts are translatable.
pam_standardization_app(),pam_validate()andpam_annotate()take alangargument, and their texts live ininst/i18n/<code>.ymlwith the training app’s. Values saved in your result files (such as the “none” choice for the true species) stay in English.
Occupancy occasions
-
Stage 6 now uses
occupancy.occasion_length_days. Until nowpam_build_occupancy()always used one-day occasions and ignored the setting. Occasions are now blocks of that many days, starting on the first recorded day and the same for every site;min_effort_hoursapplies to the whole occasion. With the default of 1 day the results are unchanged. Existing occupancy outputs are kept unless you passforce = TRUE.
Reports and guide
-
pam_report()has new sections: species richness and diversity (per-site table, Hill numbers, species accumulation and the Chao2 estimate), activity patterns (detections per recorded hour by hour of day and by week) and the per-species thresholds saved bypam_species_thresholds(). The Excel workbook gets matching sheets. A section is left out, and noted in the log, when its inputs are missing. - The guide and README describe the new functions: Stage 7 model input, thresholds, activity and richness, plus
pam_audio_history()in the function reference and FAQ, and the occasion length of Stage 6.
Package and CRAN preparation
- BirdNET is cited (Kahl et al. 2021, doi:10.1016/j.ecoinf.2021.101236) in the description, help pages, README and guide.
-
pam_birdnet_setup()asks for confirmation before downloading (about 1 GB) in interactive sessions. - Random samples use
withr::with_seed(), so your session’s random seed is no longer changed. - Updated description, citation (with ORCID) and
SystemRequirements;ubmsandspOccupancyremoved from Suggests.
pamflow 0.5.0
Audio history
-
pam_audio_history()shows what happened to each audio file across the workflow: standardization, scan and QC flags, filtering, detection, cleaning, validation, recall annotation and whether it went into the occupancy histories. It is built from the files the stages already write, so it works on existing projects and writes nothing unless you passwrite = TRUE(which savesmetadata/audio_history.csv). Usefile =to look at one file andwide = TRUEfor one row per file with a status column per stage.
Examples
-
pam_example_project()builds a tiny synthetic project (six short WAV files from two grids, a deployment sheet and a config) in a temporary folder. It needs no FFmpeg, Python or internet, so help-page examples and tests can run anywhere. - Runnable examples were added to the config, audio, filename-parsing, deployment, QC, scan, checkpoint and logging functions, and to the detection cleaning, validation, recall and occupancy functions (the example project includes a small BirdNET-style detections file for them).
- Examples that need FFmpeg,
rmarkdownorsoundecologyrun only when those are available (\donttestplus a check), the Shiny apps haveif (interactive())examples, and functions that need the BirdNET Python environment keep\dontrun. Functions that need FFmpeg, Python or an interactive session get guarded examples in later batches. - README: the deployment-sheet example gave the grid as
G0059; the sheet expects a number (59).
Standalone BirdNET model training (not a workflow stage)
Training your own classifier is a separate tool. No workflow stage calls it and the workflow runs without it; the trained model is used by pointing the birdnet: config section at it. pam_birdnet_setup("training") creates the training environment.
-
Training app.
pam_train_app()is a Shiny app laid out like the Analyzer GUI’s training tab: choose the data, set the options, watch live progress and learning curves, repeat a training to see how much the scores vary, compare earlier runs, and copy the config lines for the new model. The interface text lives ininst/i18n/(English included; other languages can be added by translating one file). -
pam_birdnet_train_prepare(),pam_birdnet_train(),pam_birdnet_train_metrics()andpam_birdnet_train_repeat()run BirdNET-Analyzer’s ownbirdnet-traincommand, with the same defaults and results as the Analyzer GUI (version 2.4.0). Every run keeps a log and a record of what was run. -
Per-class test results. With a separate test folder,
pam_birdnet_train()returnsevaluation: precision, recall, F1, AUPRC and AUROC for every class plus the macro average, read from the Analyzer’s<output>_evaluation.csv. The training app shows them on the Results tab (best threshold per class or 0.5) with the confusion counts.
BirdNET without birdnetR
-
birdnetR is no longer used. Stage 3 runs the Python
birdnetpackage (0.2.x) directly through a small batch script shipped with pamflow (inst/python/pam_birdnet_predict.py). Detections are identical to birdnetR’s on the pilot data and the run is faster. -
Own Python environment.
pam_birdnet_setup()creates private virtual environments (inference and training) withuv;pam_birdnet_doctor()checks the machine and the environments. -
Worker control.
birdnet$workerssets the number of worker processes; if unset, half of the physical cores are used. New options:top_k,py_batch_size,n_producers,sigmoid_sensitivity,device,python_env.batch_sizeandtflite_threadswere birdnetR settings and are ignored. -
Benchmark.
pam_birdnet_benchmark()measures throughput for several worker counts and estimates the time for the whole archive. -
Clearer errors.
pam_detect()now names missing configuration entries. -
No leftover processes. Interrupting a run (Esc) stops BirdNET and all its worker processes;
pam_birdnet_cleanup()stops workers left behind by an earlier crash.
pamflow 0.4.0
Stage 00 Data Triage & Standardization
-
Audio Standardization Engine: Added
pam_standardize()to process multi-format field audio (WAV, FLAC, MP3) into uniform 48 kHz Mono WAV format while keeping raw audio files strictly read-only. -
Raven Compass Triage App: Added
pam_standardization_app(), an interactive Shiny app with[Inspect],[Convert], and[Log]tabs. -
Automatic Isolation: Short files (< 60 seconds) or corrupt audio are automatically segregated into
data/isolated/. -
Metadata Parsing: Added
pam_parse_datetime()andpam_extract_grid()to extract timestamps and deployment/sensor IDs directly from filenames.
pamflow 0.3.0
Major Features
-
FLAC compatibility: All 8 pipeline stages now natively support
.flacfiles alongside.wav. -
Audio Utilities Module (
R/utils_audio.R): Addedpam_read_audio(),pam_audio_info(),pam_cut_audio(),pam_list_audio(), andpam_is_flac()for unified audio I/O. -
Stage 1 (Scan): Vectorized header reading via
avandtuneR. -
Stage 2 (Filter): Dynamic FFmpeg codec branching (
-c:a flacvs-c:a pcm_s16le). - Stage 2b (Soundscape): PSOCK worker export env with FLAC decoding.
- Stage 5 (Validation): Format-preserving clip export and on-the-fly FLAC -> WAV transcoding for Shiny browser playback.
pamflow 0.2.0
Major Features
- Workflow B: Soundscape Analysis introduced.
-
Stage 2b (Soundscape Indices): Added
pam_soundscape_run()to compute ACI, ADI, AEve, Bio, H, M, and NDSI following Bradfer-Lawrence et al. (2019). -
Stage 2c (Soundscape Visualizations): Added
pam_soundscape_run_vis()andpam_soundscape_report()to generate automated 24-hour diel profiles, Day/Night comparisons, and HTML diagnostic reports.
Performance & Optimizations
- Implemented 1-minute sub-windowing for high-performance memory safety.
- Optimized audio high-pass filtering (500 Hz) at the sub-window level.
- Added dynamic downsampling (to 24 kHz) for ecoacoustic frequency bounds, increasing processing speed by 10x-15x.
- Checkpointing mechanism (
done.txt) implemented for crash-resilient resuming.
pamflow 0.1.0
- First release.
-
Stage 1 (Scan): Audio scanning and QC (
pam_scan_audio()). -
Stage 2 (Filter): High-pass filtering (Optional) (
pam_filter_audio()). -
Stage 3 (Detection): BirdNET batch detection with parallel workers and resume support (
pam_detect()). -
Stage 4 (Process Detection): Detection cleaning, filtering, and merging (
pam_process_detections()). -
Stage 5 (Validation): Interactive validation app with precision metrics (
pam_validation_draw(),pam_validation_export(),pam_validation_app(),pam_validation_metrics()). -
Stage 6 (Occupancy detection History): Occupancy detection histories and covariates (
pam_build_occupancy()). -
Stage 8 (Report): HTML and Excel reports (
pam_report()). - Config-driven pipeline — all settings in a single YAML file.
- R CMD check clean (0 errors, 0 warnings, 0 notes).
- Tested on pilot data.
