-
-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
Description
In install_r_packages() (src/soundscapy/r_wrapper/_r_wrapper.py), the guard if len(packnames_to_install) > 0 runs before CircE is removed from the list. In the common case where only CircE is missing (sn already installed), after the GitHub install the list becomes [] and utils.install_packages(StrVector([])) is called unnecessarily with an empty vector, which may cause R to emit a warning or error depending on version.
Reproduction
Trigger auto-install when only CircE is missing (sn already present):
# packnames_to_install = ["CircE"]
if len(packnames_to_install) > 0: # True — passes
if "CircE" in packnames_to_install:
remotes.install_github(...)
packnames_to_install.remove("CircE") # now []
utils.install_packages(StrVector([])) # called with empty vectorFix
Add a second guard after the CircE removal:
if packnames_to_install: # only call CRAN install if anything remains
utils.install_packages(StrVector(packnames_to_install))
logger.info("Installed missing R packages: %s", packnames_to_install)Notes
- Found during code review of PR fix: R wrapper cleanup, DataFrame mutation bug, test coverage and docs #127 but left unfixed as unconfirmed/low-priority
install_r_packagesis only called when the user explicitly opts in to auto-installation, so the blast radius is small
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels