Skip to content

Commit

Permalink
Merge branch 'master' into 4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
krivit committed Jun 15, 2024
2 parents 4dff2d0 + a9e65bc commit d05a619
Show file tree
Hide file tree
Showing 34 changed files with 482 additions and 201 deletions.
151 changes: 72 additions & 79 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
# debug: compile package with -DDEBUG and -UNDEBUG
#
# covr: run in covr mode may be used with 'full' but probably not with others.
#
#
# Typical public, private, and release configurations are provided in the variables below.

on: [push, pull_request]

Expand All @@ -37,19 +40,23 @@ name: R-CMD-check
env:
PUBLIC: ''
PRIVATE: ''
PUBLIC_CONFIG: '{"config":[
{"os":"windows-latest", "r":"release", "timeout":360, "flags":"binaries"},
{"os":"macOS-latest", "r":"release", "timeout":360, "flags":"binaries, ubsan"},
{"os":"ubuntu-latest", "r":"release", "timeout":360, "flags":"full, ubsan, debug"},
{"os":"ubuntu-latest", "r":"devel", "timeout":360, "flags":"vignettes, remote"},
{"os":"ubuntu-latest", "r":"release", "timeout":360, "flags":"full, covr"}]}'
RELEASE_CONFIG: '{"config":[
{"os":"windows-latest", "r":"release", "timeout":360, "flags":"binaries, vignettes, remote, strict"},
{"os":"macOS-latest", "r":"release", "timeout":360, "flags":"binaries, ubsan, vignettes, remote, strict"},
{"os":"ubuntu-latest", "r":"release", "timeout":360, "flags":"full, ubsan, debug, strict"},
{"os":"ubuntu-latest", "r":"devel", "timeout":360, "flags":"vignettes, remote, strict"},
{"os":"ubuntu-latest", "r":"release", "timeout":360, "flags":"full, covr, strict"}]}'
PRIVATE_CONFIG: '{"config":[
{"os":"ubuntu-latest", "r":"release", "timeout":10, "flags":"none"}
]}'

jobs:
## Remove-Old-Artifacts:
## runs-on: ubuntu-latest
## timeout-minutes: 10
##
## steps:
## - name: Remove old artifacts
## uses: c-hive/[email protected]
## with:
## age: '1 month'
## skip-recent: 8

Set-Matrix-Private:
runs-on: ubuntu-latest
outputs:
Expand Down Expand Up @@ -87,24 +94,16 @@ jobs:
run: |
if [[ "${{ env.IAM }}" == 'public' ]] # Public: full set.
then
config='{"config":[
{"os":"windows-latest", "r":"release", "timeout":360, "flags":"remote, vignettes, strict, binaries"},
{"os":"macOS-latest", "r":"release", "timeout":360, "flags":"remote, vignettes, strict, binaries, ubsan"},
{"os":"ubuntu-20.04", "r":"release", "rspm":"https://packagemanager.rstudio.com/cran/__linux__/focal/latest", "timeout":360, "flags":"strict, full, ubsan, debug"},
{"os":"ubuntu-20.04", "r":"devel", "rspm":"https://packagemanager.rstudio.com/cran/__linux__/focal/latest", "timeout":360, "flags":"strict, vignettes, remote"},
{"os":"ubuntu-20.04", "r":"release", "rspm":"https://packagemanager.rstudio.com/cran/__linux__/focal/latest", "timeout":360, "flags":"full, covr"}]}'
config='${{ env.RELEASE_CONFIG }}'
elif [[ "${{ env.FOUND_PUBLIC }}" != '0' ]] # Private with no public analogue: reduced set.
then
config='{"config":[
{"os":"ubuntu-20.04", "r":"release", "rspm":"https://packagemanager.rstudio.com/cran/__linux__/focal/latest", "timeout":10, "flags":"none"}
]}'
config='${{ env.PRIVATE_CONFIG }}'
else # Private with public analogue: no checking.
config=''
fi
config="${config//'%'/'%25'}"
config="${config//$'\n'/'%0A'}"
config="${config//$'\r'/'%0D'}"
echo "::set-output name=matrix::$config"
config="${config//$'\r'/' '}"
config="${config//$'\n'/' '}"
echo "matrix=$config" >> $GITHUB_OUTPUT
R-CMD-check:
needs: Set-Matrix-Private
Expand All @@ -122,7 +121,6 @@ jobs:
env:
HOMEBREW_NO_INSTALL_CLEANUP: 1
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}

steps:
- name: If available, use the Janitor's key rather than the repository-specific key.
Expand All @@ -136,60 +134,40 @@ jobs:
fi
shell: bash

- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-r@v1
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
r-version: ${{ matrix.config.r }}

