From e81b1411b2289c61b51d65d69875d0c4254e8596 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Tue, 28 May 2024 21:06:01 +0000 Subject: [PATCH] Build site --- docs/Meetings.html | 18 ++++++++++++++++++ docs/data/MeetingList.csv | 3 ++- docs/posts/posts.json | 4 ++-- docs/sitemap.xml | 14 +++++++------- 4 files changed, 29 insertions(+), 10 deletions(-) diff --git a/docs/Meetings.html b/docs/Meetings.html index e052be2..44f92ad 100644 --- a/docs/Meetings.html +++ b/docs/Meetings.html @@ -2270,6 +2270,24 @@

Past Meetings

+May 28, 2024 + + +Learn about using Codespaces for Open science with Michael Akridge (in support of PIFSC). Michael will be sharing basics about Codespaces and the Open Science Codespaces project. + + +Slides + + + + +Video + + + + + + December 5, 2023 diff --git a/docs/data/MeetingList.csv b/docs/data/MeetingList.csv index c8c5e5d..5702997 100644 --- a/docs/data/MeetingList.csv +++ b/docs/data/MeetingList.csv @@ -42,4 +42,5 @@ Adyan Rios (SEFSC), “Management history processing” "August 15, 2023",Test R code with {testthat} with Bai Li (OST),https://bai-li-noaa.github.io/testdemo/inst/presentation/testing-r-code-with-testthat.html#1,https://github.com/Bai-Li-NOAA/testdemo,,https://docs.google.com/document/d/1mrgtrSXVtPCTxrpBa_0ZbxEsnK9vcQzs6RIV3f-OTPw/edit#bookmark=kix.up749dz9ucvt "September 26, 2023",{CiteSource} R package with Trevor Riley (NOAA Central Library). CiteSource is an R package that was developed to help researchers better understand the impact of various literature resources and search methodologies. ,,https://github.com/ESHackathon/CiteSource,,https://docs.google.com/document/d/1mrgtrSXVtPCTxrpBa_0ZbxEsnK9vcQzs6RIV3f-OTPw/edit#bookmark=kix.sr1k7b6n12l3 "November 7, 2023",Trick and treat in R!: Discussion and code sharing and Posit Conf Digest (with Brian Fadely),,,,https://docs.google.com/document/d/1mrgtrSXVtPCTxrpBa_0ZbxEsnK9vcQzs6RIV3f-OTPw/edit#bookmark=kix.h2rkn078saws -"December 5, 2023",Eric Ward (NWFSC) will discuss a project to create a standardized and combined US-Canada transboundary bottom trawl data from the North Pacific. ,https://docs.google.com/presentation/d/1rkKInOO37dEwddEjuoTDN_9tkfEuHKUxg3EFg_bwWXk/edit?usp=sharing,https://github.com/DFO-NOAA-Pacific/surveyjoin,,https://docs.google.com/document/d/1mrgtrSXVtPCTxrpBa_0ZbxEsnK9vcQzs6RIV3f-OTPw/edit#bookmark=kix.a7r1e92ebhii \ No newline at end of file +"December 5, 2023",Eric Ward (NWFSC) will discuss a project to create a standardized and combined US-Canada transboundary bottom trawl data from the North Pacific. ,https://docs.google.com/presentation/d/1rkKInOO37dEwddEjuoTDN_9tkfEuHKUxg3EFg_bwWXk/edit?usp=sharing,https://github.com/DFO-NOAA-Pacific/surveyjoin,,https://docs.google.com/document/d/1mrgtrSXVtPCTxrpBa_0ZbxEsnK9vcQzs6RIV3f-OTPw/edit#bookmark=kix.a7r1e92ebhii +"May 28, 2024",Learn about using Codespaces for Open science with Michael Akridge (in support of PIFSC). Michael will be sharing basics about Codespaces and the Open Science Codespaces project.,https://docs.google.com/presentation/d/1WN94pwBiFpVBOPPHjxfXshdPQRbrA_0yhI3x6OX3As0/edit?usp=sharing,,https://drive.google.com/file/d/1pNzaalxssjAX6pMxPTeNojHnmya5aa2q/view?usp=drive_link, \ No newline at end of file diff --git a/docs/posts/posts.json b/docs/posts/posts.json index 6dc807f..b74baeb 100644 --- a/docs/posts/posts.json +++ b/docs/posts/posts.json @@ -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": "2024-05-01T20:25:07+00:00", + "last_modified": "2024-05-28T21:04:41+00:00", "input_file": {} }, { @@ -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": "2024-05-01T20:25:07+00:00", + "last_modified": "2024-05-28T21:04:41+00:00", "input_file": {} } ] diff --git a/docs/sitemap.xml b/docs/sitemap.xml index 54addbe..5fd856c 100644 --- a/docs/sitemap.xml +++ b/docs/sitemap.xml @@ -2,30 +2,30 @@ https://nmfs-opensci.github.io/NMFS-R-UG/ - 2024-05-01T20:25:07+00:00 + 2024-05-28T21:04:41+00:00 https://nmfs-opensci.github.io/NMFS-R-UG/Meetings.html - 2024-05-01T20:25:07+00:00 + 2024-05-28T21:04:41+00:00 https://nmfs-opensci.github.io/NMFS-R-UG/posts.html - 2024-05-01T20:25:07+00:00 + 2024-05-28T21:04:41+00:00 https://nmfs-opensci.github.io/NMFS-R-UG/resources.html - 2024-05-01T20:25:07+00:00 + 2024-05-28T21:04:41+00:00 https://nmfs-opensci.github.io/NMFS-R-UG/workshops.html - 2024-05-01T20:25:07+00:00 + 2024-05-28T21:04:41+00:00 https://nmfs-opensci.github.io/NMFS-R-UG/posts/2021-09-28-vdiffr/ - 2024-05-01T20:25:07+00:00 + 2024-05-28T21:04:41+00:00 https://nmfs-opensci.github.io/NMFS-R-UG/posts/2021-09-15-welcome/ - 2024-05-01T20:25:07+00:00 + 2024-05-28T21:04:41+00:00