Skip to content

Commit

Permalink
fixes bug with cli and closes #49
Browse files Browse the repository at this point in the history
  • Loading branch information
DHLocke committed Mar 27, 2024
1 parent 7528b99 commit 9b4ace8
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: sfdep
Title: Spatial Dependence for Simple Features
Version: 0.2.4
Version: 0.2.4.9000
Authors@R: c(
person("Josiah", "Parry", , "[email protected]", role = c("aut"),
comment = c(ORCID = "0000-0001-9910-865X")),
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# sfdep (development version)

- fixes bug with cli and closes #49

# sfdep 0.2.4

- Dexter Locke is now the maintainer of sfdep
Expand Down
4 changes: 2 additions & 2 deletions R/spacetime-constructor.R
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ validate_spacetime <- function(.data, .geometry, .loc_col, .time_col) {
if (!identical(.data_loc_class, .geo_loc_class)) {
cli::cli_abort(
c("Differing class types for {.var .loc_col}.",
i = "{.var .data}: {.cls {.data_loc_class}}",
"i" = "{.var .geometry}: {.cls {.geo_loc_class}}.")
i = "{.var .data}: {.cls {(.data_loc_class)}}",
"i" = "{.var .geometry}: {.cls {(.geo_loc_class)}}.")
)
}

Expand Down
12 changes: 12 additions & 0 deletions tests/testthat/test-spacetime-constructor_cli_update_patch.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
test_that("local_g_perm", {
df_fp <- system.file("extdata", "bos-ecometric.csv", package = "sfdep")
geo_fp <- system.file("extdata", "bos-ecometric.geojson", package = "sfdep")

# read in data
df <- read.csv(
df_fp, colClasses = c("numeric", "character", "integer", "double", "Date")
)

geo <- sf::st_read(geo_fp)
expect_error(spacetime(df, geo, ".region_id", "year"))
})

0 comments on commit 9b4ace8

Please sign in to comment.