Skip to content

Commit

Permalink
Spring cleaning 🧼 (#52)
Browse files Browse the repository at this point in the history
* Update DESCRIPTION, CoC

* Update README, vignette

* Update GH actions
  • Loading branch information
juliasilge authored Mar 7, 2023
1 parent af83bc1 commit 1498c88
Show file tree
Hide file tree
Showing 11 changed files with 54 additions and 179 deletions.
2 changes: 1 addition & 1 deletion .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ representative at an online or offline event.
## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at codeofconduct@rstudio.com.
reported to the community leaders responsible for enforcement at codeofconduct@posit.co.
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/R-CMD-check-hard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-pandoc@v2

Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,21 @@ jobs:
fail-fast: false
matrix:
config:
- {os: macOS-latest, r: 'release'}
- {os: macos-latest, r: 'release'}

- {os: windows-latest, r: 'release'}

- {os: ubuntu-18.04, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-18.04, r: 'release'}
- {os: ubuntu-18.04, r: 'oldrel-1'}
- {os: ubuntu-18.04, r: 'oldrel-2'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}
- {os: ubuntu-latest, r: 'oldrel-2'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-pandoc@v2

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-pandoc@v2

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pr-commands.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: r-lib/actions/pr-fetch@v2
with:
Expand Down Expand Up @@ -51,7 +51,7 @@ jobs:
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: r-lib/actions/pr-fetch@v2
with:
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 @@ -15,7 +15,7 @@ jobs:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-r@v2
with:
Expand Down
126 changes: 0 additions & 126 deletions CODE_OF_CONDUCT.md

This file was deleted.

17 changes: 9 additions & 8 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@ Package: bundle
Title: Serialize Model Objects with a Consistent Interface
Version: 0.1.0.9000
Authors@R: c(
person("Julia", "Silge", , "julia.silge@rstudio.com", role = c("aut", "cre"),
person("Julia", "Silge", , "julia.silge@posit.co", role = c("aut", "cre"),
comment = c(ORCID = "0000-0002-3671-836X")),
person("Simon", "Couch", , "[email protected]", role = "aut"),
person("Qiushi", "Yan", , "[email protected]", role = "aut"),
person("Max", "Kuhn", , "max@rstudio.com", role = "aut"),
person("RStudio", role = c("cph", "fnd"))
person("Max", "Kuhn", , "max@posit.co", role = "aut"),
person(given = "Posit Software, PBC", role = c("cph", "fnd"))
)
Description: Typically, models in 'R' exist in memory and can be saved via
regular 'R' serialization. However, some models store information in
locations that cannot be saved using 'R' serialization alone. The goal of
'bundle' is to provide a common interface to capture this information,
situate it within a portable object, and restore it for use in new settings.
regular 'R' serialization. However, some models store information in
locations that cannot be saved using 'R' serialization alone. The goal
of 'bundle' is to provide a common interface to capture this
information, situate it within a portable object, and restore it for
use in new settings.
License: MIT + file LICENSE
URL: https://github.com/rstudio/bundle, https://rstudio.github.io/bundle/
BugReports: https://github.com/rstudio/bundle/issues
Expand Down Expand Up @@ -42,8 +43,8 @@ Suggests:
renv,
rmarkdown,
stacks,
testthat (>= 3.0.0),
tensorflow,
testthat (>= 3.0.0),
torch,
torchvision,
uwot,
Expand Down
6 changes: 3 additions & 3 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ install.packages("bundle")
And the development version from [GitHub](https://github.com/) with:

``` r
# install.packages("devtools")
devtools::install_github("rstudio/bundle")
# install.packages("pak")
pak::pak("rstudio/bundle")
```

## Overview
Expand All @@ -51,7 +51,7 @@ We often imagine a trained model as a somewhat "standalone" R object---given som

We need some way to preserve access to those references. The bundle package provides a consistent interface for _bundling_ model objects with their references so that they can be safely saved and re-loaded in production:

```{r diagram-04, echo = FALSE, fig.alt = "A replica of the previous diagram, where the arrow previously connecting the model object in R session one and the standalone model object in R session two is connected by a verb called bundle. The bundle function outputs an object called a bundle.", out.width = '100%'}
```{r diagram-04, echo = FALSE, fig.alt = "A diagram showing a rectangle, labeled model object, and another rectangle, labeled predictions. The two are connected by an arrow from model object to predictions, with the label 'predict'. There are two boxes labeled reference, connected to the arrow labeled predict with dotted arrows, to show that, most of the time, we don't need to think about including them in our workflow. There are two boxes, labeled R Session number one, and R session number two. In focus is the arrow from the model object, in R Session number one, to a model object in R session number two. This arrow connecting the model object in R session one and the model object in R session two is connected by a verb called bundle. The bundle function outputs an object called a bundle.", out.width = '100%'}
knitr::include_graphics("man/figures/diagram_04.png")
```

Expand Down
58 changes: 29 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ install.packages("bundle")
And the development version from [GitHub](https://github.com/) with:

``` r
# install.packages("devtools")
devtools::install_github("rstudio/bundle")
# install.packages("pak")
pak::pak("rstudio/bundle")
```

## Overview
Expand All @@ -57,7 +57,7 @@ package provides a consistent interface for *bundling* model objects
with their references so that they can be safely saved and re-loaded in
production:

<img src="man/figures/diagram_04.png" alt="A replica of the previous diagram, where the arrow previously connecting the model object in R session one and the standalone model object in R session two is connected by a verb called bundle. The bundle function outputs an object called a bundle." width="100%" />
<img src="man/figures/diagram_04.png" alt="A diagram showing a rectangle, labeled model object, and another rectangle, labeled predictions. The two are connected by an arrow from model object to predictions, with the label 'predict'. There are two boxes labeled reference, connected to the arrow labeled predict with dotted arrows, to show that, most of the time, we don't need to think about including them in our workflow. There are two boxes, labeled R Session number one, and R session number two. In focus is the arrow from the model object, in R Session number one, to a model object in R session number two. This arrow connecting the model object in R session one and the model object in R session two is connected by a verb called bundle. The bundle function outputs an object called a bundle." width="100%" />

For more on this diagram, see the [main bundle
vignette](https://rstudio.github.io/bundle/articles/bundle.html).
Expand Down Expand Up @@ -96,14 +96,14 @@ mod
#> parsnip model object
#>
#> ##### xgb.Booster
#> raw: 8 Kb
#> raw: 8.1 Kb
#> call:
#> xgboost::xgb.train(params = list(eta = 0.3, max_depth = 6, gamma = 0,
#> colsample_bytree = 1, colsample_bynode = 0.3, min_child_weight = 1,
#> subsample = 1, objective = "reg:squarederror"), data = x$data,
#> nrounds = 5, watchlist = x$watchlist, verbose = 0, nthread = 1)
#> subsample = 1), data = x$data, nrounds = 5, watchlist = x$watchlist,
#> verbose = 0, nthread = 1, objective = "reg:squarederror")
#> params (as set within xgb.train):
#> eta = "0.3", max_depth = "6", gamma = "0", colsample_bytree = "1", colsample_bynode = "0.3", min_child_weight = "1", subsample = "1", objective = "reg:squarederror", nthread = "1", validate_parameters = "TRUE"
#> eta = "0.3", max_depth = "6", gamma = "0", colsample_bytree = "1", colsample_bynode = "0.3", min_child_weight = "1", subsample = "1", nthread = "1", objective = "reg:squarederror", validate_parameters = "TRUE"
#> xgb.attributes:
#> niter
#> callbacks:
Expand All @@ -113,11 +113,11 @@ mod
#> nfeatures : 10
#> evaluation_log:
#> iter training_rmse
#> 1 14.640496
#> 2 10.911261
#> 3 8.226121
#> 4 6.231544
#> 5 4.761105
#> 1 14.631798
#> 2 10.865171
#> 3 8.130434
#> 4 6.150935
#> 5 4.681918
```

Note that simply saving and loading the model results in changes to the
Expand All @@ -129,7 +129,7 @@ saveRDS(mod, temp_file)
mod2 <- readRDS(temp_file)

compare(mod, mod2, ignore_formula_env = TRUE)
#> `old$fit$handle` is <pointer: 0x147aa3740>
#> `old$fit$handle` is <pointer: 0x102ff7800>
#> `new$fit$handle` is <pointer: 0x0>
#>
#> `old$fit$handle` is attr(,"class")
Expand Down Expand Up @@ -176,13 +176,13 @@ r(
#> # A tibble: 7 × 1
#> .pred
#> <dbl>
#> 1 22.1
#> 2 20.6
#> 3 16.5
#> 4 14.1
#> 5 16.5
#> 6 11.8
#> 7 18.8
#> 1 22.4
#> 2 22.4
#> 3 19.0
#> 4 19.4
#> 5 16.6
#> 6 11.2
#> 7 22.4
```

For a more in-depth demonstration of the package, see the [main
Expand All @@ -195,14 +195,14 @@ This project is released with a [Contributor Code of
Conduct](https://contributor-covenant.org/version/2/0/CODE_OF_CONDUCT.html).
By contributing to this project, you agree to abide by its terms.

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

- If you think you have encountered a bug, please [submit an
issue](https://github.com/rstudio/bundle/issues).
- If you think you have encountered a bug, please [submit an
issue](https://github.com/rstudio/bundle/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.
2 changes: 1 addition & 1 deletion vignettes/bundle.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ We've done the work of figuring that out, and it turns out the interface is a li

What if we could just use the same function for any R object, and it would _just work_?

```{r diagram-03, echo = FALSE, fig.alt = "A diagram showing the same set of rectangles, representing a prediction problem, as before. This version of the diagram adds two boxes, labeled R Session numbe r one, and R session number two. In R session number two, we have a new rectangle labeled standalone model object. In focus is the arrow from the model object, in R Session number one, to the standalone model object in R session number two.", out.width = '100%'}
```{r diagram-03, echo = FALSE, fig.alt = "A diagram showing the same set of rectangles, representing a prediction problem, as before. This version of the diagram adds two boxes, labeled R Session number one, and R session number two. In R session number two, we have a new rectangle labeled standalone model object. In focus is the arrow from the model object, in R Session number one, to the standalone model object in R session number two.", out.width = '100%'}
knitr::include_graphics("figures/diagram_03.png")
```

Expand Down

0 comments on commit 1498c88

Please sign in to comment.