This repository has been archived by the owner on Jun 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
1_wqp_pull.yml
96 lines (76 loc) · 2.78 KB
/
1_wqp_pull.yml
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
target_default: 1_wqp_pull
packages:
- dataRetrieval
- yaml
- maps
- ggplot2
- ggthemes
- scipiper
- dplyr
- xml2
- lubridate
sources:
- 1_wqp_pull/src/wqp_inventory.R
- 1_wqp_pull/src/wqp_pull.R
- lib/src/require_local.R
targets:
1_wqp_pull:
depends:
- 1_wqp_pull/out/wqp_data.rds.ind
# -- set pull date -- #
# !! update pull date when you want to trigger a new inventory and pull
# pull IDs will be generated with this date string YYYYMMDD
wqp_pull_date:
command: c(I('2022-03-28'))
# -- get a CONUS inventory of available data for download -- #
wqp_pull_parameters:
command: yaml.load_file('1_wqp_pull/cfg/wqp_pull_params.yml')
wqp_partition_cfg:
command: yaml.load_file('1_wqp_pull/cfg/wqp_partition_config.yml')
# -- get inventory of observations available to download -- #
# get inventory of samples available on WQP
# only filters by characteristicNames, and pulls all at the same time
start_year:
command: get_start_years(begin = 1900, end = wqp_pull_date)
1_wqp_pull/inout/wqp_inventory.feather.ind:
command: do_inventory_tasks(
start_year = start_year,
pull_date = wqp_pull_date,
final_target = target_name,
'1_wqp_pull/src/wqp_inventory.R')
depends:
- wqp_pull_parameters
# write a table that shows sites and records by state for each comparison
# between PRs
1_wqp_pull/inout/wqp_inventory_summary.csv:
command: summarize_wqp_inventory(inv_ind = '1_wqp_pull/inout/wqp_inventory.feather.ind', out_file = target_name)
# make a plan for how to partition the inventory into separate data pulls.
1_wqp_pull/inout/wqp_pull_partitions.feather.ind:
command: partition_wqp_inventory(
partitions_ind = target_name,
wqp_pull_params = wqp_pull_parameters,
inventory_ind = '1_wqp_pull/inout/wqp_inventory.feather.ind',
wqp_partition_cfg = wqp_partition_cfg,
pull_date = wqp_pull_date)
# -- pull data! -- #
# prepare a remake-style plan for running each state as a separate
# remake target in a separate remake file (1_wqp_wqp_tasks.yml)
wqp_pull_plan:
command: plan_wqp_pull(partitions_ind='1_wqp_pull/inout/wqp_pull_partitions.feather.ind')
1_wqp_pull_tasks.yml:
command: create_wqp_pull_makefile(makefile = target_name,
task_plan = wqp_pull_plan,
final_targets = I('1_wqp_pull/out/wqp_data.rds.ind'))
# run the data pulls
1_wqp_pull/out/wqp_data.rds.ind:
command: loop_wqp_tasks(
ind_file=target_name,
task_plan=wqp_pull_plan,
task_makefile='1_wqp_pull_tasks.yml',
num_tries=I(30), sleep_on_error=I(20))
depends:
- 1_wqp_pull/src/get_wqp_data.R
1_wqp_pull/out/wqp_data_summary.csv:
command: summarize_wqp_data(
data_ind = '1_wqp_pull/out/wqp_data.rds.ind',
out_file = target_name)