-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathtest_parallel.r
47 lines (40 loc) · 1.28 KB
/
test_parallel.r
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
## A very simple script, that should be run on an installed
## package, more or less as follows:
##
## R --quiet --vanilla < test_serial.r
##
## This serves to check the namespacing usage for the parallel
## system, but we check serial too to be safe.
library(harsat)
working.directory <- getwd()
water_data <- read_data(
compartment = "water",
purpose = "OSPAR",
contaminants = "water.txt",
stations = "stations.txt",
data_dir = file.path(working.directory, "data", "example_OSPAR"),
info_dir = file.path(working.directory, "information", "OSPAR_2022"),
extraction = "2023/08/23"
)
water_data <- tidy_data(water_data)
water_timeseries <- create_timeseries(
water_data,
determinands.control = list(
CHR = list(det = "CHRTR", action = "replace"),
BBKF = list(det = c("BBF", "BKF", "BBJF", "BBJKF"), action = "bespoke"),
PFOS = list(det = c("N-PFOS", "BR-PFOS"), action = "sum"),
CB138 = list(det = c("CB138+163"), action = "replace"),
HCEPX = list(det = c("HCEPC", "HCEPT"), action = "sum"),
HCH = list(det = c("HCHA", "HCHB", "HCHG"), action = "sum")
)
)
water_assessment_serial <- run_assessment(
water_timeseries,
AC = "EQS",
parallel = FALSE
)
water_assessment_parallel <- run_assessment(
water_timeseries,
AC = "EQS",
parallel = TRUE
)