From 8d71bbdfb869c8a8f935fa60396450a47d5ba739 Mon Sep 17 00:00:00 2001 From: Drew Herren Date: Wed, 25 Jun 2025 13:33:04 -0500 Subject: [PATCH 1/2] Updated doc workflows and fixed some code spacing --- _pkgdown.yml | 2 +- include/stochtree/tree_sampler.h | 2 +- tools/setup/setup_r_dependencies.R | 80 ------------------------------ 3 files changed, 2 insertions(+), 82 deletions(-) delete mode 100644 tools/setup/setup_r_dependencies.R diff --git a/_pkgdown.yml b/_pkgdown.yml index 46711b1a..e558abe8 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -1,4 +1,4 @@ -url: https://stochastictree.github.io/stochtree-r/ +url: https://stochtree.ai/ template: bootstrap: 5 diff --git a/include/stochtree/tree_sampler.h b/include/stochtree/tree_sampler.h index 750364d7..f07ed79f 100644 --- a/include/stochtree/tree_sampler.h +++ b/include/stochtree/tree_sampler.h @@ -476,7 +476,7 @@ static inline void EvaluateAllPossibleSplits( data_size_t& valid_cutpoint_count, CutpointGridContainer& cutpoint_grid_container, data_size_t node_begin, data_size_t node_end, std::vector& variable_weights, std::vector& feature_types, std::vector& feature_subset, LeafSuffStatConstructorArgs&... leaf_suff_stat_args ) { - // Initialize sufficient statistics + // Initialize sufficient statistics LeafSuffStat node_suff_stat = LeafSuffStat(leaf_suff_stat_args...); LeafSuffStat left_suff_stat = LeafSuffStat(leaf_suff_stat_args...); LeafSuffStat right_suff_stat = LeafSuffStat(leaf_suff_stat_args...); diff --git a/tools/setup/setup_r_dependencies.R b/tools/setup/setup_r_dependencies.R deleted file mode 100644 index 961b2684..00000000 --- a/tools/setup/setup_r_dependencies.R +++ /dev/null @@ -1,80 +0,0 @@ -################################################################################ -## This script is a modified version of the setup-r-dependencies Github action -## for local use and debugging. The source for the action is: -## https://github.com/r-lib/actions/blob/v2-branch/setup-r-dependencies/action.yaml -################################################################################ - -# Set site library path -cat("::group::Set site library path\n") -if (Sys.getenv("RENV_PROJECT") != "") { - message("renv project detected, no need to set R_LIBS_SITE") - cat(sprintf("R_LIB_FOR_PAK=%s\n", .libPaths()[1]), file = Sys.getenv("GITHUB_ENV"), append = TRUE) - q("no") -} -lib <- .libPaths()[[1]] -if (lib == "") { - lib <- file.path(dirname(.Library), "site-library") - Sys.setenv(R_LIBS_SITE = strsplit(lib, .Platform$path.sep)[[1]][[1]]) - Sys.setenv(R_LIB_FOR_PAK = strsplit(lib, .Platform$path.sep)[[1]][[1]]) - message("Setting R_LIBS_SITE to ", lib) - message("Setting R_LIB_FOR_PAK to ", lib) -} else { - message("R_LIBS_SITE is already set to ", lib) - Sys.setenv(R_LIB_FOR_PAK = strsplit(lib, .Platform$path.sep)[[1]][[1]]) - message("R_LIB_FOR_PAK is now set to ", lib) -} -cat("::endgroup::\n") - -# Install pak -cat("::group::Install pak\n") -lib <- Sys.getenv("R_LIB_FOR_PAK") -dir.create(lib, showWarnings = FALSE, recursive = TRUE) -install.packages("pak", lib = lib, repos = sprintf( - "https://r-lib.github.io/p/pak/%s/%s/%s/%s", - "stable", - .Platform$pkgType, - R.Version()$os, - R.Version()$arch -)) -cat("::endgroup::\n") - -# Dependency resolution -cat("::group::Dependency resolution\n") -cat("os-version=", sessionInfo()$running, "\n", sep = "", append = TRUE) -r_version <- - if (grepl("development", R.version.string)) { - pdf(tempfile()) - ge_ver <- attr(recordPlot(), "engineVersion") - dev.off() - paste0("R version ", getRversion(), " (ge:", ge_ver, "; iid:", .Internal(internalsID()), ")") - } else { - R.version.string - } -cat("r-version=", r_version, "\n", sep = "", append = TRUE) -needs <- sprintf("Config/Needs/%s", strsplit("", "[[:space:],]+")[[1]]) -deps <- strsplit("any::cpp11, any::R6, any::knitr, any::rmarkdown, any::Matrix, any::tgp, any::MASS, any::mvtnorm, any::ggplot2, any::latex2exp, any::testthat, any::sessioninfo", "[[:space:],]+")[[1]] -extra_deps <- strsplit("any::testthat, any::decor, github::StochasticTree/stochtree-r", "[[:space:],]+")[[1]] -dir.create("install_temp", showWarnings=FALSE) -Sys.setenv("PKGCACHE_HTTP_VERSION" = "2") -library(pak, lib.loc = Sys.getenv("R_LIB_FOR_PAK")) -pak::lockfile_create( - c(deps, extra_deps), - lockfile = "install_temp/pkg.lock", - upgrade = FALSE, - dependencies = c(needs, "all"), - lib = NULL -) -cat("::endgroup::\n") -cat("::group::Show Lockfile\n") -writeLines(readLines("install_temp/pkg.lock")) -cat("::endgroup::\n") - -# Install/Update packages -cat("::group::Install/update packages\n") -Sys.setenv("PKGCACHE_HTTP_VERSION" = "2") -library(pak, lib.loc = Sys.getenv("R_LIB_FOR_PAK")) -pak::lockfile_install("install_temp/pkg.lock") - -# Clean up temporary pkg.lock install directory -unlink("install_temp", recursive = TRUE) -cat("::endgroup::\n") From 03e56ceb9c9a40bb3c77d27561485b8d55c717a5 Mon Sep 17 00:00:00 2001 From: Drew Herren Date: Wed, 25 Jun 2025 13:43:54 -0500 Subject: [PATCH 2/2] Added new functions to pkgdown config file --- _pkgdown.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/_pkgdown.yml b/_pkgdown.yml index e558abe8..cc84903d 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -117,6 +117,9 @@ reference: Miscellaneous "utility" classes and functions contents: - sample_without_replacement + - expand_dims_1d + - expand_dims_2d + - expand_dims_2d_diag - title: Package info desc: >