Skip to content

Commit

Permalink
Merge branch 'release/1.11.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
HenrikBengtsson committed Oct 27, 2024
2 parents 8cce49c + a77c953 commit ee3c906
Show file tree
Hide file tree
Showing 22 changed files with 1,271 additions and 1,075 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,4 @@ Rplots.pdf$
^docs
^pkgdown
[.]Rdump
^\.github$
12 changes: 5 additions & 7 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ jobs:
- {os: ubuntu-latest, r: 'release' }
- {os: ubuntu-latest, r: 'oldrel' }
- {os: ubuntu-latest, r: 'oldrel-1' }
- {os: ubuntu-latest, r: '3.5' }
- {os: ubuntu-latest, r: 'oldrel-2' }
- {os: ubuntu-latest, r: '3.6' }
- {os: ubuntu-latest, r: 'release' , language: ko, label: ko }
- {os: ubuntu-latest, r: 'release' , globals_keepWhere: true, label: 'keepWhere' }
- {os: ubuntu-latest, r: 'release' , globals_keepWhere: false, label: '!keepWhere' }
Expand All @@ -39,8 +40,6 @@ jobs:
LANGUAGE: ${{ matrix.config.language }}
## R CMD check
_R_CHECK_CRAN_INCOMING_: false
_R_CHECK_LENGTH_1_CONDITION_: true
_R_CHECK_LENGTH_1_LOGIC2_: true
_R_CHECK_MATRIX_DATA_: true
_R_CHECK_SUGGESTS_ONLY_: true
_R_CHECK_THINGS_IN_TEMP_DIR_: true
Expand Down Expand Up @@ -88,17 +87,16 @@ jobs:

- name: Check
run: |
if (nzchar(Sys.getenv("R_FUTURE_PLAN")) || getRversion() < "3.5.0") Sys.setenv(RCMDCHECK_ERROR_ON = "error")
if (nzchar(Sys.getenv("R_FUTURE_PLAN"))) Sys.setenv(RCMDCHECK_ERROR_ON = "error")
rcmdcheck::rcmdcheck(
build_args = if (getRversion() < "3.5.0") "--no-build-vignettes",
args = c("--no-manual", "--as-cran", if (getRversion() < "3.5.0") c("--no-vignettes", "--no-build-vignettes", "--ignore-vignettes")),
args = c("--no-manual", "--as-cran"),
check_dir = "check"
)
shell: Rscript {0}

- name: Upload check results
if: failure()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check
82 changes: 0 additions & 82 deletions .github/workflows/covr.yaml

This file was deleted.

95 changes: 95 additions & 0 deletions .github/workflows/rhub.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# R-hub's generic GitHub Actions workflow file. It's canonical location is at
# https://github.com/r-hub/actions/blob/v1/workflows/rhub.yaml
# You can update this file to a newer version using the rhub2 package:
#
# rhub::rhub_setup()
#
# It is unlikely that you need to modify this file manually.

name: R-hub
run-name: "${{ github.event.inputs.id }}: ${{ github.event.inputs.name || format('Manually run by {0}', github.triggering_actor) }}"

on:
workflow_dispatch:
inputs:
config:
description: 'A comma separated list of R-hub platforms to use.'
type: string
default: 'linux,windows,macos'
name:
description: 'Run name. You can leave this empty now.'
type: string
id:
description: 'Unique ID. You can leave this empty now.'
type: string

jobs:

setup:
runs-on: ubuntu-latest
outputs:
containers: ${{ steps.rhub-setup.outputs.containers }}
platforms: ${{ steps.rhub-setup.outputs.platforms }}

steps:
# NO NEED TO CHECKOUT HERE
- uses: r-hub/actions/setup@v1
with:
config: ${{ github.event.inputs.config }}
id: rhub-setup

linux-containers:
needs: setup
if: ${{ needs.setup.outputs.containers != '[]' }}
runs-on: ubuntu-latest
name: ${{ matrix.config.label }}
strategy:
fail-fast: false
matrix:
config: ${{ fromJson(needs.setup.outputs.containers) }}
container:
image: ${{ matrix.config.container }}

steps:
- uses: r-hub/actions/checkout@v1
- uses: r-hub/actions/platform-info@v1
with:
token: ${{ secrets.RHUB_TOKEN }}
job-config: ${{ matrix.config.job-config }}
- uses: r-hub/actions/setup-deps@v1
with:
token: ${{ secrets.RHUB_TOKEN }}
job-config: ${{ matrix.config.job-config }}
- uses: r-hub/actions/run-check@v1
with:
token: ${{ secrets.RHUB_TOKEN }}
job-config: ${{ matrix.config.job-config }}

