Skip to content

Commit bf96a1d

Browse files
committed
Add changelog (NEWS.md), associated pkgdown styling
1 parent 66d1172 commit bf96a1d

File tree

3 files changed

+311
-1
lines changed

3 files changed

+311
-1
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Type: Package
22
Package: epiprocess
33
Title: Tools for basic signal processing in epidemiology
4-
Version: 1.0.0
4+
Version: 0.5.0.9999
55
Authors@R: c(
66
person("Jacob", "Bien", role = "ctb"),
77
person("Logan", "Brooks", role = "aut"),

NEWS.md

Lines changed: 241 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,241 @@
1+
# epiprocess 0.5.0.9999 (dev version)
2+
3+
## Cleanup:
4+
5+
* Added a `NEWS.md` file to track changes to the package.
6+
7+
# epiprocess 0.5.0:
8+
9+
## Potentially-breaking changes:
10+
11+
* `epix_slide`, `<epi_archive>$slide` now feed `f` an `epi_df` rather than
12+
converting to a tibble/`tbl_df` first, allowing use of `epi_df` methods and
13+
metadata, and often yielding `epi_df`s out of the slide as a result. To obtain
14+
the old behavior, convert to a tibble within `f`.
15+
16+
## Improvements:
17+
18+
* Fixed `epix_merge`, `<epi_archive>$merge` always raising error on `sync="truncate"`
19+
20+
## Cleanup:
21+
22+
* Added `Remotes:` entry for `genlasso`, which was removed from CRAN
23+
* Added `as_epi_archive` tests
24+
* Added missing `epix_merge` test for `sync="truncate"`
25+
26+
# epiprocess 0.4.0:
27+
28+
## Potentially-breaking changes:
29+
30+
* Fixed `[.epi_df` to not reorder columns, which was incompatible with
31+
downstream packages.
32+
* Changed `[.epi_df` decay-to-tibble logic to more coherent with `epi_df`s
33+
current tolerance of nonunique keys: stopped decaying to a tibble in some
34+
cases where a unique key wouldn't have been preserved, since we don't
35+
enforce a unique key elsewhere.
36+
* Fixed `[.epi_df` to adjust `"other_keys"` metadata when corresponding
37+
columns are selected out.
38+
* Fixed `[.epi_df` to raise an error if resulting column names would be
39+
nonunique.
40+
* Fixed `[.epi_df` to drop metadata if decaying to a tibble (due to removal
41+
of essential columns).
42+
43+
## Improvements:
44+
45+
* Added check that `epi_df` `additional_metadata` is list.
46+
* Fixed some incorrect `as_epi_df` examples.
47+
48+
## Cleanup:
49+
50+
* Applied rename of upstream package in examples: `delphi.epidata` ->
51+
`epidatr`.
52+
* Rounded out `[.epi_df` tests.
53+
54+
# epiprocess 0.3.0:
55+
56+
## Breaking changes:
57+
58+
* `as_epi_archive`, `epi_archive$new`:
59+
* Compactification (see below) by default may change results if working
60+
directly with the `epi_archive`'s `DT` field; to disable, pass in
61+
`compactify=FALSE`.
62+
* `epi_archive`'s wrappers and R6 methods have been updated to follow these
63+
rules regarding reference semantics:
64+
* `epix_<method>` will not mutate input `epi_archive`s, but may alias them
65+
or alias their fields (which should not be a worry if a user sticks to
66+
these `epix_*` functions and "regular" R functions with
67+
copy-on-write-like behavior, avoiding mutating functions `[.data.table`)
68+
* `x$<method>` may mutate `x`; if it mutates `x`, it will return `x`
69+
invisibly (where this makes sense), and, for each of its fields, may
70+
either mutate the object to which it refers or reseat the reference (but
71+
not both); if `x$<method>` does not mutate `x`, its result may contain
72+
aliases to `x` or its fields.
73+
* `epix_merge`, `<epi_archive>$merge`:
74+
* Removed `...`, `locf`, and `nan` parameters.
75+
* Changed the default behavior, which now corresponds to using
76+
`by=key(x$DT)` (but demanding that is the same set of column names as
77+
`key(y$DT)`), `all=TRUE`, `locf=TRUE`, `nan=NaN` (but with the
78+
post-filling step fixed to only apply to gaps, and no longer fill over
79+
`NA`s originating from `x$DT` and `y$DT`).
80+
* `x` and `y` are no longer allowed to share names of non-`by` columns.
81+
* `epix_merge` no longer mutates its `x` argument (but `$merge` continues
82+
to do so).
83+
* Removed (undocumented) capability of passing a `data.table` as `y`.
84+
* `epix_slide`:
85+
* Removed inappropriate/misleading `n=7` default argument (due to
86+
reporting latency, `n=7` will *not* yield 7 days of data in a typical
87+
daily-reporting surveillance data source, as one might have assumed).
88+
89+
## New features:
90+
91+
* `as_epi_archive`, `epi_archive$new`:
92+
* New `compactify` parameter allows removal of rows that are redundant for the
93+
purposes of `epi_archive`'s methods, which use the last version of each
94+
observation carried forward.
95+
* New `clobberable_versions_start` field allows marking a range of versions
96+
that could be "clobbered" (rewritten without assigning new version
97+
tags); previously, this was hard-coded as `max(<epi_archive>$DT$version)`.
98+
* New `versions_end` field allows marking a range of versions beyond
99+
`max(<epi_archive>$DT$version)` that were observed, but contained no
100+
changes.
101+
* `epix_merge`, `$merge`:
102+
* New `sync` parameter controls what to do if `x` and `y` aren't equally
103+
up to date (i.e., if `x$versions_end` and `y$versions_end` are
104+
different).
105+
* New function `epix_fill_through_version`, method
106+
`<epi_archive>$fill_through_version`: non-mutating & mutating way to
107+
ensure that an archive contains versions at least through some
108+
`fill_versions_end`, extrapolating according to `how` if necessary
109+
* Example archive data object is now constructed on demand from its
110+
underlying data, so it will be based on the user's version of
111+
`epi_archive` rather than an outdated R6 implementation from whenever the
112+
data object was generated.
113+
114+
# epiprocess 0.2.0:
115+
116+
## Breaking changes:
117+
118+
* Removed default `n=7` argument to `epix_slide`.
119+
120+
## Improvements:
121+
122+
* Ignore `NA`s when printing `time_value` range for an `epi_archive`.
123+
* Fixed misleading column naming in `epix_slide` example.
124+
* Trimmed down `epi_slide` examples.
125+
* Synced out-of-date docs.
126+
127+
## Cleanup:
128+
129+
* Removed dependency of some `epi_archive` tests on an example archive.
130+
object, and made them more understandable by reading without running.
131+
* Fixed `epi_df` tests relying on S3 implementation external to `epiprocess`.
132+
* Added tests for `epi_archive` methods and wrapper functions.
133+
* Removed some dead code.
134+
* Made `.{Rbuild,git}ignore` files more comprehensive.
135+
136+
# epiprocess 0.1.2:
137+
138+
## New features:
139+
140+
* New `new_epi_df` function is similar to `as_epi_df`, but (i) recalculates,
141+
overwrites, and/or drops most metadata of `x` if it has any, (ii) may
142+
still reorder the columns of `x` even if it's already an `epi_df`, and
143+
(iii) treats `x` as optional, constructing an empty `epi_df` by default.
144+
145+
## Improvements:
146+
147+
* Fixed `geo_type` guessing on alphabetical strings with more than 2
148+
characters to yield `"custom"`, not US `"nation"`.
149+
* Fixed `time_type` guessing to actually detect `Date`-class `time_value`s
150+
regularly spaced 7 days apart as `"week"`-type as intended.
151+
* Improved printing of `epi_df`s, `epi_archives`s
152+
* Fixed `as_of` to not cut off any (forecast-like) data with `time_value >
153+
max_version`.
154+
* Expanded `epi_df` docs include conversion from `tsibble`/`tbl_ts` objects,
155+
usage of `other_keys`, and pre-processing objects not following the
156+
`geo_value`, `time_value` naming scheme.
157+
* Expanded `epi_slide` examples to show how to use an `f` argument with
158+
named parameters.
159+
* Updated examples to print relevant columns given a common 80-column
160+
terminal width.
161+
* Added growth rate examples.
162+
* Improved `as_epi_archive` and `epi_archive$new`/`$initialize`
163+
documentation, including constructing a toy archive.
164+
165+
## Cleanup:
166+
167+
* Added tests for `epi_slide`, `epi_cor`, and internal utility functions.
168+
* Fixed currently-unused internal utility functions `MiddleL`, `MiddleR` to
169+
yield correct results on odd-length vectors.
170+
171+
# epiprocess 0.1.1:
172+
173+
## New features:
174+
175+
* New example data objects allow one to quickly experiment with `epi_df`s
176+
and `epi_archives` without relying/waiting on an API to fetch data.
177+
178+
## Improvements:
179+
180+
* Improved `epi_slide` error messaging.
181+
* Fixed description of the appropriate parameters for an `f` argument to
182+
`epi_slide`; previous description would give incorrect behavior if `f` had
183+
named parameters that did not receive values from `epi_slide`'s `...`.
184+
* Added some examples throughout the package.
185+
* Using example data objects in vignettes also speeds up vignette compilation.
186+
* Cleanup:
187+
* Set up gh-actions CI.
188+
* Added tests for `epi_df`s.
189+
190+
# epiprocess 0.1.0
191+
192+
## Implemented core functionality, vignettes:
193+
194+
Classes:
195+
* `epi_df`: specialized `tbl_df` for geotemporal epidemiological time
196+
series data, with optional metadata recording other key columns (e.g.,
197+
demographic breakdowns) and `as_of` what time/version this data was
198+
current/published. Associated functions:
199+
* `as_epi_df` converts to an `epi_df`, guessing the `geo_type`,
200+
`time_type`, `other_keys`, and `as_of` if not specified.
201+
* `as_epi_df.tbl_ts` and `as_tsibble.epi_df` automatically set
202+
`other_keys` and `key`&`index`, respectively.
203+
* `epi_slide` applies a user-supplied computation to a sliding/rolling
204+
time window and user-specified groups, adding the results as new
205+
columns, and recycling/broadcasting results to keep the result size
206+
stable. Allows computation to be provided as a function, `purrr`-style
207+
formula, or tidyeval dots. Uses `slider` underneath for efficiency.
208+
* `epi_cor` calculates Pearson, Kendall, or Spearman correlations
209+
between two (optionally time-shifted) variables in an `epi_df` within
210+
user-specified groups.
211+
* Convenience function: `is_epi_df`
212+
* `epi_archive`: R6 class for version (patch) data for geotemporal
213+
epidemiological time series data sets. Comes with S3 methods and regular
214+
functions wrappers for those unfamiliar with R6 methods. Associated functions:
215+
* `as_epi_archive`: prepares an `epi_archive` object from a data frame
216+
containing snapshots and/or patch data for every available version of
217+
the data set.
218+
* `as_of`: extracts a snapshot of the data set as of some requested
219+
version, in `epi_df` format
220+
* `epix_slide`, `<epi_archive>$slide`: similar to `epi_slide`, but for
221+
`epi_archive`s; for each requested `ref_time_value` and group, applies
222+
a time window and user-specified computation to a snapshot of the data
223+
as of `ref_time_value`.
224+
* `epix_merge`, `<epi_archive>$merge`: like `merge` for `epi_archive`s,
225+
but allowing for the last version of each observation to be carried
226+
forward to fill in gaps in `x` or `y`.
227+
* Convenience function: `is_epi_archive`
228+
229+
Additional functions:
230+
* `growth_rate`: estimates growth rate of a time series using one of a few
231+
built-in `method`s based on relative change, linear regression,
232+
smoothing splines, or trend filtering.
233+
* `detect_outlr`: applies one or more outlier detection methods to a given
234+
signal variable, and optionally aggregates the outputs to create a
235+
consensus result
236+
* `detect_outlr_rm`: outlier detection function based on a
237+
rolling-median-based outlier detection function; one of the methods
238+
included in `detect_outlr`.
239+
* `detect_outlr_stl`: outlier detection function based on a seasonal-trend
240+
decomposition using LOESS (STL); one of the methods included in
241+
`detect_outlr`.

pkgdown/extra.scss

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
/* The news/changelog in pkgdown 2.0.6 is squashed relative to 1.6.1, and
2+
secondary headings are too prominent when using ## (but we can't change to
3+
### without impacting side navbar). Just trying a couple of bootswatches
4+
didn't seem to help, and nice template packages might be limited for use by
5+
particular own groups (e.g., tidytemplate).
6+
*/
7+
8+
/* Current approach: add some spacing with CSS, and change ## -> ### in the .md
9+
to get smaller fonts more easily.
10+
*/
11+
12+
/* General structure: div.template-news wraps everything of interest regarding
13+
the rendered NEWS.md. Within that, div.level2's wrap the each package version
14+
+ the changes for that version. (Within those,) h2.pkg-version's label the
15+
versions.
16+
*/
17+
18+
19+
20+
/* Matches the first-listed version's section. (This is written as a general
21+
rule, but the adjacent sibling rule with override it for non-first versions'
22+
sections. Using :first-child probably wouldn't work as a sibling
23+
div.page-header precedes the first div.level2.) */
24+
div.template-news div.level2 {
25+
margin-top: 1.5em;
26+
}
27+
28+
/* Matches subsequent versions' sections. Places more vspace between these
29+
sections than before the first section.
30+
*/
31+
div.template-news div.level2 + div.level2 {
32+
margin-top: 2.5em;
33+
}
34+
35+
/* Place some additional vspace after each version number heading; currently,
36+
the immediately following content is always a secondary heading, which looks
37+
weird with the default spacing.
38+
*/
39+
div.template-news h2.pkg-version {
40+
margin-bottom: 0.5em;
41+
}
42+
43+
/* Use `h4` styling for `h3`s (the ## headings); this is the only thing we need
44+
.scss for, and we could really just copy-paste in the appropriate value if
45+
needed: */
46+
div.template-news h3 {
47+
@extend h4;
48+
}
49+
50+
51+
/* Original approach, to be removed at some later time: try adding hrules before
52+
and after primary headings (version numbers). The initial "hrule" (actually a
53+
border) after the "Source:" pointer has a different color from natural
54+
hrules, so we need some custom CSS styling to get these colors to match and
55+
look okay:
56+
*/
57+
58+
/* .template-news .page-header { */
59+
/* /\* 1px solid to match original *\/ */
60+
/* /\* (original color was something like --bs-default which seemed to be set to */
61+
/* --bs-gray-300) *\/ */
62+
/* border-bottom: 1px solid var(--bs-secondary); */
63+
/* } */
64+
65+
/* .template-news hr { */
66+
/* height: 1px; /\* defensive *\/ */
67+
/* background-color: var(--bs-secondary); */
68+
/* opacity: 1; /\* counteracts a 0.25 setting somewhere *\/ */
69+
/* } */

0 commit comments

Comments
 (0)