Skip to content

Commit

Permalink
hard-deprecate old functions
Browse files Browse the repository at this point in the history
  • Loading branch information
petrbouchal committed Apr 5, 2024
1 parent 93c2bcc commit 9daf263
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# statnipokladna (development version)

* hard-deprecate functions with old naming scheme (those not starting with `sp_`); they will be removed in the next release

# statnipokladna 0.7.3

* `sp_get_table()` can now handle CSV files with non-standard header rows in the format '"Výkaz"ZC_VYKAZ:ZC_VYKAZ"', fixes #94
Expand Down
4 changes: 2 additions & 2 deletions R/codelists.R
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ sp_get_codelist_url <- function(codelist_id, check_if_exists = TRUE) {
add_codelist <- function(data, codelist = NULL, period_column = .data$vykaz_date,
redownload = FALSE,
dest_dir = NULL) {
lifecycle::deprecate_warn("0.5.2", "statnipokladna::add_codelist()", "sp_add_codelist()")
lifecycle::deprecate_stop("0.5.2", "statnipokladna::add_codelist()", "sp_add_codelist()")
sp_add_codelist(data = data, codelist = codelist, period_column = period_column,
redownload = redownload, dest_dir = dest_dir)
}
Expand All @@ -392,6 +392,6 @@ add_codelist <- function(data, codelist = NULL, period_column = .data$vykaz_date
#' @family Core workflow

get_codelist <- function(codelist_id, n = NULL, dest_dir = NULL, redownload = FALSE) {
lifecycle::deprecate_warn("0.5.2", "statnipokladna::get_codelist()", "sp_get_codelist()")
lifecycle::deprecate_stop("0.5.2", "statnipokladna::get_codelist()", "sp_get_codelist()")
sp_get_codelist(codelist_id = codelist_id, n = n, dest_dir = dest_dir, redownload = redownload)
}
4 changes: 2 additions & 2 deletions R/datasets.R
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ sp_get_dataset <- function(dataset_id, year, month = 12,
#' @export
get_dataset <- function(dataset_id, year, month = 12,
dest_dir = NULL, redownload = FALSE) {
lifecycle::deprecate_warn("0.5.2", "statnipokladna::get_dataset()", "sp_get_dataset()")
lifecycle::deprecate_stop("0.5.2", "statnipokladna::get_dataset()", "sp_get_dataset()")
sp_get_dataset(dataset_id = dataset_id, year = year, month = month,
dest_dir = dest_dir, redownload = redownload)
}
Expand All @@ -212,6 +212,6 @@ get_dataset <- function(dataset_id, year, month = 12,
#' @return a [tibble][tibble::tibble-package]
#' @export
get_dataset_doc <- function(dataset_id, dest_dir = ".", download = TRUE) {
lifecycle::deprecate_warn("0.5.2", "statnipokladna::get_dataset_doc()", "sp_get_dataset_doc()")
lifecycle::deprecate_stop("0.5.2", "statnipokladna::get_dataset_doc()", "sp_get_dataset_doc()")
sp_get_dataset_doc(dataset_id = dataset_id, dest_dir = dest_dir, download = download)
}
2 changes: 1 addition & 1 deletion R/tables.R
Original file line number Diff line number Diff line change
Expand Up @@ -349,5 +349,5 @@ sp_get_table <- function(table_id, year, month = 12, ico = NULL,
#' @export
get_table <- function(table_id, year, month = 12, ico = NULL,
redownload = FALSE, dest_dir = NULL) {
lifecycle::deprecate_warn("0.5.2", "statnipokladna::get_table()", "sp_get_table()")
lifecycle::deprecate_stop("0.5.2", "statnipokladna::get_table()", "sp_get_table()")
}

0 comments on commit 9daf263

Please sign in to comment.