Skip to content

Commit

Permalink
Use rounding for non-stochastic dispersers from cell (#205)
Browse files Browse the repository at this point in the history
* Use rounding for non-stochastic dispersers from cell

Update to PoPS Core with flooring instead of rounding in computation of number of non-stochastic dispersers from cell.

* update renv

* update github test coverage yaml

* update documentation

* test lock fiile with dev dependicies.

* update workflow for checks

* update to newest pops-core main

---------

Co-authored-by: unknown <cjones1688@gmail.com>
  • Loading branch information
wenzeslaus and ChrisJones687 authored Dec 19, 2024
1 parent a2f71d4 commit 9354e1f
Show file tree
Hide file tree
Showing 12 changed files with 510 additions and 303 deletions.
21 changes: 15 additions & 6 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
pull_request:
branches: [main]

name: R-CMD-check
name: R-CMD-check.yaml

jobs:
R-CMD-check:
Expand Down Expand Up @@ -38,13 +38,22 @@ jobs:

- name: Install macOS system dependencies
if: runner.os == 'macOS'
run: brew install gdal proj fribidi
run: brew install gdal proj

- name: Install Linux system dependencies
if: runner.os == 'Linux'
run: |
sudo apt install \
libudunits2-dev \
libgdal-dev \
libgeos-dev \
libproj-dev \
- uses: r-lib/actions/setup-renv@v2
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: check
# - uses: r-lib/actions/setup-r-dependencies@v2
# with:
# extra-packages: any::rcmdcheck
# needs: check

- uses: r-lib/actions/check-r-package@v2
with:
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
pull_request:
branches: [main, master]

name: test-coverage
name: test-coverage.yaml

jobs:
test-coverage:
Expand All @@ -15,18 +15,20 @@ jobs:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

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

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-renv@v2

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

- name: Test coverage
run: |
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,5 @@ Suggests:
pkgdown
LinkingTo:
Rcpp
RoxygenNote: 7.2.3
RoxygenNote: 7.3.2
VignetteBuilder: knitr
2 changes: 1 addition & 1 deletion inst/cpp/pops-core
3 changes: 1 addition & 2 deletions inst/include/host_pool.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,7 @@ class HostPool : public HostPoolInterface<RasterIndex>
}
}
else {
dispersers_from_cell =
static_cast<int>(std::floor(lambda * infected_at(row, col)));
dispersers_from_cell = std::lround(lambda * infected_at(row, col));
}
return dispersers_from_cell;
}
Expand Down
13 changes: 8 additions & 5 deletions man/calibrate.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 8 additions & 5 deletions man/pops.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 10 additions & 7 deletions man/pops_model.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 8 additions & 5 deletions man/pops_multirun.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 8 additions & 5 deletions man/validate.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9354e1f

Please sign in to comment.