This repository has been archived by the owner on Jun 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
remake.yml
246 lines (214 loc) · 6.47 KB
/
remake.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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
include:
- 1_spatial.yml
- 2_observations.yml
- 3_drivers.yml
- 4_forecasts.yml
packages:
- yaml
- dplyr
- tidyr
- meddle # at least v0.0.12
- readr
- feather
- rgdal
- stringr
- sf
- sbtools
- dssecrets
- scipiper
- tidyverse
sources:
- src/sb_utils.R
- src/sb_functions.R
- src/spatial_functions.R
targets:
all:
depends:
- 00_parent_sb_xml
- 01_spatial_sb_xml
- 01_spatial_sb_data
# - log/01_spatial_sb_data.csv
- 02_observations_sb_data
- 02_observations_sb_xml
# - log/02_observations_sb_data.csv
- 03_drivers_sb_xml
- 03_drivers_sb_data
# - log/03_drivers_sb_data.csv
- 04_forecasts_sb_xml
- 04_forecasts_sb_data
# - log/04_forecasts_sb_data.csv
# - 04_inputs_sb_meteo
## PARENT ##
## Build xml for parent item and save to out_xml folder
out_xml/00_parent.xml:
command: render(
filename = target_name,
"in_text/text_SHARED.yml",
"in_text/text_00_parent.yml",
geospatial_area_metadata
)
## Push parent metadata xml to sciencebase
00_parent_sb_xml:
command: sb_render_post_xml(
sbid_00_parent,
xml_file = I('00_parent.xml'),
"in_text/text_SHARED.yml",
"in_text/text_00_parent.yml",
geospatial_area_metadata
)
## Push parent metadata xml to sb via log file
## Note: use this target only if you are having trouble seeing changes to sciencebase item
# log/00_parent_sb.csv:
# command: sb_replace_files(
# filename = target_name,
# sb_id = sbid_00_parent,
# sources = 'src/sb_utils.R',
# 'out_xml/00_parent.xml')
## SPATIAL ##
## Build metadata xml for spatial data and save locally to out_xml
out_xml/01_spatial.xml:
command: render(
filename = target_name,
"in_text/text_SHARED.yml",
"in_text/text_01_spatial.yml",
geospatial_area_metadata
)
## Push spatial metadata to sciencebase
01_spatial_sb_xml:
command: sb_render_post_xml(
sbid_01_spatial,
xml_file = I('01_spatial.xml'),
"in_text/text_SHARED.yml",
"in_text/text_01_spatial.yml",
geospatial_area_metadata
)
## Push spatial data metadata to sciencebase
01_spatial_sb_data:
command: sb_replace_files(
sb_id = sbid_01_spatial,
"out_data/XX_geospatial_area_WG84.zip"
)
### Push all spatial data + metadata xml to sb
# log/01_spatial_sb_data.csv:
# command: sb_replace_files_log(
# filename = target_name,
# sb_id = sbid_01_spatial,
# sources = "src/sb_utils.R",
# "out_data/XX_geospatial_area_WG84.zip",
# "out_xml/01_spatial.xml")
## OBSERVATIONS ##
## Build metadata xml for obs data and save locally to out_xml
out_xml/02_observations.xml:
command: render(
filename = target_name,
"in_text/text_SHARED.yml",
"in_text/text_02_observations.yml",
geospatial_area_metadata
)
## Push obs data metadata to sciencebase
02_observations_sb_xml:
command: sb_render_post_xml(
sbid_02_observations,
xml_file = I('02_observations.xml'),
"in_text/text_SHARED.yml",
"in_text/text_02_observations.yml",
geospatial_area_metadata
)
## Push obs data to sciencebase
02_observations_sb_data:
command: sb_replace_files(
sbid_02_observations,
"out_data/XX_observations.zip"
)
## Push all obs data + metadata xml to sb via log file
## Note: use this target only if you are having trouble seeing changes to sciencebase item
# log/02_observations_sb_data.csv:
# command: sb_replace_files_log(
# filename = target_name,
# sb_id = sbid_02_observations,
# sources = "src/sb_utils.R",
# "out_data/XX_observations.zip",
# "out_xml/02_observations.xml")
## DRIVER ##
## Build metadata xml for driver and save locally to out_xml
out_xml/03_drivers.xml:
command: render(
filename = target_name,
"in_text/text_SHARED.yml",
"in_text/text_03_drivers.yml",
geospatial_area_metadata
)
## Push driver metadata to sciencebase
03_drivers_sb_xml:
command: sb_render_post_xml(
sbid_03_drivers,
xml_file = I('03_drivers.xml'),
"in_text/text_SHARED.yml",
"in_text/text_03_drivers.yml",
geospatial_area_metadata
)
## Push driver data to sciencebase
03_drivers_sb_data:
command: sb_replace_files(
sbid_03_drivers,
'out_data/XX_driver_data_1.zip',
'out_data/XX_driver_data_2.zip'
)
## Push all driver data + metadata xml to sb via log file
## Note: use this target only if you are having trouble seeing changes to sciencebase item
# log/03_drivers_sb_data.csv:
# command: sb_replace_files_log(
# filename = target_name,
# sb_id = sbid_03_drivers,
# sources = 'src/sb_utils.R',
# out_data/XX_driver_data_1.zip',
# 'out_data/XX_driver_data_2.zip',
# 'out_xml/03_drivers.xml'
# )
## FORECASTS ##
## Build metadata xml for forecasts and save locally to out_xml
out_xml/04_forecasts.xml:
command: render(
filename = target_name,
"in_text/text_SHARED.yml",
"in_text/text_04_forecasts.yml",
geospatial_area_metadata
)
## Push forecasts metadata to sciencebase
04_forecasts_sb_xml:
command: sb_render_post_xml(
sbid_04_forecasts,
xml_file = I('04_forecasts.xml'),
"in_text/text_SHARED.yml",
"in_text/text_04_forecasts.yml",
geospatial_area_metadata
)
## Push forecasts data to sciencebase
04_forecasts_sb_data:
command: sb_replace_files(
sbid_04_forecasts,
'out_data/XX_forecasts1.zip',
'out_data/XX_forecasts2.zip'
)
## Push all forecasts data + metadata xml to sb via log file
## Note: use this target only if you are having trouble seeing changes to sciencebase item
# log/04_forecasts_sb_data.csv:
# command: sb_replace_files_log(
# filename = target_name,
# sb_id = sbid_04_forecasts,
# sources = 'src/sb_utils.R',
# 'out_data/XX_forecasts1.zip',
# 'out_data/XX_forecasts2.zip',
# 'out_xml/04_forecasts.xml'
# )
# ------ SB IDs --------
sbid_00_parent:
command: c(I('XX_sb_id_parent')) #
sbid_01_spatial:
command: c(I('XX_sb_id_spatial')) #
sbid_02_observations:
command: c(I('XX_sb_id_observations')) #
sbid_03_drivers:
command: c(I('XX_sb_id_drivers')) #
sbid_04_forecasts:
command: c(I('XX_sb_id_forecasts')) #