Skip to content

Commit

Permalink
Remove deprecated functions
Browse files Browse the repository at this point in the history
  • Loading branch information
bodkan committed Apr 21, 2022
1 parent 2915900 commit 985b451
Show file tree
Hide file tree
Showing 19 changed files with 7 additions and 517 deletions.
11 changes: 0 additions & 11 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Generated by roxygen2: do not edit by hand

S3method(as.phylo,slendr_phylo)
S3method(plot,slendr)
S3method(print,slendr_map)
S3method(print,slendr_model)
S3method(print,slendr_pop)
Expand All @@ -11,38 +10,28 @@ export("%>%")
export(animate_model)
export(area)
export(as.phylo.slendr_phylo)
export(boundary)
export(check_env)
export(clear_env)
export(compile)
export(compile_model)
export(dispersal)
export(distance)
export(expand)
export(expand_range)
export(explore)
export(explore_model)
export(gene_flow)
export(geneflow)
export(join)
export(move)
export(msprime)
export(overlap)
export(plot_graph)
export(plot_map)
export(plot_model)
export(population)
export(read)
export(read_model)
export(region)
export(reproject)
export(resize)
export(sampling)
export(schedule_sampling)
export(set_dispersal)
export(set_range)
export(setup_env)
export(shrink)
export(shrink_range)
export(slim)
export(subtract)
Expand Down
20 changes: 1 addition & 19 deletions R/compilation.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
#' present? Useful for non-interactive uses. In an interactive mode, the user
#' is asked to confirm the deletion manually.
#' @param description Optional short description of the model
#' @param dir Deprecated. Use \code{path} instead.
#' @param geneflow Deprecated. Use \code{gene_flow} instead.
#'
#' @return Compiled \code{slendr_model} model object
#'
Expand All @@ -47,25 +45,9 @@ compile_model <- function(populations, generation_time, path = NULL, resolution
gene_flow = list(), overwrite = FALSE, force = FALSE,
sim_length = NULL, direction = NULL,
slim_script = system.file("scripts", "script.slim", package = "slendr"),
description = "", dir = NULL, geneflow = list()) {
description = "") {
if (inherits(populations, "slendr_pop")) populations <- list(populations)

if (!is.null(dir) && is.null(path)) {
warning("The `dir =` argument of `compile_model()` is now deprecated",
" as part\nof cleaning up and unifying the function interfaces across the\n",
"entire package. Please consider moving to `path = ` at some point.",
call. = FALSE)
path <- dir
}

if (length(geneflow) > 0) {
warning("The `geneflow =` argument of `compile_model()` is now deprecated",
" as part\nof cleaning up and unifying the function interfaces across the\n",
"entire package. Please consider moving to `gene_flow = ` at some point.",
call. = FALSE)
gene_flow <- geneflow
}

if (is.null(path)) path <- tempfile()

map <- get_map(populations[[1]])
Expand Down
100 changes: 0 additions & 100 deletions R/deprecate.R
Original file line number Diff line number Diff line change
@@ -1,100 +0,0 @@
#' Deprecated function
#' @inheritParams expand_range
#' @export
expand <- function(pop, by, end, start, overlap = 0.8, snapshots = NULL,
polygon = NULL, lock = FALSE, verbose = TRUE) {
.Deprecated("expand_range")
expand_range(pop, by, end, start, overlap, snapshots = NULL,
polygon = NULL, lock, verbose)
}

#' Deprecated function
#' @inheritParams shrink_range
#' @export
shrink <- function(pop, by, end, start, overlap = 0.8, snapshots = NULL,
lock = FALSE, verbose = TRUE) {
.Deprecated("shrink_range")
expand_range(pop, by, end, start, overlap, snapshots = NULL,
polygon = NULL, lock, verbose)
}

#' Deprecated function
#' @inheritParams plot_model
#' @export
plot_graph <- function(model) .Deprecated("plot_model")

#' Deprecated function
#' @inheritParams explore_model
#' @export
explore <- function(model) {
.Deprecated("explore_model")
explore_model(model)
}

#' Deprecated function
#' @inheritParams compile_model
#' @export
compile <- function(populations, generation_time, path = NULL, resolution = NULL,
competition = NULL, mating = NULL, dispersal = NULL,
geneflow = list(), overwrite = FALSE,
sim_length = NULL, direction = NULL,
slim_script = system.file("scripts", "script.slim", package = "slendr"),
description = "", dir = NULL) {
.Deprecated("compile_model")
compile_model(
populations, generation_time, path, resolution, competition,
mating, dispersal, geneflow, overwrite, sim_length, direction,
slim_script, description, dir
)
}

#' Deprecated function
#' @inheritParams schedule_sampling
#' @export
sampling <- function(model, times, ..., locations = NULL, strict = FALSE) {
.Deprecated("schedule_sampling")
schedule_sampling(model, times, ..., locations, strict)
}

#' Deprecated function
#' @inheritParams read_model
#' @export
read <- function(path) {
.Deprecated("read_model")
read_model(path)
}

#' Deprecated function
#' @inheritParams set_dispersal
#' @export
dispersal <- function(pop, time, competition = NA, mating = NA, dispersal = NA,
dispersal_fun = NULL) {
.Deprecated("set_dispersal")
set_dispersal(pop, time, competition, mating, dispersal, dispersal_fun)
}

#' Deprecated function
#' @inheritParams set_range
#' @export
boundary <- function(pop, time, center = NULL, radius = NULL, polygon = NULL, lock = FALSE) {
.Deprecated("set_range")
set_range(pop, time, center, radius, polygon, lock)
}

#' Deprecated function
#' @inheritParams gene_flow
#' @export
geneflow <- function(from, to, rate, start, end, overlap = TRUE) {
.Deprecated("gene_flow")
gene_flow(from, to, rate, start, end, overlap)
}

#' Deprecated function
#' @inheritParams plot_map
#' @export
plot.slendr <- function(..., time = NULL, geneflows = FALSE,
graticules = "original",
intersect = TRUE, show_map = TRUE,
title = NULL, interpolated_maps = NULL) {
.Deprecated("plot_map")
}
32 changes: 0 additions & 32 deletions man/boundary.Rd

This file was deleted.

66 changes: 0 additions & 66 deletions man/compile.Rd

This file was deleted.

8 changes: 1 addition & 7 deletions man/compile_model.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 0 additions & 37 deletions man/dispersal.Rd

This file was deleted.

46 changes: 0 additions & 46 deletions man/expand.Rd

This file was deleted.

Loading

0 comments on commit 985b451

Please sign in to comment.