- name: Install GhostScript (on Linux if running vignettes)
- name: Install tidy (on Linux if running vignettes)
if: runner.os == 'Linux' && contains(matrix.config.flags, 'vignettes')
run: |
/usr/bin/sudo DEBIAN_FRONTEND=noninteractive apt-get install -y ghostscript
/usr/bin/sudo DEBIAN_FRONTEND=noninteractive apt-get install -y tidy
shell: bash

- uses: r-lib/actions/setup-pandoc@v1
- uses: r-lib/actions/setup-pandoc@v2

- name: Install tinytex (system)
if: contains(matrix.config.flags, 'vignettes')
uses: r-lib/actions/setup-tinytex@v1
uses: r-lib/actions/setup-tinytex@v2

- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}

- name: Cache R packages
if: runner.os != 'Windows'
uses: actions/cache@v2
- uses: r-lib/actions/setup-r-dependencies@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-

- name: Install system dependencies
if: runner.os == 'Linux'
run: |
while read -r cmd
do
eval sudo $cmd
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))')
sudo apt-get install -y libcurl4-openssl-dev
- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("pkgbuild"); stopifnot(require("pkgbuild"))
remotes::install_cran("rcmdcheck"); stopifnot(require("rcmdcheck"))
remotes::install_cran("covr"); stopifnot(require("covr"))
shell: Rscript {0}
extra-packages: |
any::rcmdcheck
any::covr
any::V8
any::xml2
needs: |
check
coverage
- name: Install tinytex (R)
if: contains(matrix.config.flags, 'vignettes')
run: |
remotes::install_cran("tinytex")
if(!requireNamespace("tinytex", quietly = TRUE)) pak::pkg_install("tinytex")
tinytex:::install_yihui_pkgs()
tinytex::tlmgr_install("makeindex")
shell: Rscript {0}
Expand All @@ -203,7 +181,7 @@ jobs:

- name: Upload build results
if: contains(matrix.config.flags, 'binaries') && !failure()
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-binaries
path: binaries
Expand Down Expand Up @@ -239,18 +217,21 @@ jobs:
error_on <- if(Sys.getenv("FAIL_ON_WARN") == "true") "warning" else "error"
extra_flags <- c()
if(Sys.getenv("USE_UBSAN") == "true"){
Sys.setenv(PKG_LIBS=paste(Sys.getenv("PKG_LIBS"), "-fsanitize=undefined"),
PKG_CFLAGS=paste(Sys.getenv("PKG_CFLAGS"), "-fsanitize=undefined"),
PKG_CXXFLAGS=paste(Sys.getenv("PKG_CXXFLAGS"), "-fsanitize=undefined"),
UBSAN_OPTIONS=paste(Sys.getenv("UBSAN_OPTIONS"), "print_stacktrace=1"))
extra_flags <- c(extra_flags, "-fsanitize=undefined")
Sys.setenv(UBSAN_OPTIONS=paste(Sys.getenv("UBSAN_OPTIONS"), "print_stacktrace=1"))
}
if(Sys.getenv("SET_DEBUG") == "true"){
Sys.setenv(PKG_LIBS=paste(Sys.getenv("PKG_LIBS"), "-UNDEBUG -DDEBUG"),
PKG_CXXFLAGS=paste(Sys.getenv("PKG_CXXFLAGS"), "-UNDEBUG -DDEBUG"),
PKG_CFLAGS=paste(Sys.getenv("PKG_CFLAGS"), "-UNDEBUG -DDEBUG"))
}
if(Sys.getenv("SET_DEBUG") == "true") extra_flags <- c(extra_flags, "-UNDEBUG", "-DDEBUG")
# Before R 4.3.0, R itself was not compliant.
if(getRversion() >= "4.3") extra_flags <- c(extra_flags, "-Wstrict-prototypes")
Sys.setenv(PKG_LIBS=paste(c(Sys.getenv("PKG_LIBS"), extra_flags), collapse=" "),
PKG_CXXFLAGS=paste(c(Sys.getenv("PKG_CXXFLAGS"), extra_flags), collapse=" "),
PKG_CFLAGS=paste(c(Sys.getenv("PKG_CFLAGS"), extra_flags), collapse=" "))
rcmdcheck::rcmdcheck(args = check_args, build_args = build_args, error_on = error_on, check_dir = "check")
shell: Rscript {0}
Expand All @@ -274,24 +255,36 @@ jobs:

