Skip to content

Commit 2592199

Browse files
Workflow and Configuration file update (#216)
* udpate changelog * update changelog * replace parameters with config in functions. * update description and readme * add config.yaml example * update config tests to use new test config file * remove redundant functions for new workflow. * change pops_lite and pops_multirun to a single function called pops_simulate that does what pops_lite did. * remove functions * update documentation * update configuration function to handle new config_yaml with new variable names. * remove now unused lists * update tests and add test config yaml files * add config.yaml and test structure * update configuration to more easily handle tests. * update create summary stats to use new variable names * general updates more to come as tests are converted over to using the config file workflow. * update pops model to only take in config. This simplifies future updates. * update pops simulate to use the new pops_model api. * update pops testing function * update some tests * update files * update pops test * add data and configs for tests * udpate some tests and add associated yamls * update remaining pops single run tests and add configs. * updates to pops and config based on new yaml and testing * update pops_model * lint * add files and update calibrate and tests * add import from yaml * lint * update data * update config yamls * update tests * update data * update configuration function * update calculate all stats * update validate function * update other functions * update * update tests and lint * remove rds files from git so that they don't affect tests * update output path in yamls * update calibrate test path * add folder * update test coverage yaml
1 parent 6172ff8 commit 2592199

File tree

265 files changed

+20653
-14097
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

265 files changed

+20653
-14097
lines changed

.github/workflows/test-coverage.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,16 @@ jobs:
1616

1717
steps:
1818
- uses: actions/checkout@v4
19-
2019
- uses: r-lib/actions/setup-pandoc@v2
21-
2220
- uses: r-lib/actions/setup-r@v2
2321
with:
2422
use-public-rspm: true
2523

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

26+
- name: Install macOS system dependencies
27+
if: runner.os == 'macOS'
28+
run: brew install gdal proj
2829
# - uses: r-lib/actions/setup-r-dependencies@v2
2930
# with:
3031
# extra-packages: any::covr

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ rpops.Rproj
77
docs
88
inst/doc
99
*env
10+
*.rds

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ this repository.
4040

4141
- In PoPS Core we are more explicit with types and round to the nearest int for model aspects that require it (@wenzeslaus, #203, #204, #205, #206, and #210 and @ChrisJones687, #208 and #209).
4242

43+
- The workflow for PoPS has changed for version 3.0.0 and newer. We have moved to using a config file (.ymal or .csv). We then create a configuration variable in R and write out an .rds file that can be used in all other functions, see workflow documentation for more information (@ChrisJones687 #)
44+
4345
### Fixed
4446

4547
- Fixed MCC calculations that returned NaN with very large datasets (@ChrisJones687, #161).
@@ -64,7 +66,7 @@ this repository.
6466
- `validate`, `calibrate`, `pops_multirun`, and `pops` now take use_survival_rates, survival_rate_month,
6567
survival_rate_day, and survival_rates_file (@ChrisJones687, #147).
6668

67-
- `validate`, `calibrate`, `pops_multirun`, and `pops` now take network_movement as a parameter. This
69+
- `validate`, `calibrate`, `pops_multirun`, and `pops` now take network_movement as a parameter. This
6870
parameter controls how dispersal occurs along the network (@ChrisJones687, #147).
6971

7072
### Changed

DESCRIPTION

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ Imports:
3232
aws.s3,
3333
Metrics,
3434
methods,
35-
truncnorm
35+
truncnorm,
36+
yaml
3637
License: GPL-3 | file LICENSE
3738
BugReports: https://github.com/ncsu-landscape-dynamics/rpops/issues
3839
URL: http://www.github.com/ncsu-landscape-dynamics/rpops
@@ -53,5 +54,5 @@ Suggests:
5354
pkgdown
5455
LinkingTo:
5556
Rcpp
56-
RoxygenNote: 7.3.2
57+
RoxygenNote: 7.3.3
5758
VignetteBuilder: knitr

NAMESPACE

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,11 @@
22

33
export(calibrate)
44
export(configuration)
5-
export(configuration_qad_lite)
65
export(create_summary_stats_and_stacks)
76
export(pops)
8-
export(pops_lite)
97
export(pops_model)
10-
export(pops_multirun)
8+
export(pops_simulate)
119
export(quantity_allocation_disagreement)
12-
export(quantity_allocation_disagreement_lite)
1310
export(validate)
1411
importFrom(MASS,mvrnorm)
1512
importFrom(Metrics,rmse)
@@ -18,10 +15,8 @@ importFrom(Rcpp,sourceCpp)
1815
importFrom(aws.s3,head_object)
1916
importFrom(aws.s3,save_object)
2017
importFrom(doParallel,registerDoParallel)
21-
importFrom(foreach,"%:%")
2218
importFrom(foreach,"%do%")
2319
importFrom(foreach,"%dopar%")
24-
importFrom(foreach,foreach)
2520
importFrom(foreach,registerDoSEQ)
2621
importFrom(landscapemetrics,lsm_c_enn_mn)
2722
importFrom(landscapemetrics,lsm_c_lpi)
@@ -65,4 +60,5 @@ importFrom(terra,yres)
6560
importFrom(utils,read.csv)
6661
importFrom(utils,read.table)
6762
importFrom(utils,write.csv)
63+
importFrom(yaml,yaml.load_file)
6864
useDynLib(PoPS, .registration = TRUE)

R/calibrate.R

Lines changed: 65 additions & 411 deletions
Large diffs are not rendered by default.

R/checks.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ time_checks <- function(end_date, start_date, time_step, output_frequency, outpu
218218
duration <- lubridate::interval(start_date, end_date)
219219

220220
if (time_step == "week") {
221-
number_of_time_steps <- ceiling(lubridate::time_length(duration, "week"))
221+
number_of_time_steps <- floor(lubridate::time_length(duration, "week"))
222222
} else if (time_step == "month") {
223223
number_of_time_steps <- ceiling(lubridate::time_length(duration, "month"))
224224
} else if (time_step == "day") {

0 commit comments

Comments
 (0)