other-platforms:
needs: setup
if: ${{ needs.setup.outputs.platforms != '[]' }}
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.label }}
strategy:
fail-fast: false
matrix:
config: ${{ fromJson(needs.setup.outputs.platforms) }}

steps:
- uses: r-hub/actions/checkout@v1
- uses: r-hub/actions/setup-r@v1
with:
job-config: ${{ matrix.config.job-config }}
token: ${{ secrets.RHUB_TOKEN }}
- uses: r-hub/actions/platform-info@v1
with:
token: ${{ secrets.RHUB_TOKEN }}
job-config: ${{ matrix.config.job-config }}
- uses: r-hub/actions/setup-deps@v1
with:
job-config: ${{ matrix.config.job-config }}
token: ${{ secrets.RHUB_TOKEN }}
- uses: r-hub/actions/run-check@v1
with:
job-config: ${{ matrix.config.job-config }}
token: ${{ secrets.RHUB_TOKEN }}
56 changes: 56 additions & 0 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
on: [push]

name: test-coverage.yaml

permissions: read-all

jobs:
test-coverage:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v4

- name: Assert CODECOV_TOKEN is set
run: |
if [[ -z "${{secrets.CODECOV_TOKEN}}" ]]; then
>&2 echo "::error::ERROR: 'secrets.CODECOV_TOKEN' not set"
exit 1
fi
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::covr, any::xml2
needs: coverage

- name: Test coverage
run: |
cov <- covr::package_coverage(
quiet = FALSE,
clean = FALSE,
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
)
print(cov)
covr::to_cobertura(cov)
shell: Rscript {0}

- 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 }}

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v4
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

# Contributing to the 'future.apply' package

