Skip to contents

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() and pam_load_config() now need the path to your config file; they no longer look for config/config.yml in the working directory or fall back to the template. A relative paths$project_root is resolved against the folder holding the config file (the template now uses "..", the folder above config/), never the working directory. pam_standardize() and pam_standardization_app() have no default data/... folders: give the folders as arguments or in cfg (a dry run needs only raw_dir). The soundscape functions stop with a message when the configuration has no project_root.

Bug fixes

  • pam_report(): all has_* 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 by pam_inspect_raw() and pam_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 under R CMD check on 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 run pam_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 within tolerance (0.05) of that species’ own best, so no precision target is needed. Species with too little validation get the global threshold (the reason column says why), and a manual table overrides any species. write = TRUE saves species_thresholds.csv, which can be used as processing.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 to occupancy.occasion_length_days (1 day) and can be set with bin_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 least min_events events (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 by site_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, NA where 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, and pam_add_site_covariates() attaches covariates by site_id later.
  • pam_model_input() turns histories into y, siteCovs and obsCovs (counts or detection / non-detection, optionally standardized and written to CSV). For several species y is a species x site x occasion array. With seasons it groups occasions into primary periods for multi-season models and returns both the wide matrix (for unmarked and ubms) and arrays (for spOccupancy), 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() and pam_annotate() take a lang argument, and their texts live in inst/i18n/<code>.yml with 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 now pam_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_hours applies to the whole occasion. With the default of 1 day the results are unchanged. Existing occupancy outputs are kept unless you pass force = 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 by pam_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; ubms and spOccupancy removed 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 pass write = TRUE (which saves metadata/audio_history.csv). Use file = to look at one file and wide = TRUE for 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, rmarkdown or soundecology run only when those are available (\donttest plus a check), the Shiny apps have if (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 in inst/i18n/ (English included; other languages can be added by translating one file).
  • pam_birdnet_train_prepare(), pam_birdnet_train(), pam_birdnet_train_metrics() and pam_birdnet_train_repeat() run BirdNET-Analyzer’s own birdnet-train command, 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() returns evaluation: 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 birdnet package (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) with uv; pam_birdnet_doctor() checks the machine and the environments.
  • Worker control. birdnet$workers sets 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_size and tflite_threads were 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() and pam_extract_grid() to extract timestamps and deployment/sensor IDs directly from filenames.

Infrastructure, Branding & Documentation

  • Package Logo: Integrated hexagonal logo (man/figures/logo.png) and site favicons.

Compliance & Maintenance

  • Standardized log outputs with strict uppercase log levels ("INFO", "WARN", "ERROR").
  • Ensured pure ASCII compliance across all .R files and Shiny interfaces.

pamflow 0.3.0

Major Features

  • FLAC compatibility: All 8 pipeline stages now natively support .flac files alongside .wav.
  • Audio Utilities Module (R/utils_audio.R): Added pam_read_audio(), pam_audio_info(), pam_cut_audio(), pam_list_audio(), and pam_is_flac() for unified audio I/O.
  • Stage 1 (Scan): Vectorized header reading via av and tuneR.
  • Stage 2 (Filter): Dynamic FFmpeg codec branching (-c:a flac vs -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() and pam_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