Prepare
-
npm install
- Make changes to source code
- Run formatter and sort imports
- Run tests (development workflow section in
CLAUDE.md
) - Run manual tests (manual testing section in
CLAUDE.md
)
Manifest
Prepare
npm install
CLAUDE.md
)CLAUDE.md
)Manifest
Update environment
uv self update
uv python pin 3.y.z
- latest release versionuv lock --upgrade
uv sync
Code style
python scripts/verify_ascii.py
# <https://fdp.io/blog/2024-10-08-choosing-a-font/> | |
uv init fontsub | |
uv add fonttools | |
uv add brotli | |
pyftsubset "Iosevka-Extended.woff2" \ | |
--output-file="Iosevka-Extended-subset.woff2" \ | |
--flavor="woff2" \ | |
--layout-features="*" \ |
library(doFuture) | |
plan(multisession, workers = 32) | |
options(scipen = 999) | |
anysvd <- function(id, dim = 10, nrep = 300) { | |
results <- vector("list", nrep) | |
for (j in 1:nrep) { |
# Remove ProjectID from .Rproj files if freshly added | |
local({ | |
xfun <- requireNamespace("xfun", quietly = TRUE) | |
rproj_files <- list.files(pattern = "\\.Rproj$", full.names = TRUE) | |
if (!xfun || length(rproj_files) == 0L) return(invisible(NULL)) | |
lapply(rproj_files, function(f) { | |
diff_cmd <- system(paste("git diff --", shQuote(f)), intern = TRUE) | |
diff_out <- tryCatch(diff_cmd, error = function(e) character(0)) |
desc <- tempfile() | |
curl::curl_download("https://cran.r-project.org/web/packages/tidyverse/DESCRIPTION", destfile = desc) | |
deps <- desc::desc_get_deps(desc) | |
pkgs <- deps[deps$type %in% c("Imports"), "package"] | |
urls <- paste0("https://cloud.r-project.org/web/packages/", pkgs, "/news/news.html") | |
html <- vector("list", length(urls)) | |
for (i in seq_along(urls)) html[[i]] <- rawToChar(curl::curl_fetch_memory(urls[i])$content) | |
markdown <- vector("list", length(urls)) | |
for (i in seq_along(urls)) markdown[[i]] <- paste0(pandoc::pandoc_convert(text = html[[i]], from = "html", to = "markdown"), collapse = "\n") | |
markdown <- markdown[-which(sapply(markdown, grepl, pattern = "# Not Found"))] |
n - 454
in an expect_indetical()
call and set the comparison to condition to 0
.rhub::rhub_setup()
to add the R-hub v2 workflow.rhub::rhub_check()
to run R-hub checks and select options to run the workflow.
You might be prompted to set up a GitHub PAT locally and need to do that.n | 1 | 2 | 4 | 8 | 16 | |
---|---|---|---|---|---|---|
dplyr | 5093.77 | 2671.44 | 1447.21 | 810.42 | 446.06 | |
data.table | 1336.79 | 677.94 | 364.5 | 217.75 | 143.95 |
# Use `rlang::eval_tidy()` safely | |
```{r setup, include=FALSE} | |
knitr::opts_chunk$set(comment = "#>", collapse = TRUE, error = TRUE) | |
``` | |
`rlang::eval_tidy()` is a powerful tool that allows you to evaluate R code | |
within a specific environment, often a data frame or a list. | |
However, if used carelessly with user input, it can introduce | |
security vulnerabilities. |
library(reticulate) | |
# Ignore this ---- | |
use_python("/opt/homebrew/bin/python3.10") | |
# reticulate works ---- | |
sdv <- import("sdv") |