- name: Upload check results
if: contains(matrix.config.flags, 'covr') == false && failure()
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: |
check
!check/*/00_pkg_src
- name: Preinstall package to work around an issue in covr # can be removed after covr update
if: contains(matrix.config.flags, 'covr')
run: R CMD INSTALL .
shell: bash

- name: Test coverage
if: contains(matrix.config.flags, 'covr')
timeout-minutes: ${{ matrix.config.timeout }}
env:
_R_CHECK_CRAN_INCOMING_REMOTE_: false
_R_CHECK_FORCE_SUGGESTS_: ${{ runner.os != 'macOS' }} # Rmpi is not available on macOS.
ENABLE_statnet_TESTS: ${{ contains(matrix.config.flags, 'full') }}
run: covr::codecov(type=c("tests","examples"))
run: |
cov <- covr::package_coverage(
type=c("tests", "examples"),
quiet = FALSE,
clean = FALSE,
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
)
covr::to_cobertura(cov)
shell: Rscript {0}

- name: Upload coverage results
if: contains(matrix.config.flags, 'covr')
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: ${{ github.event_name != 'pull_request' && true || false }}
file: ./cobertura.xml
plugin: noop
disable_search: true
token: ${{ secrets.CODECOV_TOKEN }}
18 changes: 10 additions & 8 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
Package: ergm.count
Version: 4.1.1
Date: 2022-05-24
Version: 4.1.2
Date: 2024-06-15
Title: Fit, Simulate and Diagnose Exponential-Family Models for Networks with Count Edges
Authors@R: c(
person("Pavel N.", "Krivitsky", role=c("aut","cre"), email="[email protected]", comment=c(ORCID="0000-0002-9101-3362")),
person("Mark S.", "Handcock", role=c("ctb"), email="[email protected]"),
person("David R.", "Hunter", role=c("ctb"), email="[email protected]"),
person(c("Pavel", "N."), "Krivitsky", role=c("aut","cre"), email="[email protected]", comment=c(ORCID="0000-0002-9101-3362")),
person(c("Mark", "S."), "Handcock", role=c("ctb"), email="[email protected]"),
person(c("David", "R."), "Hunter", role=c("ctb"), email="[email protected]"),
person("Joyce", "Cheng", role=c("ctb"), email="[email protected]"))
Depends:
ergm (>= 4.2.1),
network (>= 1.15)
Imports:
statnet.common (>= 4.2.0)
statnet.common (>= 4.2.0),
Rdpack (>= 2.4)
LinkingTo:
ergm
Description: A set of extensions for the 'ergm' package to fit weighted networks whose edge weights are counts. See Krivitsky (2012) <doi:10.1214/12-EJS696> and Krivitsky, Hunter, Morris, and Klumb (2021) <arXiv:2106.04997>.
RdMacros: Rdpack
Description: A set of extensions for the 'ergm' package to fit weighted networks whose edge weights are counts. See Krivitsky (2012) <doi:10.1214/12-EJS696> and Krivitsky, Hunter, Morris, and Klumb (2023) <doi:10.18637/jss.v105.i06>.
License: GPL-3 + file LICENSE
URL: https://statnet.org
BugReports: https://github.com/statnet/ergm.count/issues
Expand All @@ -24,7 +26,7 @@ Suggests:
rmarkdown,
testthat (>= 3.0.0)
VignetteBuilder: rmarkdown, knitr
RoxygenNote: 7.2.0
RoxygenNote: 7.3.1
Roxygen: list(markdown = TRUE)
Encoding: UTF-8
Config/testthat/parallel: true
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ Martina Morris, University of Washington

The 'statnet' development team

Copyright 2008-2022
Copyright 2008-2024
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
import(ergm)
import(network)
import(statnet.common)
importFrom(Rdpack,reprompt)
useDynLib(ergm.count)
2 changes: 1 addition & 1 deletion R/InitErgmReference.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# open source, and has the attribution requirements (GPL Section 7) at
# https://statnet.org/attribution .
#
# Copyright 2008-2022 Statnet Commons
# Copyright 2008-2024 Statnet Commons
################################################################################

#' @templateVar name Poisson
Expand Down
2 changes: 1 addition & 1 deletion R/InitWtErgmProposal.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# open source, and has the attribution requirements (GPL Section 7) at
# https://statnet.org/attribution .
#
# Copyright 2008-2022 Statnet Commons
# Copyright 2008-2024 Statnet Commons
################################################################################

#' @templateVar name Disc
Expand Down
2 changes: 1 addition & 1 deletion R/InitWtErgmTerm.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# open source, and has the attribution requirements (GPL Section 7) at
# https://statnet.org/attribution .
#
# Copyright 2008-2022 Statnet Commons
# Copyright 2008-2024 Statnet Commons
################################################################################

#' @templateVar name CMP
Expand Down
2 changes: 1 addition & 1 deletion R/data.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# open source, and has the attribution requirements (GPL Section 7) at
# https://statnet.org/attribution .
#
# Copyright 2008-2022 Statnet Commons
# Copyright 2008-2024 Statnet Commons
################################################################################
#' Karate club social network of Zachary (1977)
#'
Expand Down
Loading

0 comments on commit d05a619

Please sign in to comment.