Skip to content

Commit

Permalink
Spooky cleaning πŸŽƒ 2023 (#255)
Browse files Browse the repository at this point in the history
* Spooky cleaning πŸŽƒ 2023

* Vendor renv once more
  • Loading branch information
juliasilge authored Nov 1, 2023
1 parent 5d3fd53 commit 82f08aa
Show file tree
Hide file tree
Showing 23 changed files with 596 additions and 222 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ jobs:
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- uses: actions/checkout@v3

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
covr::codecov(
quiet = FALSE,
clean = FALSE,
install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package")
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
)
shell: Rscript {0}

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
YEAR: 2021
YEAR: 2023
COPYRIGHT HOLDER: vetiver authors
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MIT License

Copyright (c) 2021 vetiver authors
Copyright (c) 2023 vetiver authors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions R/attach-pkgs.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ load_pkgs <- function(pkgs) {
namespace_handling(pkgs, loadNamespace, "Namespace(s) could not be loaded:")
}

namespace_handling <- function(pkgs, func, error_msg) {
namespace_handling <- function(pkgs, func, error_msg, call = rlang::caller_env()) {
safe_load <- safely(withr::with_preserve_seed(func))
did_load <- map(pkgs, safe_load)
bad <- compact(map(did_load, "error"))
bad <- map_chr(bad, "package")
if (length(bad) >= 1) {
abort(c(error_msg, bad))
abort(c(error_msg, bad), call = call)
}

invisible(TRUE)
Expand Down
4 changes: 2 additions & 2 deletions R/handlers.R
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ vetiver_type_convert <- function(new_data, ptype) {
new_data
}

type_convert_strict <- function(new_data, col_types) {
type_convert_strict <- function(new_data, col_types, call = rlang::caller_env()) {
warn_to_error <- function(e) {
abort(conditionMessage(e))
abort(conditionMessage(e), call = call)
}

tryCatch(
Expand Down
4 changes: 2 additions & 2 deletions R/prototype.R
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ expr_contains <- function(expr, what) {
)
}

call_contains <- function(expr, what) {
call_contains <- function(expr, what, call = rlang::caller_env()) {
if (length(expr) == 0L) {
abort("Internal error, `expr` should be at least length 1.")
abort("Internal error, `expr` should be at least length 1.", call = call)
}

# Recurse into elements
Expand Down
6 changes: 3 additions & 3 deletions R/renv.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

#
# renv 1.0.1.9000 [rstudio/renv#9f4cbe1]: A dependency management toolkit for R.
# Generated using `renv:::vendor()` at 2023-08-14 12:25:04.
# renv 1.0.3.9000 [rstudio/renv#4b11818]: A dependency management toolkit for R.
# Generated using `renv:::vendor()` at 2023-10-31 16:35:16.988562.
#


Expand Down Expand Up @@ -70,7 +70,7 @@ renv$initialize <- function() {
# initialize metadata
renv$the$metadata <- list(
embedded = TRUE,
version = structure("1.0.1.9000", sha = "9f4cbe1e1024a31a9fc0601d3cd4e44edb86b728")
version = structure("1.0.3.9000", sha = "4b11818ca81897f10bf1def73db6b69c9fd1af0f")
)

# run our load / attach hooks so internal state is initialized
Expand Down
5 changes: 3 additions & 2 deletions R/write-docker.R
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ vetiver_required_pkgs <- function(pkgs) {
sort(unique(pkgs))
}

glue_sys_reqs <- function(pkgs) {
glue_sys_reqs <- function(pkgs, call = rlang::caller_env()) {
rlang::check_installed(c("curl", "jsonlite"))
rspm <- Sys.getenv("RSPM_ROOT", DEFAULT_RSPM)
rspm_repo_id <- Sys.getenv("RSPM_REPO_ID", DEFAULT_RSPM_REPO_ID)
Expand All @@ -153,7 +153,7 @@ glue_sys_reqs <- function(pkgs) {
res <- curl::curl_fetch_memory(req_url)
sys_reqs <- jsonlite::fromJSON(rawToChar(res$content), simplifyVector = FALSE)
if (!is.null(sys_reqs$error)) {
rlang::abort(sys_reqs$error)
rlang::abort(sys_reqs$error, call = call)
}
sys_reqs <- map(sys_reqs$requirements, pluck, "requirements", "packages")
sys_reqs <- sort(unique(unlist(sys_reqs)))
Expand All @@ -173,6 +173,7 @@ glue_sys_reqs <- function(pkgs) {
#' function to create these needed files in the directory located at `path`.
#'
#' @inheritParams vetiver_write_plumber
#' @par
#' @inheritParams vetiver_deploy_rsconnect
#' @param path A path to write the Plumber file, Dockerfile, and lockfile,
#' capturing the model's dependencies.
Expand Down
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ knitr::opts_chunk$set(
)
```

# vetiver <a href='https://rstudio.github.io/vetiver-r/'><img src="man/figures/logo.png" align="right" height="138" /></a>
# vetiver <a href="https://rstudio.github.io/vetiver-r/"><img src="man/figures/logo.png" align="right" height="138" alt="vetiver website" /></a>

<!-- badges: start -->
[![R-CMD-check](https://github.com/rstudio/vetiver-r/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/rstudio/vetiver-r/actions/workflows/R-CMD-check.yaml)
Expand Down
48 changes: 24 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

<!-- README.md is generated from README.Rmd. Please edit that file -->

# vetiver <a href='https://rstudio.github.io/vetiver-r/'><img src="man/figures/logo.png" align="right" height="138" /></a>
# vetiver <a href="https://rstudio.github.io/vetiver-r/"><img src="man/figures/logo.png" align="right" height="138" alt="vetiver website" /></a>

<!-- badges: start -->

Expand All @@ -24,23 +24,23 @@ API endpoint. The vetiver package is extensible, with generics that can
support many kinds of models, and available for both R and Python. To
learn more about vetiver, see:

- the documentation at <https://vetiver.rstudio.com/>
- the Python package at <https://rstudio.github.io/vetiver-python/>
- the documentation at <https://vetiver.rstudio.com/>
- the Python package at <https://rstudio.github.io/vetiver-python/>

You can use vetiver with:

- a [tidymodels](https://www.tidymodels.org/) workflow (including
[stacks](https://stacks.tidymodels.org/))
- [caret](https://topepo.github.io/caret/)
- [mlr3](https://mlr3.mlr-org.com/)
- [XGBoost](https://xgboost.readthedocs.io/en/latest/R-package/)
- [ranger](https://cran.r-project.org/package=ranger)
- [`lm()`](https://stat.ethz.ch/R-manual/R-patched/library/stats/html/lm.html)
and
[`glm()`](https://stat.ethz.ch/R-manual/R-patched/library/stats/html/glm.html)
- GAMS fit with [mgcv](https://CRAN.R-project.org/package=mgcv)
- [keras](https://tensorflow.rstudio.com/)
- [the luz API for torch](https://torch.mlverse.org/)
- a [tidymodels](https://www.tidymodels.org/) workflow (including
[stacks](https://stacks.tidymodels.org/))
- [caret](https://topepo.github.io/caret/)
- [mlr3](https://mlr3.mlr-org.com/)
- [XGBoost](https://xgboost.readthedocs.io/en/latest/R-package/)
- [ranger](https://cran.r-project.org/package=ranger)
- [`lm()`](https://stat.ethz.ch/R-manual/R-patched/library/stats/html/lm.html)
and
[`glm()`](https://stat.ethz.ch/R-manual/R-patched/library/stats/html/glm.html)
- GAMS fit with [mgcv](https://CRAN.R-project.org/package=mgcv)
- [keras](https://tensorflow.rstudio.com/)
- [the luz API for torch](https://torch.mlverse.org/)

## Installation

Expand Down Expand Up @@ -160,14 +160,14 @@ This project is released with a [Contributor Code of
Conduct](https://www.contributor-covenant.org/version/2/1/CODE_OF_CONDUCT.html).
By contributing to this project, you agree to abide by its terms.

- For questions and discussions about modeling, machine learning, and
MLOps please [post on RStudio
Community](https://community.rstudio.com/new-topic?category_id=15&tags=vetiver,question).
- For questions and discussions about modeling, machine learning, and
MLOps please [post on RStudio
Community](https://community.rstudio.com/new-topic?category_id=15&tags=vetiver,question).

- If you think you have encountered a bug, please [submit an
issue](https://github.com/rstudio/vetiver-r/issues).
- If you think you have encountered a bug, please [submit an
issue](https://github.com/rstudio/vetiver-r/issues).

- Either way, learn how to create and share a
[reprex](https://reprex.tidyverse.org/articles/articles/learn-reprex.html)
(a minimal, reproducible example), to clearly communicate about your
code.
- Either way, learn how to create and share a
[reprex](https://reprex.tidyverse.org/articles/articles/learn-reprex.html)
(a minimal, reproducible example), to clearly communicate about your
code.
1 change: 1 addition & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
url: https://rstudio.github.io/vetiver-r/
template:
bootstrap: 5
package: tidytemplate
Expand Down
Loading

0 comments on commit 82f08aa

Please sign in to comment.