From 1eaf3963e5cfec1890d1b4c68d09e0e196f804e9 Mon Sep 17 00:00:00 2001 From: Steffi LaZerte Date: Wed, 13 Nov 2024 09:57:18 -0600 Subject: [PATCH] Add details to release and play with normals --- DEVTESTS_normals_1991.R | 38 ++++++++++++++++++++++++++++++++++++++ release_script.R | 14 +++++++++++--- 2 files changed, 49 insertions(+), 3 deletions(-) create mode 100644 DEVTESTS_normals_1991.R diff --git a/DEVTESTS_normals_1991.R b/DEVTESTS_normals_1991.R new file mode 100644 index 0000000..6cd2e9e --- /dev/null +++ b/DEVTESTS_normals_1991.R @@ -0,0 +1,38 @@ + + +httr::GET(url = "https://climate.weather.gc.ca/climate_normals/station_inventory_e.html?yr=1991") |> + httr::content("text") |> + readr::read_csv() + + +getOption("weathercan.urls.normals") + + +# FOLLOWING WORKS for normals... but how do we get stnID? +q <- list(lang = "e", prov = "MB", yr = "1991", + stnname = "BRANDON", + stnID = "219000000", climateID = "", + submit_thread = "Download") + +get_check(url = "https://climate.weather.gc.ca/climate_normals/bulk_data_e.html", + query = q, + task = "access climate normals") |> + httr::content("text") |> + readr::read_csv() + + +# FOLLOWING WORKS for composite thread data... but how do we get stnID? +q <- list(lang = "e", prov = "MB", yr = "1991", + stnname = "BRANDON", + stnID = "219000000", climateID = "", + submit_thread = "Download", + metathread = "metadata", + metathread = "threaddata") + + +get_check(url = "https://climate.weather.gc.ca/climate_normals/thread_bulk_data_e.html", + query = q, + task = "access climate normals", httr::write_disk("temp.zip", overwrite = TRUE)) +unzip("temp.zip") +readr::read_csv("en_1991-2020_Normals_station_metadata_MB_BRANDON.csv") +readr::read_csv("en_1991-2020_Normals_station_threads_MB_BRANDON.csv") diff --git a/release_script.R b/release_script.R index 3b953b8..67307d3 100644 --- a/release_script.R +++ b/release_script.R @@ -62,15 +62,23 @@ codemetar::write_codemeta() pkgdown::build_site(lazy = FALSE) + +# Finalize -------------------- + +## Merge when ready! +usethis::pr_view() + +## Once merged close branch +usethis::pr_finish() + ## Once it is released create signed release on github usethis::use_github_release() -# Prep for next +## Prep for next +usethis::pr_init("dev") usethis::use_dev_version() - - # Good practices -------------------- goodpractice::gp()