Skip to content

epiprocess 0.3.0

Compare
Choose a tag to compare
@dshemetov dshemetov released this 15 Nov 22:59

Breaking changes

  • as_epi_archive, epi_archive$new:
    • Compactification (see below) by default may change results if working
      directly with the epi_archive's DT field; to disable, pass in
      compactify=FALSE.
  • epi_archive's wrappers and R6 methods have been updated to follow these
    rules regarding reference semantics:
    • epix_<method> will not mutate input epi_archives, but may alias them
      or alias their fields (which should not be a worry if a user sticks to
      these epix_* functions and "regular" R functions with
      copy-on-write-like behavior, avoiding mutating functions [.data.table).
    • x$<method> may mutate x; if it mutates x, it will return x
      invisibly (where this makes sense), and, for each of its fields, may
      either mutate the object to which it refers or reseat the reference (but
      not both); if x$<method> does not mutate x, its result may contain
      aliases to x or its fields.
  • epix_merge, <epi_archive>$merge:
    • Removed ..., locf, and nan parameters.
    • Changed the default behavior, which now corresponds to using
      by=key(x$DT) (but demanding that is the same set of column names as
      key(y$DT)), all=TRUE, locf=TRUE, nan=NaN (but with the
      post-filling step fixed to only apply to gaps, and no longer fill over
      NAs originating from x$DT and y$DT).
    • x and y are no longer allowed to share names of non-by columns.
    • epix_merge no longer mutates its x argument (but $merge continues
      to do so).
    • Removed (undocumented) capability of passing a data.table as y.
  • epix_slide:
    • Removed inappropriate/misleading n=7 default argument (due to
      reporting latency, n=7 will not yield 7 days of data in a typical
      daily-reporting surveillance data source, as one might have assumed).

New features

  • as_epi_archive, epi_archive$new:
    • New compactify parameter allows removal of rows that are redundant for the
      purposes of epi_archive's methods, which use the last version of each
      observation carried forward.
    • New clobberable_versions_start field allows marking a range of versions
      that could be "clobbered" (rewritten without assigning new version
      tags); previously, this was hard-coded as max(<epi_archive>$DT$version).
    • New versions_end field allows marking a range of versions beyond
      max(<epi_archive>$DT$version) that were observed, but contained no
      changes.
  • epix_merge, $merge:
    • New sync parameter controls what to do if x and y aren't equally
      up to date (i.e., if x$versions_end and y$versions_end are
      different).
  • New function epix_fill_through_version, method
    <epi_archive>$fill_through_version: non-mutating & mutating way to
    ensure that an archive contains versions at least through some
    fill_versions_end, extrapolating according to how if necessary.
  • Example archive data object is now constructed on demand from its
    underlying data, so it will be based on the user's version of
    epi_archive rather than an outdated R6 implementation from whenever the
    data object was generated.

Full Changelog: https://github.com/cmu-delphi/epiprocess/commits/v0.3.0