Skip to contents

Consolidates the back compatibility fixes that were previously scattered across several functions (predict(), route(), route_between(), predict_between(), truncate_birdflow(), and others) into one place. Running upgrade_birdflow() on an already current object is a no-op.

Usage

upgrade_birdflow(bf)

Arguments

bf

A BirdFlow object.

Value

The upgraded BirdFlow object.

Details

upgrade_birdflow():

  1. Fixes the old birdFlowr_version metadata name typo.

  2. Backfills metadata$timestep_padding via get_timestep_padding() if missing.

  3. Backfills metadata fields that are missing entirely (added in later versions of the package) with new_BirdFlow()'s schema defaults, without overwriting any field that's already present.

  4. Backfills dates$week with 1:52 if missing and the model has 52 timesteps.

  5. Adds a dynamic mask via add_dynamic_mask() if the object doesn't already have one.

Examples

# \donttest{
bf <- upgrade_birdflow(BirdFlowExamples::amewoo)
# }