Skip to content

Commit

Permalink
Merge pull request #550 from cmu-delphi/dev
Browse files Browse the repository at this point in the history
Sync dev -> main
  • Loading branch information
dshemetov authored Oct 21, 2024
2 parents 7bf94e3 + 6ed820b commit eba082b
Show file tree
Hide file tree
Showing 110 changed files with 4,650 additions and 4,106 deletions.
6 changes: 5 additions & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,8 @@
^DEVELOPMENT.md$
man-roxygen
^.venv$
^sandbox.R$
^sandbox.R$
^README.Rmd$
^README_cache$
^pkgdown-watch.R$
^.editorconfig$
21 changes: 21 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org

root = true


[*]

# Change these settings to your own preference
indent_style = space
indent_size = 2

# We recommend you to keep these unchanged
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,9 @@ docs
renv/
renv.lock
.Rprofile
sandbox.R
sandbox.R
# Vignette caches
*_cache/
vignettes/*.html
vignettes/*.R
!vignettes/_common.R
32 changes: 20 additions & 12 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: epiprocess
Type: Package
Title: Tools for basic signal processing in epidemiology
Version: 0.9.0
Version: 0.9.6
Authors@R: c(
person("Jacob", "Bien", role = "ctb"),
person("Logan", "Brooks", , "[email protected]", role = c("aut", "cre")),
Expand All @@ -20,13 +20,19 @@ Authors@R: c(
person("Hadley", "Wickham", role = "ctb",
comment = "Author of included rlang fragments"),
person("Posit", role = "cph",
comment = "Copyright holder of included rlang fragments")
comment = "Copyright holder of included rlang fragments"),
person("Johns Hopkins University Center for Systems Science and Engineering", role = "dtc",
comment = "Owner of COVID-19 cases and deaths data from the COVID-19 Data Repository"),
person("Johns Hopkins University", role = "cph",
comment = "Copyright holder of COVID-19 cases and deaths data from the COVID-19 Data Repository"),
person("Carnegie Mellon University Delphi Group", role = "dtc",
comment = "Owner of claims-based CLI data from the Delphi Epidata API")
)
Description: This package introduces a common data structure for
epidemiological data reported by location and time, provides another
data structure to work with revisions to these data sets over time,
and offers associated utilities to perform basic signal processing
tasks.
Description: This package introduces common data structures for working with
epidemiological data reported by location and time and offers associated
utilities to perform basic signal processing tasks. The package is designed
to be used in conjunction with `epipredict` for building and evaluating
epidemiological models.
License: MIT + file LICENSE
URL: https://cmu-delphi.github.io/epiprocess/
Depends:
Expand All @@ -35,7 +41,8 @@ Imports:
checkmate,
cli,
data.table,
dplyr (>= 1.0.8),
dplyr (>= 1.1.0),
epidatasets,
genlasso,
ggplot2,
glue,
Expand All @@ -53,17 +60,19 @@ Imports:
vctrs,
waldo
Suggests:
covidcast,
devtools,
epidatr,
here,
knitr,
outbreaks,
readr,
rmarkdown,
testthat (>= 3.1.5),
withr
VignetteBuilder:
knitr
Remotes:
cmu-delphi/epidatasets,
cmu-delphi/epidatr,
glmgen/genlasso,
reconverse/outbreaks
Expand All @@ -78,10 +87,9 @@ Collate:
'archive.R'
'autoplot.R'
'correlation.R'
'data.R'
'epi_df.R'
'epi_df_forbidden_methods.R'
'epiprocess.R'
'epiprocess-package.R'
'group_by_epi_df_methods.R'
'methods-epi_archive.R'
'grouped_epi_archive.R'
Expand Down
34 changes: 16 additions & 18 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
## Setting up the development environment

```r
install.packages(c('devtools', 'pkgdown', 'styler', 'lintr')) # install dev dependencies
devtools::install_deps(dependencies = TRUE) # install package dependencies
devtools::document() # generate package meta data and man files
devtools::build() # build package
install.packages(c('devtools', 'pkgdown', 'styler', 'lintr', 'pak')) # install dev dependencies
pak::pkg_install(".") # install package and dependencies
```

## Validating the package
Expand All @@ -13,8 +11,12 @@ devtools::build() # build package
styler::style_pkg() # format code
lintr::lint_package() # lint code

devtools::check() # run R CMD check, which runs everything below
devtools::document() # generate package meta data and man files
devtools::test() # test package
devtools::check() # check package for errors
devtools::build_vignettes() # build vignettes only
devtools::run_examples() # run doc examples
devtools::check(vignettes = FALSE) # check package without vignettes
```

## Developing the documentation site
Expand All @@ -24,20 +26,16 @@ Our CI builds two version of the documentation:
- https://cmu-delphi.github.io/epiprocess/ from the `main` branch and
- https://cmu-delphi.github.io/epiprocess/dev from the `dev` branch.

The documentation site can be previewed locally by running in R:

```r
# Should automatically open a browser
pkgdown::build_site(preview=TRUE)
```

If the above does not open a browser, you can try using a Python server from the
command line:
We include the script `pkgdown-watch.R` that will automatically rebuild the
documentation locally and preview it. It can be used with:

```bash
R -e 'devtools::document()'
R -e 'pkgdown::build_site()'
python -m http.server -d docs
```sh
# Make sure you have servr installed
R -e 'renv::install("servr")'
# Will start a local server
Rscript pkgdown-watch.R
# You may need to first build the site with
R -e 'pkgdown::build_site(".", examples = FALSE, devel = TRUE, preview = FALSE)'
```

## Versioning
Expand Down
10 changes: 6 additions & 4 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ S3method(key_colnames,default)
S3method(key_colnames,epi_archive)
S3method(key_colnames,epi_df)
S3method(mean,epi_df)
S3method(next_after,Date)
S3method(next_after,integer)
S3method(print,epi_archive)
S3method(print,epi_df)
S3method(print,grouped_epi_archive)
Expand All @@ -59,8 +57,13 @@ export(as_epi_archive)
export(as_epi_df)
export(as_tsibble)
export(autoplot)
export(cases_deaths_subset)
export(clone)
export(complete)
export(covid_case_death_rates_extended)
export(covid_incidence_county_subset)
export(covid_incidence_outliers)
export(deprecated_quo_is_present)
export(detect_outlr)
export(detect_outlr_rm)
export(detect_outlr_stl)
Expand All @@ -85,11 +88,9 @@ export(guess_period)
export(is_epi_df)
export(is_grouped_epi_archive)
export(key_colnames)
export(max_version_with_row_in)
export(mutate)
export(new_epi_archive)
export(new_epi_df)
export(next_after)
export(relocate)
export(rename)
export(revision_summary)
Expand All @@ -100,6 +101,7 @@ export(ungroup)
export(unnest)
export(validate_epi_archive)
export(version_column_names)
import(epidatasets)
importFrom(checkmate,anyInfinite)
importFrom(checkmate,anyMissing)
importFrom(checkmate,assert)
Expand Down
32 changes: 32 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,38 @@

Pre-1.0.0 numbering scheme: 0.x will indicate releases, while 0.x.y will indicate PR's.

# epiprocess 0.10

## Breaking changes

- Moved example datasets from being hosted in the package to being reexported
from the `epidatasets` package. The datasets can no longer be loaded with
`data()` but can be accessed with `epiprocess::` or, after loading the
package, just the name of the dataset (#520). Those with names starting with
`jhu` have been renamed to a more uniform scheme and now have names starting
with `covid`. The data set previously named `jhu_confirmed_cumulative_num` has
been removed from the package, but a renamed version is has been removed from
the package, but a renamed version is still available in `epidatasets`.

## Bug fixes

- Removed `.window_size = 1` default from `epi_slide_{mean,sum,opt}`; this
argument is now mandatory, and should nearly always be greater than 1 except
for testing purposes.

## Improvements

- `epi_slide` and `epix_slide` now provide some hints if you forget a `~` when
using a formula to specify the slide computation, and other bits of forgotten
syntax.
- Improved validation of `.window_size` arguments.
- Rewrote a lot of the package documentation to be more consistent and
informative. Simplified and streamlined the vignettes.

## Cleanup

- Removed vignette dependency on `covidcast`.

# epiprocess 0.9

## Breaking changes
Expand Down
Loading

0 comments on commit eba082b

Please sign in to comment.