This Git repository uses the [Git Flow](https://nvie.com/posts/a-successful-git-branching-model/) branching model (the [`git flow`](https://github.com/petervanderdoes/gitflow-avh) extension is useful for this). The [`develop`](https://github.com/HenrikBengtsson/future.apply/tree/develop) branch contains the latest contributions and other code that will appear in the next release, and the [`master`](https://github.com/HenrikBengtsson/future.apply) branch contains the code of the latest release, which is exactly what is currently on [CRAN](https://cran.r-project.org/package=future.apply).
This Git repository uses the [Git Flow](https://nvie.com/posts/a-successful-git-branching-model/) branching model (the [`git flow`](https://github.com/petervanderdoes/gitflow-avh) extension is useful for this). The [`develop`](https://github.com/futureverse/future.apply/tree/develop) branch contains the latest contributions and other code that will appear in the next release, and the [`master`](https://github.com/futureverse/future.apply) branch contains the code of the latest release, which is exactly what is currently on [CRAN](https://cran.r-project.org/package=future.apply).

Contributing to this package is easy. Just send a [pull request](https://help.github.com/articles/using-pull-requests/). When you send your PR, make sure `develop` is the destination branch on the [future.apply repository](https://github.com/HenrikBengtsson/future.apply). Your PR should pass `R CMD check --as-cran`, which will also be checked by <a href="https://github.com/HenrikBengtsson/future.apply/actions?query=workflow%3AR-CMD-check">GitHub Actions</a> and when the PR is submitted.
Contributing to this package is easy. Just send a [pull request](https://help.github.com/articles/using-pull-requests/). When you send your PR, make sure `develop` is the destination branch on the [future.apply repository](https://github.com/futureverse/future.apply). Your PR should pass `R CMD check --as-cran`, which will also be checked by <a href="https://github.com/futureverse/future.apply/actions?query=workflow%3AR-CMD-check">GitHub Actions</a> and when the PR is submitted.

We abide to the [Code of Conduct](https://www.contributor-covenant.org/version/2/0/code_of_conduct/) of Contributor Covenant.
10 changes: 5 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: future.apply
Version: 1.11.2
Version: 1.11.3
Title: Apply Function to Elements in Parallel using Futures
Depends:
R (>= 3.2.0),
Expand All @@ -21,10 +21,10 @@ Authors@R: c(person("Henrik", "Bengtsson",
email = "[email protected]",
comment = c(ORCID = "0000-0002-7579-5165")),
person("R Core Team", role = c("cph", "ctb")))
Description: Implementations of apply(), by(), eapply(), lapply(), Map(), .mapply(), mapply(), replicate(), sapply(), tapply(), and vapply() that can be resolved using any future-supported backend, e.g. parallel on the local machine or distributed on a compute cluster. These future_*apply() functions come with the same pros and cons as the corresponding base-R *apply() functions but with the additional feature of being able to be processed via the future framework.
Description: Implementations of apply(), by(), eapply(), lapply(), Map(), .mapply(), mapply(), replicate(), sapply(), tapply(), and vapply() that can be resolved using any future-supported backend, e.g. parallel on the local machine or distributed on a compute cluster. These future_*apply() functions come with the same pros and cons as the corresponding base-R *apply() functions but with the additional feature of being able to be processed via the future framework <doi:10.32614/RJ-2021-048>.
License: GPL (>= 2)
LazyLoad: TRUE
URL: https://future.apply.futureverse.org, https://github.com/HenrikBengtsson/future.apply
BugReports: https://github.com/HenrikBengtsson/future.apply/issues
RoxygenNote: 7.3.1
URL: https://future.apply.futureverse.org, https://github.com/futureverse/future.apply
BugReports: https://github.com/futureverse/future.apply/issues
RoxygenNote: 7.3.2
Roxygen: list(markdown = TRUE)
8 changes: 8 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# Version 1.11.3 [2024-10-27]

## Bug Fixes

* Use of `future.seed = TRUE` could result in an error
`!any(seed_next != seed) is not TRUE` in rare cases.


# Version 1.11.2 [2024-03-27]

## Miscellaneous
Expand Down
3 changes: 1 addition & 2 deletions R/future.apply-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@
#'
#' @keywords manip programming iteration
#'
#' @docType package
#' @aliases future.apply-package
#' @name future.apply
NULL
"_PACKAGE"
2 changes: 1 addition & 1 deletion R/future_xapply.R
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ future_xapply <- local({
## than one element is processed per future. The adjustment is done by
## scaling up the limit by the number of elements in the chunk. This is
## a "good enough" approach.
## (https://github.com/HenrikBengtsson/future.apply/issues/8).
## (https://github.com/futureverse/future.apply/issues/8).
if (length(chunks) > 1L) {
options(future.globals.maxSize = length(chunks) * globals.maxSize.default)
if (debug) mdebugf(" - Adjusted option 'future.globals.maxSize': %.0f -> %d * %.0f = %.0f (bytes)", globals.maxSize.default, length(chunks), globals.maxSize.default, getOption("future.globals.maxSize"))
Expand Down
5 changes: 4 additions & 1 deletion R/rng_utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ set_random_seed <- function(seed) {
next_random_seed <- function(seed = get_random_seed()) {
sample.int(n = 1L, size = 1L, replace = FALSE)
seed_next <- get_random_seed()
stop_if_not(!any(seed_next != seed))

## Assert RNG state changed
stop_if_not(identical(seed_next, seed))

invisible(seed_next)
}

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@


<div id="badges"><!-- pkgdown markup -->
<a href="https://CRAN.R-project.org/web/checks/check_results_future.apply.html"><img border="0" src="https://www.r-pkg.org/badges/version/future.apply" alt="CRAN check status"/></a> <a href="https://github.com/HenrikBengtsson/future.apply/actions?query=workflow%3AR-CMD-check"><img border="0" src="https://github.com/HenrikBengtsson/future.apply/actions/workflows/R-CMD-check.yaml/badge.svg?branch=develop" alt="R CMD check status"/></a> <a href="https://app.codecov.io/gh/HenrikBengtsson/future.apply"><img border="0" src="https://codecov.io/gh/HenrikBengtsson/future.apply/branch/develop/graph/badge.svg" alt="Coverage Status"/></a>
<a href="https://CRAN.R-project.org/web/checks/check_results_future.apply.html"><img border="0" src="https://www.r-pkg.org/badges/version/future.apply" alt="CRAN check status"/></a> <a href="https://github.com/futureverse/future.apply/actions?query=workflow%3AR-CMD-check"><img border="0" src="https://github.com/futureverse/future.apply/actions/workflows/R-CMD-check.yaml/badge.svg?branch=develop" alt="R CMD check status"/></a>
</div>

# future.apply: Apply Function to Elements in Parallel using Futures
Expand Down Expand Up @@ -173,7 +173,7 @@ install.packages("future.apply")

To install the pre-release version that is available in Git branch `develop` on GitHub, use:
```r
remotes::install_github("HenrikBengtsson/future.apply", ref="develop")
remotes::install_github("futureverse/future.apply", ref="develop")
```
This will install the package from source.

Expand Down
Loading

0 comments on commit ee3c906

Please sign in to comment.