Skip to content

Add tests and CI; move data into data/ and images/ - #3

Merged
macromeer merged 2 commits into
mainfrom
update-ggplot2-4
Oct 6, 2026
Merged

macromeer merged 2 commits into
mainfrom
update-ggplot2-4

Conversation

@macromeer

@macromeer macromeer commented Oct 6, 2026 •

Copy link
Copy Markdown
Owner

Summary

Follow-up to #2, which was merged before these two commits were pushed.

Tests and CI

  • A testthat suite in tests/testthat/ that checks:
    • Data: every CSV value is read, including the headerless data_C files.
    • Panels: each one renders without warnings, plus targeted checks for the bugs fixed in Fix plotting bugs, update for ggplot2 4.x, save figure from script #2: Panel A labels, Panel B edge bars and single curve, Panel C point count and fixed jitter, Panel D overlay bounds, Panel E error bars.
    • Export: PNG pixel size, the SVG font fallback list, and no Type 3 fonts in the PDF.
    • Visual snapshots: vdiffr snapshots of panels B–F. Panel A is left out so the microscopy images aren't copied into the snapshots.
  • figure_example.R has two options for testing: options(scifig.save = FALSE) builds the panels without writing files, and options(scifig.out_dir = ...) writes the files to another folder.
  • DESCRIPTION lists the dependencies. This is not an R package; the file lets CI and pak::local_install_deps() install them.
  • A GitHub Actions workflow (.github/workflows/tests.yaml) runs the tests on every push to main and every pull request.

Layout

  • The CSVs move to data/ and the microscopy images to images/. Git records these as renames, so file history is kept.
  • Paths are updated in the script and tests, and the README describes the layout and how to run the tests.

Test plan

  • Rscript -e 'testthat::test_dir("tests/testthat")': 48 passed, 0 warnings
  • Re-introducing four of the fixed bugs (CSV header, Panel D bounds, Panel B edge bars, Panel A labels) makes the tests fail
  • Rscript figure_example.R writes identical PNG and SVG after the file move
  • CI passes on this PR (48 passed, 0 skipped)

🤖 Generated with Claude Code

macromeer and others added 2 commits October 6, 2026 13:42
- testthat suite (tests/testthat): data loading, every panel renders
  without warnings, regression checks for the bugs fixed in the previous
  commit, exported PNG/SVG/PDF (pixel size, SVG font fallback, no Type 3
  fonts in the PDF), and vdiffr snapshots of panels B-F
- figure_example.R: options(scifig.save = FALSE) builds the panels
  without writing files, options(scifig.out_dir = ...) writes elsewhere
- DESCRIPTION lists the dependencies (not an R package) so CI and
  pak::local_install_deps() can install them
- CI runs the tests on every push to main and every pull request

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Update the paths in figure_example.R and the tests, and describe the
repository layout in the README.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@macromeer
macromeer merged commit 0f41369 into main Oct 6, 2026
1 check passed
@macromeer
macromeer deleted the update-ggplot2-4 branch October 6, 2026 13:19
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