stan-dev / stan-dev/rstanarm

Request: move `shinystan` from `Imports` to `Suggests`?

Open
#623 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
401
Forks
136
PR merge metrics
No merged PRs in 30d

Description

Summary:

rstanarm imports shinystan, meaning that all packages that import rstanarm (or suggest it and install the suggested packages in CI) also have to install a whole lot of shiny-related packages. This can cause issues in CI and for other package maintainers.

Description:

Hello, I don't use rstanarm but I maintain a package that Suggests it (datawizard). Recently, there were some failures in CI due to installation errors for QuickJSR. I was a bit intrigued because our package has nothing to do with Javascript and doesn't use any shiny-related packages. It turned out that QuickJSR was installed because shinystan is also installed, and that's because we suggest rstanarm:

pak::pkg_deps_explain("datawizard", "QuickJSR", dependencies = TRUE)
#> ℹ Loading metadata database✔ Loading metadata database ... done
#> datawizard -> brms -> rstan -> QuickJSR
#> datawizard -> rstanarm -> rstan -> QuickJSR
#> datawizard -> rstanarm -> shinystan -> rstan -> QuickJSR

(note that QuickJSR is also installed by rstan but this encouraged me to open this issue)

As I said before, I never used rstanarm before but it seems to me that shinystan isn't so important here. From what I can see shinystan is only imported to provide a method for objects of class stanreg. However, this doesn't require importing shinystan, suggesting it would be enough using s3_register() (see in particular the section "Usage in other packages").

I didn't find a trivial way to compute how many mandatory dependencies would be removed if shinystan was moved from Imports to Suggests, but I'd assume this number is quite high given all the dependencies of shiny that would no longer need to be installed.

library(deepdep)

dd <- deepdep("rstanarm", depth = 2)
plot_dependencies(dd)

Is this something you would consider?

Reproducible Steps:

N/A

RStanARM Version:

2.32.1

R Version:

4.4.0

Operating System:

Windows 10 x64 (build 19045)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Inspect where rstanarm imports shinystan and where the stanreg method is provided. Compare the proposed s3_register() approach with the package dependency metadata and run the package checks; done means shinystan is no longer mandatory while the stanreg method and dependency installation behavior remain correct.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
tooling
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.