Skip to content

fix: show_saved_plot skips the preview when png or tiff is missing - #161

Open
jiajic wants to merge 1 commit into
gsourcefrom
chore/package-check-on-missing
Open

jiajic wants to merge 1 commit into
gsourcefrom
chore/package-check-on-missing

Conversation

@jiajic

@jiajic jiajic commented Oct 22, 2026

Copy link
Copy Markdown
Collaborator

The show_saved_plot = TRUE preview in .ggplot_save_function() and .general_save_function() is guarded by if (package_check("png", optional = TRUE)) (likewise tiff). Before GiottoUtils 0.2.9, package_check() always returned TRUE, so with png or tiff missing, the guard passed and png::readPNG() / tiff::readTIFF() errored after the file had been saved.

GiottoUtils 0.2.9 (giotto-suite/GiottoUtils#193, now on main) returns FALSE for a missing package and deprecates optional in favour of on_missing. This PR:

  • switches the 4 guards to package_check(..., on_missing = "message"). The preview is skipped with the install message, and the save itself is unaffected.
  • raises the pin to GiottoUtils (>= 0.2.9). Remotes: installs GiottoUtils from main, which now has 0.2.9.
  • adds a NEWS entry under 0.2.16 bug fixes.

devtools::test(filter = "save"): 0 failures, 9 passing. The 1 warning is Giotto reporting the Python module sklearn missing locally.

🤖 Generated with Claude Code

package_check(on_missing = "message") returns FALSE for a missing
package; optional = TRUE always returned TRUE.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant