Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
^\.Rproj\.user$
^\.github$
^data-raw$
^LICENSE\.md$
^cran-comments\.md$
6 changes: 2 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: BirdFlowExamples
Title: Data package with example BirdFlowR models
Title: Data Package with Example BirdFlowR Models
Version: 0.0.1.9001
Authors@R:
person("Ethan", "Plunkett", email = "plunkett@umass.edu",
Expand All @@ -15,10 +15,8 @@ LazyData: true
LazyDataCompression: gzip
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.2
RoxygenNote: 7.3.3
Depends:
R (>= 3.5)
Imports:
Matrix
Remotes:
birdflow-science/BirdFlowR
23 changes: 2 additions & 21 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,21 +1,2 @@
MIT License

Copyright (c) 2026 birdflow-science

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
YEAR: 2026
COPYRIGHT HOLDER: birdflow-science
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 birdflow-science

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
9 changes: 9 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## BirdFlowExamples 0.0.1.9001
2026-10-22

* Renamed package from `BirdFlowModels` to `BirdFlowExamples`. The data
object names (`amewoo`, `rewbla`, `rewbla_observations`,
`rewbla_intervals`, `states`) are unchanged.

* Refit `amewoo` and `rewbla` and reduced their file size.

## BirdFlowModels 0.0.2.9003
2025-04-08

Expand Down
19 changes: 10 additions & 9 deletions R/data.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# This file documents data

#' @name BirdFlowModels
#' @rdname BirdFlowModels
#' @aliases BirdFlowModels
#' @name BirdFlowExamples
#' @rdname BirdFlowExamples
#' @aliases BirdFlowExamples
#' @aliases amewoo
#' @aliases rewbla
#' @title Birdflow Example Models
Expand All @@ -12,13 +12,14 @@
#'
#' @format `BirdFlow` model
#'
#' @source Trained on eBird Status and Trends 2019 and 2021 Data.
#' @source Trained on eBird Status and Trends 2023 Data.
#'
#' @references Fink, D., T. Auer, A. Johnston, M. Strimas-Mackey, S. Ligocki, O.
#' Robinson, W. Hochachka, L. Jaromczyk, A. Rodewald, C. Wood, I. Davies, A.
#' Spencer. 2022. eBird Status and Trends, Data Version: 2021; Released: 2022.
#' Cornell Lab of Ornithology, Ithaca, New York.
#' https://doi.org/10.2173/ebirdst.2021
#' @references Fink, D., T. Auer, A. Johnston, M. Strimas-Mackey, S. Ligocki, O. Robinson,
#' W. Hochachka, L. Jaromczyk, C. Crowley, K. Dunham, A. Stillman, C. Davis, M. Stokowski,
#' P. Sharma, V. Pantoja, D. Burgin, P. Crowe, M. Bell, S. Ray, I. Davies, V. Ruiz-Gutierrez,
#' C. Wood, A. Rodewald. 2024.
#' eBird Status and Trends, Data Version: 2023;
#' Released: 2025. Cornell Lab of Ornithology, Ithaca, New York. https://doi.org/10.2173/WZTW8903
#' @seealso [BirdFlowR::load_model()] will load a vetted model from a
#' BirdFlow model collection. `BirdFlowR::load_collection_index()` will
#' return a data frame with information on available models.
Expand Down
2 changes: 1 addition & 1 deletion R/states.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#' class **data.frame** and has columns:
#' \describe{
#' \item{name}{State name}
#' \item{geometry}{Contains polyon information}
#' \item{geometry}{Contains polygon information}
#'
#' The code below was used to create this object:
#' ```
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# BirdFlowModels
# BirdFlowExamples

<!-- badges: start -->
[![R-CMD-check](https://github.com/birdflow-science/BirdFlowModels/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/birdflow-science/BirdFlowModels/actions/workflows/R-CMD-check.yaml)
[![R-CMD-check](https://github.com/birdflow-science/BirdFlowExamples/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/birdflow-science/BirdFlowExamples/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->

This is a "Data" R package that contains a fitted BirdFlow model for use with
Expand All @@ -26,14 +26,14 @@ the data in the package will change frequently.
Use the code below to install from github

```{r}
devtools::install_github("birdflow-science/BirdFlowModels")
devtools::install_github("birdflow-science/BirdFlowExamples")
```
## Use

After loading this package the dataset will be available for use.

```{r}
library(BirdFlowModels)
library(BirdFlowExamples)
library(BirdFlowR)
print(amewoo)
species(amewoo)
Expand Down
29 changes: 29 additions & 0 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# CRAN comments

## Package size

`R CMD check` reports an installed size of 6.3 MB (`data` subdirectory
6.2 MB), driven by the example `BirdFlow` model objects the package
exists to provide (`amewoo.rda` 3.9 MB, `rewbla.rda` 1.1 MB, plus
`states.rda`, `rewbla_observations.rda`, and `rewbla_intervals.rda`
together under 0.2 MB on disk). This is over the informal 5 MB
guideline for source packages.

These models and ancillary data are the package's sole purpose: fitted
example models for testing and demonstrating the companion `BirdFlowR`
package. They have already been fit at coarse spatial resolution
(`amewoo` at 150 km, `rewbla` at 350 km) and, for `rewbla`, with heavy
sparsification specifically to minimize size while still exercising the
code paths they are used for (geometry mismatches and season wraparound
in particular). `amewoo`'s resolution was kept finer than `rewbla`'s
because it is also used in `BirdFlowR` vignette figures, where coarser
resolution would visibly degrade example output.

## Test environments

* local macOS install, R 4.x
* GitHub Actions: macOS, Windows, Ubuntu (release and devel)

## R CMD check results

0 errors | 0 warnings | 0 notes
45 changes: 0 additions & 45 deletions data-raw/DATASET.R

This file was deleted.

88 changes: 88 additions & 0 deletions data-raw/models.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Code to fit amewoo model on Unity Cluster. It is unlikely to work
# in other contexts.

# Currently there are two models the first amewoo is used in most examples.
# It is not a sparse model.
# The second rewbla was initial added to test evaluation code
# e.g. BirdFlowR::interval_log_likelihood()
# and is used in a few other tests. It is heavily sparsified.


dir <- "/work/pi_plunkett_umass_edu/birdflowexamples/"

library(BirdFlowR)
library(BirdFlowPipeline)
bf <- load_model("amewoo")

species <- "amewoo"
res <- 150
hp <- bf$metadata$hyperparameters

dir.create(dir, showWarnings = FALSE)
batch_species(species = species,
grid_search_type = "old",
dist_pow = hp$dist_pow,
dist_weight = hp$dist_weight,
ent_weight = hp$ent_weight,
res = res,
hdf_path = dir,
base_output_path = dir,
clip = BirdFlowPipeline::americas_clip,
crs = as.character(BirdFlowPipeline::americas_crs)[2])



result <- paste0(dir, species, "_", res, "km/", species,
"_", ebirdst::ebirdst_version()$status_version_year[1], "_",
res, "km_obs1.0_ent",
hp$ent_weight,
"_dist", hp$dist_weight,
"_pow", hp$dist_pow, ".hdf5")


bf <- import_birdflow(result)

amewoo <- bf

usethis::use_data(amewoo, compress = "xz")


# Note I'm using the tuned parameters from AMEWOO for rewbla as well
# This isn't best practice for models used for inference but
# is fine for creating a second model
species <- "rewbla"
res <- 350
hp <- bf$metadata$hyperparameters

dir.create(dir, showWarnings = FALSE)
batch_species(species = species,
grid_search_type = "old",
dist_pow = hp$dist_pow,
dist_weight = hp$dist_weight,
ent_weight = hp$ent_weight,
res = res,
hdf_path = dir,
base_output_path = dir,
clip = BirdFlowPipeline::americas_clip,
crs = as.character(BirdFlowPipeline::americas_crs)[2])



result <- paste0(dir, species, "_", res, "km/", species,
"_", ebirdst::ebirdst_version()$status_version_year[1], "_",
res, "km_obs1.0_ent",
hp$ent_weight,
"_dist", hp$dist_weight,
"_pow", hp$dist_pow, ".hdf5")



bf <- import_birdflow(result)
rewbla <- sparsify(bf, method = "conditional", p = .95, p_protected = 0.05)



usethis::use_data(rewbla, compress = "xz", overwrite = TRUE)



Binary file added data/amewoo.rda
Binary file not shown.
Binary file added data/rewbla.rda
Binary file not shown.
Binary file added data/rewbla_intervals.rda
Binary file not shown.
Binary file added data/rewbla_observations.rda
Binary file not shown.
Binary file added data/states.rda
Binary file not shown.
29 changes: 19 additions & 10 deletions inst/WORDLIST
Original file line number Diff line number Diff line change
@@ -1,26 +1,35 @@
Auer
BSM
birdflow
BirdFlow
BirdFlowModels
BirdFlowR
Birdflow
CMD
BSM
Burgin
Celis
CMD
Crowe
doi
Dunham
eBird
ebirdst
github
Hochachka
https
Jaromczyk
Ligocki
Mackey
Malorodova
Nakash
Rodewald
Strimas
birdflow
doi
eBird
ebirdst
github
https
natively
Pantoja
preprocessed
rewbla
rnaturalearthhires
Rodewald
Sharma
Stillman
Stokowski
Strimas
WZTW

Loading
Loading