Skip to content

Commit

Permalink
Build site
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Feb 7, 2024
1 parent d295eba commit 5a216fb
Show file tree
Hide file tree
Showing 6 changed files with 840 additions and 15 deletions.
2 changes: 2 additions & 0 deletions docs/Meetings.html
Original file line number Diff line number Diff line change
Expand Up @@ -2173,6 +2173,8 @@
<!--/radix_placeholder_distill-->
<script src="site_libs/kePrint-0.0.1/kePrint.js"></script>
<link href="site_libs/lightable-0.0.1/lightable.css" rel="stylesheet" />
<link href="site_libs/bsTable-3.3.7/bootstrapTable.min.css" rel="stylesheet" />
<script src="site_libs/bsTable-3.3.7/bootstrapTable.js"></script>
<script src="site_libs/popper-2.6.0/popper.min.js"></script>
<link href="site_libs/tippy-6.2.7/tippy.css" rel="stylesheet" />
<link href="site_libs/tippy-6.2.7/tippy-light-border.css" rel="stylesheet" />
Expand Down
20 changes: 14 additions & 6 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -939,9 +939,12 @@ <h2>Upcoming NMFS R UG Events</h2>
<h4>Next events</h4>
<p>Please see the cross-posted R events and trainings on the <a href="https://calendar.google.com/calendar/embed?src=noaa.gov_60rfn7ml9rpchl63vs4af9n018%40group.calendar.google.com&amp;ctz=America%2FLos_Angeles">NMFS R UG calendar</a>. In this section, we only list NMFS R UG and NMFS Open Science specific events. Go to the Calender to add events to your calendar.</p>
<ul>
<li>Dec 12, 2023 11am PT/2pm ET Posit Webinar: Posit Webinar: Best practices for making, maintaining and sharing R packages</li>
<li>Jan 23, 2024 12pmPT/3pm ET NMFS R UG monthly meeting. TBD</li>
<li>Feb 27, 2024 12pmPT/3pm ET NMFS R UG monthly meeting. Sean Rohan (AFSC) will discuss spatial mapping and the akgfmaps and coldpool R packages</li>
<li>Feb 13, 2024 11am PT/2pm ET Posit Webinar: Best practices for making, maintaining and sharing R packages</li>
<li>Feb 27, 2024 12pm PT/3pm ET NMFS R UG monthly meeting. Sean Rohan (AFSC) will discuss spatial mapping and the akgfmaps and coldpool R packages</li>
<li>Mar 19, 2024 12pm PT/3pm ET NMFS R UG monthly meeting. TBD</li>
<li>Apr 23, 2024 12pm PT/3pm ET NMFS R UG monthly meeting. TBD</li>
<li>May 28, 2024 12pm PT/3pm ET NMFS R UG monthly meeting. TBD</li>
<li>Jun 25, 2024 12pm PT/3pm ET NMFS R UG monthly meeting. TBD</li>
</ul>
</div>
<div id="posit-webinars" class="section level4">
Expand All @@ -957,6 +960,7 @@ <h4>Posit Webinars</h4>
<p>See the “Search past events” tab and our <a href="https://docs.google.com/document/d/1mrgtrSXVtPCTxrpBa_0ZbxEsnK9vcQzs6RIV3f-OTPw/edit?usp=sharing">Past meeting notes</a> for info on past events and links to slides, repos, notes and video.</p>
<p><br/></p>
<ul>
<li><strong>Jan 23, 2024 12pm PT/3pm ET NMFS R UG monthly meeting</strong>.</li>
<li><strong>Dec 5, 2023 12-1pm PT. NMFS R UG Monthly Meeting</strong> Eric Ward (NWFSC) will discuss an R data package for US-Canada transboundary bottom trawl data</li>
<li><strong>Nov 7 2023 12-1pm PDT. NMFS R UG Monthly Meeting</strong> Trick and treat in R!: Discussion and code sharing and Posit Conf Digest (with Brian Fadely)</li>
<li><strong>Sep 26 2023 12-1pm PDT. NMFS R UG Monthly Meeting</strong> {CiteSource} R package with Trevor Riley from Central Library.</li>
Expand Down Expand Up @@ -1098,9 +1102,12 @@ <h2>Upcoming NMFS R UG Events</h2>
<h4>Next events</h4>
<p>Please see the cross-posted R events and trainings on the <a href="https://calendar.google.com/calendar/embed?src=noaa.gov_60rfn7ml9rpchl63vs4af9n018%40group.calendar.google.com&amp;ctz=America%2FLos_Angeles">NMFS R UG calendar</a>. In this section, we only list NMFS R UG and NMFS Open Science specific events. Go to the Calender to add events to your calendar.</p>
<ul>
<li>Dec 12, 2023 11am PT/2pm ET Posit Webinar: Posit Webinar: Best practices for making, maintaining and sharing R packages</li>
<li>Jan 23, 2024 12pmPT/3pm ET NMFS R UG monthly meeting. TBD</li>
<li>Feb 27, 2024 12pmPT/3pm ET NMFS R UG monthly meeting. Sean Rohan (AFSC) will discuss spatial mapping and the akgfmaps and coldpool R packages</li>
<li>Feb 13, 2024 11am PT/2pm ET Posit Webinar: Best practices for making, maintaining and sharing R packages</li>
<li>Feb 27, 2024 12pm PT/3pm ET NMFS R UG monthly meeting. Sean Rohan (AFSC) will discuss spatial mapping and the akgfmaps and coldpool R packages</li>
<li>Mar 19, 2024 12pm PT/3pm ET NMFS R UG monthly meeting. TBD</li>
<li>Apr 23, 2024 12pm PT/3pm ET NMFS R UG monthly meeting. TBD</li>
<li>May 28, 2024 12pm PT/3pm ET NMFS R UG monthly meeting. TBD</li>
<li>Jun 25, 2024 12pm PT/3pm ET NMFS R UG monthly meeting. TBD</li>
</ul>
</div>
<div id="posit-webinars" class="section level4">
Expand All @@ -1116,6 +1123,7 @@ <h4>Posit Webinars</h4>
<p>See the “Search past events” tab and our <a href="https://docs.google.com/document/d/1mrgtrSXVtPCTxrpBa_0ZbxEsnK9vcQzs6RIV3f-OTPw/edit?usp=sharing">Past meeting notes</a> for info on past events and links to slides, repos, notes and video.</p>
<p><br/></p>
<ul>
<li><strong>Jan 23, 2024 12pm PT/3pm ET NMFS R UG monthly meeting</strong>.</li>
<li><strong>Dec 5, 2023 12-1pm PT. NMFS R UG Monthly Meeting</strong> Eric Ward (NWFSC) will discuss an R data package for US-Canada transboundary bottom trawl data</li>
<li><strong>Nov 7 2023 12-1pm PDT. NMFS R UG Monthly Meeting</strong> Trick and treat in R!: Discussion and code sharing and Posit Conf Digest (with Brian Fadely)</li>
<li><strong>Sep 26 2023 12-1pm PDT. NMFS R UG Monthly Meeting</strong> {CiteSource} R package with Trevor Riley from Central Library.</li>
Expand Down
4 changes: 2 additions & 2 deletions docs/posts/posts.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
],
"contents": "\nThis is for vdiffr version 1.0.2.9000. The package is in development so syntax and behavior is likely to change. Read the testing chapter in the R packages book for background on writing tests for R packages.\nTests to compare two images\nhttps://vdiffr.r-lib.org/ is a package that integrates with the testthat package to allow tests that compare plot outputs.\nSetting up your package for unit testing\nusethis::use_testthat()\nMakes the tests folder and testthat subfolder.\nWithin the testthat folder,\nusethis::use_test(name=\"xyz\")\nThis will make a test file test-xyz.R in the testthis subfolder. When you make your own test files, replace “xyz” with your test name.\nTo run the tests, you can open test-xyz.R in RStudio and it will recognize that this is a test file. “Run tests” will show up on the upper right of the file.\nsnapshot workflow\nThe first time that you run expect_doppelganger(\"xyz\", plt1) within a test_that() call, a snapshot expectation will run and a svg of plt1 will be made in tests/testthat/_snaps/xyz called xyz.svg. The next time expect_doppelganger(\"xyz\", plt2) is run within a test_that() call, a svg of plt2 will be made and compared to xyz.svg. If it is different, the file xyz.new.svg will be made in tests/testthat/_snaps/xyz.\nBecause of this workflow, we want to make sure tests/testthat/_snaps/xyz is empty before we start because we have to run expect_doppelganger(\"xyz\", plt1) to create xyz.svg but if xyz.svg is already there from previous tests, we might end up creating xyz.new.svg if plt1 is a different plot than xyz.svg.\nThe full test-xyz.R test file is below. Here I break down the parts of that file.\nHeader\nGive some info about the tests (context), load packages, and then clean up the _snaps folder. Having old svgs there can mess up your tests.\ncontext(\"xyz\")\nlibrary(ggplot2)\nlibrary(vdiffr)\n\n# Clean up the _snaps folder for this test file\n# Note this won't be necessary in some situations\nfils <- dir(file.path(here::here(), \"tests\", \"testthat\", \"_snaps\", \"xyz\"), full.names = TRUE)\nfile.remove(fils)\nCompare two ggplots plot\nHere is the contents of test-xyz.R to compare two plots. This test should fail because the plots are different.\nStep 1 make first plot and run expect_doppelganger() to create a svg file in _snaps that is used to compare against. The name of the file is the first argument and must be the same in the expect_doppelganger() calls.\nplt <- ggplot(mtcars, aes(mpg)) + geom_histogram()\n# Save as ggplot-test1.svg in _snaps folder\n# This will appear as a successful test, i.e. plot successfully created\ntest_that(\"setup\", {\n expect_doppelganger(\"ggplot-test1\", plt)\n})\nStep 2. Create 2nd plot and compare to ggplot-test1.svg already in _snaps folder.\nplt <- ggplot(mtcars, aes(disp)) + geom_histogram()\ntest_that(\"plots are different\", {\n expect_doppelganger(\"ggplot-test1\", plt)\n})\nSince they are different, you will see ggplot-test1.new.svg in the _snaps folder.\nCompare two base plots\nThe syntax here is a little different. The object that you pass into expect_doppelganger() as the second argument is a function that creates the base plot. Otherwise the steps are the same.\nplt <- function(){ hist(mtcars$mpg) }\n# Step 1. Create base-test.svg\n# This will appear as a successful test, i.e. plot successfully created\ntest_that(\"setup\", {\n expect_doppelganger(\"base-test\", plt)\n})\n# Step 2. Test new plot against base-test.svg\n# Test will fail since they are different\nplt <- function(){ hist(mtcars$disp) }\ntest_that(\"plots are different\", {\n expect_doppelganger(\"base-test\", plt)\n})\nFinal test-xyz.R file\nThis should be in the testthat folder in tests folder. Running this will show 2 Fails and 4 Passes. To run, you can open the file in RStudio and look for the “Run Tests” button in top right of file. Or run this code.\nfil <- file.path(here::here(), \"tests\", \"testthat\", \"test-xyz.R\")\ntestthat::test_file(fil)\nOr open the file in RStudio and run this code:\ndevtools::test_active_file()\nThe full test file.\ncontext(\"xyz\")\nlibrary(ggplot2)\nlibrary(vdiffr)\n\n# Clean up the _snaps folder for this test file\n# Note this won't be necessary in some situations\nfils <- dir(file.path(here::here(), \"tests\", \"testthat\", \"_snaps\", \"xyz\"), full.names = TRUE)\nfile.remove(fils)\n\n# This test should fail. The plots are different\n# Step 1 make first plot\nplt <- ggplot(mtcars, aes(mpg)) + geom_histogram()\n# Save as ggplot-test1.svg in _snaps folder\n# This will appear as a successful test, i.e. plot successfully created\ntest_that(\"setup\", {\n expect_doppelganger(\"ggplot-test1\", plt)\n})\n# Step 2. Create 2nd plot and compare to ggplot-test1.svg in _snaps folder\nplt <- ggplot(mtcars, aes(disp)) + geom_histogram()\ntest_that(\"plots are different\", {\n expect_doppelganger(\"ggplot-test1\", plt)\n})\n# Since they are different, you will see ggplot-test1.new.svg in the _snaps folder\n\n# This test should not fail. The plots should be the same.\nfun <- function(dat){ return(ggplot(dat, aes(mpg)) + geom_histogram()) }\nplt <- fun(mtcars)\n# Step 1. Create ggplot-test2.svg\n# This will appear as a successful test, i.e. plot successfully created\ntest_that(\"setup\", {\n expect_doppelganger(\"ggplot-test2\", plt)\n})\n# Step 2. Test new plot against ggplot-test2.svg\nplt <- fun(na.omit(mtcars))\ntest_that(\"plots are the same\", {\n expect_doppelganger(\"ggplot-test2\", plt)\n})\n# Since they are the same, you will NOT see ggplot-test2.new.svg in the _snaps folder\n\n# Comparing plots made with base graphics; Create a function that makes the plot\nplt <- function(){ hist(mtcars$mpg) }\n# Step 1. Create base-test.svg\n# This will appear as a successful test, i.e. plot successfully created\ntest_that(\"setup\", {\n expect_doppelganger(\"base-test\", plt)\n})\n# Step 2. Test new plot against base-test.svg\n# Test will fail since they are different\nplt <- function(){ hist(mtcars$disp) }\ntest_that(\"plots are different\", {\n expect_doppelganger(\"base-test\", plt)\n})\n\n\n\n",
"preview": {},
"last_modified": "2023-12-12T15:04:00+00:00",
"last_modified": "2024-02-07T21:33:45+00:00",
"input_file": {}
},
{
Expand All @@ -33,7 +33,7 @@
"categories": [],
"contents": "\nThe R-Govys blog is a place for R-Govys users to post write-ups on topics of interest to the group. Suggestions:\nExample of using R in your work\nExample of a new R feature or package\nDiscussion of changes in how R is used in government\nWrite-up of a meeting review or summary\n\n\n\n",
"preview": {},
"last_modified": "2023-12-12T15:04:00+00:00",
"last_modified": "2024-02-07T21:33:45+00:00",
"input_file": {}
}
]
Loading

0 comments on commit 5a216fb

Please sign in to comment.