-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMonkfile
364 lines (293 loc) · 10.8 KB
/
Monkfile
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
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
#use dependency discovery for R/MATLAB
# @monk/autodep/dependencies.monkfile
#make a few plots relevant to motion ehergy
--command Rscript
--input motion_energy_plot.R
--input --match motion_energy\.csv
--output motion_energy_plot.pdf
#type "make figures" to try to refresh the figures
#--command --input --invisible --match '.*\.fig$'
#--invisible --phony figures
#Unpack all data into an R data file.
--command --once Rscript
--input --once unpack.R
--output --once data.RData
--input --match (.*_trials\.csv)
#make our motion energy graphs
--command Rscript
--input motion_energy_plot.R$
--input --match motion_energy.csv
--output --listing --mkdir energy/motion_energy_plot.list
--command Rscript
--input slopeModel.R
--input --match data.RData
--input motion_energy.csv
--output slopeModel.RData
--output slopeModel.pdf
--output --invisible inset_carrier.pdf
--output --invisible inset_sensitivity.pdf
--command Rscript
--input density.calibration.R
--input --match data.RData
--input slopeModel.RData
--output density.calibration.pdf
--command Rscript
--input --match "density.modeling.R$"
--input data.RData
--input slopeModel.RData
--output density.modeling.pdf
--output density.modeling.RData
# --command Rscript
# --input combined.model.R
# --input --match slopeModel\.RData
# --input density.modeling.RData
# --input motion_energy.csv
# --output combined.model.RData
# --output combined.model.pdf
# --phony --invisible pdf
--command Rscript # without folding
--input contours.R
--input --match slopeModel\.RData$
--input motion_energy.csv
--output --mkdir --listing contours/contours.list FALSE
--command --invisible --match --input contours/.*.pdf
--phony --invisible pdf
--command Rscript # with folding
--input contours.R
--input --match slopeModel.RData$
--input motion_energy.csv
--output --mkdir --listing contours/contours_folded.list TRUE
--phony --output --invisible intermediate_pdf
--command Rscript # with folding
--input contours.R
--input --match slopeModel.RData$
--input motion_energy.csv
--output --mkdir --listing contours/contours_presentation.list TRUE TRUE
#how about markov chain monte carlo?
--command RScript --input compileStan.R
--input --match (.*\.stan)\.R$
--output {0}.RData
--invisible --phony stan
--command Rscript --input --match (NineModels).R$
--output --listing {0}.list
--invisible --phony stan
--command Rscript --input StanModel.R
--input data.RData
--input motion_energy.csv
--input --match (.*).stan\.RData$
--output {0}.fit.RData
--invisible --phony fit
#some models are not baked yet, or need extra samples
#--command
#--output --match --invisible (CenterSurroundModel)\.fit\.RData$ 500
--command
--output --match --invisible (models/.*)\.fit\.RData$ --invisible --phony nine
--command
--output --match --invisible (ProportionalMotionEnergy)\.fit\.RData$ 4000
--command Rscript --input FitPlots.R
--input --match (.*)\.fit\.RData
--input motion_energy.csv
--output {0}.plots.pdf
--invisible --phony plot
# MotionEnergyLinear|MotionEnergySoftMin|
--command --once Rscript --input --once CompareStanFits.R
--output --once StanComparisonCircles.pdf
--input --match --once (OnlyMotionEnergy|SlopeModel|SoftMinModel)\.fit\.RData$
--invisible --phony plot
--command --once Rscript --input --once CompareStanFits.R
--output --once StanComparisonCircles.pdf
--input --match --once (OnlyMotionEnergy|SlopeModel|SoftMinModel)\.fit\.RData$
--invisible --phony plot
--command --once Rscript --input --once CompareStanFits.R
--output --once StanComparisonEnergies.pdf
--input --match --once (ProportionalMotionEnergy|SlopeModel|MotionEnergyRepulsion|OnlyMotionEnergy)\.fit\.RData$
--invisible --phony plot
--invisible --phony compare
--command --once Rscript --input --once CompareStanFits.R
--output --once StanComparisonCombined.pdf
--input --match --once (Hemifield|SummationField)\.fit\.RData$
--invisible --phony plot
--invisible --phony compare
--command --once Rscript --input --once CompareStanFits.R
--output --once models/comparison_d_{0}_c_{1}.pdf
--input --match models/d_([a-zA-Z_]*)_c_([a-zA-Z_]*)_e_([a-zA-Z_]*)\\.fit\\.RData$
--invisible --phony plot
--invisible --phony compare
--command --once Rscript --input --once CompareStanFits.R
--output --once models/comparison_c_{1}_e_{2}.pdf
--input --match models/d_([a-zA-Z_]*)_c_([a-zA-Z_]*)_e_([a-zA-Z_]*)\\.fit\\.RData$
--invisible --phony plot
--invisible --phony compare
--command --once Rscript --input --once CompareStanFits.R
--output --once models/comparison_d_{0}_e_{2}.pdf
--input --match models/d_([a-zA-Z_]*)_c_([a-zA-Z_]*)_e_([a-zA-Z_]*)\\.fit\\.RData$
--invisible --phony plot
--invisible --phony compare
#--command Rscript --input --once StanResiduals.R
--command pdfjoin %--rotateoversize 'false'
%--outfile --output contours/all_contours.pdf
'$$(' cat --input --match --listing contours/contours.list ')'
#--phony --invisible intermediate_pdf
--command pdfjoin %--rotateoversize 'false'
%--outfile --output contours/all_contours_folded.pdf
'$$(' cat --input --match --listing contours/contours_folded.list ')'
#--phony --invisible intermediate_pdf
--command '$(LYX)' %-e knitr --input --match ^(_master|[^_/][^/]*)\.lyx$
--output --invisible {0}.Rnw
--command Rscript %-e "\"library(knitr); knit('{0}.Rnw', '{0}.tex')\""
--input --invisible --match (.*)\.Rnw
--output --invisible --once {0}.tex
--command --invisible --input --match (.*)_weave\.R$
--output --invisible --once {0}.tex
--command --output --match density.tex
--input --invisible density.modeling.RData
#ater knitting, extract the document code from each .tex file
--command
--input ./extract_document
--input --match ((?:.*/)?)([^_][^/]*)(?<!_strip)(?<!_chapter)\.tex$
--output {0}{1}_strip.tex
#compile master document
--command latexmk %-pdf
%-pdflatex='pdflatex -halt-on-error -interaction=nonstopmode'
--input --match (_master)\.tex$
--input --invisible _preamble.tex
--input --invisible _master_preamble.tex
--output --invisible {0}.pdf
--output --invisible {0}.fls
--output --invisible {0}.aux
--output --invisible {0}.bbl
--phony --invisible latex
--invisible --phony pdf
--invisible --input intermediate_pdf
--command --output --match _master\\.pdf
--invisible --phony pdf
--command --output --invisible --match (_master|modeling)\\.pdf
--input --invisible model.pdf
#master pdf depends on all child .tex files
--command --input --invisible --match .*_strip\.tex$
--output --invisible _master.pdf
--command --input --invisible --match .*_strip\.tex$
--output --invisible _part1.pdf
--command --once touch
--once --output --tagged --match --phony chapters
#make "chapter" files
--command ./chapter --input --invisible chapter
--input --invisible --match (.*)_strip\\.tex
--output {0}_chapter.tex
{0}_strip
--command --once --output --tagged --match --phony --invisible includes
--command osascript poster_frame.applescript
--input --match (.*)\\.mov
--output {0}.png
--command --input --match --invisible (.*)\\.mov
--input --invisible {0}.png
--output --tagged --invisible includes
--command --output --invisible --match (.*_chapter|_master).pdf
--input --invisible includes
#compile individual chapter pdfs
--command latexmk
%-pdf %"-pdflatex=\"pdflatex -halt-on-error -interaction=nonstopmode\""
--input --match (.*)_chapter.tex
--input --invisible _master.tex
--input --invisible _preamble.tex
--input --invisible _master_preamble.tex
--output --invisible {0}_chapter.pdf
--output --invisible {0}_chapter.fls
--phony --invisible latex
--invisible --phony chapters
--command --match --invisible --input (.*)_strip\\.tex
--invisible --phony --output --tagged chapters
--invisible --input {0}_chapter.tex
--invisible --input {0}_chapter.pdf
#compile part 1
--command latexmk
%-pdf %"-pdflatex=\"pdflatex -halt-on-error -interaction=nonstopmode\""
--input --match _part1\\.tex$
--input --invisible _master.tex
--input --invisible _preamble.tex
--input --invisible _master_preamble.tex
--output --invisible _part1.pdf
--output --invisible _part1.fls
--command --output --match --invisible (.*)_chapter\\.pdf
--input --invisible {0}_strip.tex
--command grep '^INPUT' --match --input (.*)\.fls
| cut %-d "' '" %-f 2- > --output {0}.in
--command grep '^OUTPUT' --match --input (.*)\.fls
| cut %-d "' '" %-f 2- > --output {0}.prod
--command Rscript --input --match '(.*)_weave.R$'
--output {0}_plots.pdf
--phony --invisible pdf
#compile graffle figures...
--command osascript --input og-export.applescript
$(abspath --input --match --invisible (.*).graffle((?=/data\.plist|$)) {0}.graffle )
$(abspath --output {0}.pdf ) pdf
--phony --invisible graffles
--phony --invisible intermediate_pdf
#model.graffle includes some "inset" files as insets
--command --output --invisible --once model.pdf
--input --invisible --match inset_.*\.pdf
#everything plots depends on this generated file
--command --output --invisible --match everything\.tex
--input --invisible sensitivity-plot.RData
#which is updated when this is updated...
--command --output --invisible --match sensitivity-plot\.RData
--output --invisible results.tex
--command --once Rscript
--input --once compareLogProbs.R
--output --once models/compare_lp.pdf
--input --match models/.*\\.fit\\.RData
--invisible --phony --once plot
--invisible --phony --once compare
# --command --once Rscript --input --once CompareStanFits.R
# --output --once SlopeModel_segment_comparison.pdf
# --input --match --once SlopeModel_segment.*\\.fit\\.RData$
# --invisible --phony --once plot
# --invisible --phony --once compare
# --command --output --match --once --invisible .*_recording.fit.RData$
# 600 500 TRUE
# --invisible --phony predictions
--command Rscript --input check_predictions.R
--output --mkdir checks/{0}.pdf
--input --match (.*).fit.RData$
--invisible --phony plot
--invisible --phony check
TRUE
--command --once Rscript --input --once collect_times.R
--output --once models/timings.RData
--input --match .*\\.fit.RData
--invisible --phony --once fit
--command --once Rscript --input --once modeling_resids.R
--output --once models/residuals.pdf
--input --match .*\\.fit.RData
--invisible --phony --once plot
--invisible --phony --once compare
# compile web page versions
--command htlatex
--input --match _master.tex
"\"trouble,2\"" "\"\"" "\"\"" "\"-halt-on-error -interaction=nonstopmode\""
--output _master.html
--input --invisible trouble.cfg
--output --invisible _master.css
--invisible --phony html
--command
--output --invisible _master.html
--input --invisible --match .*_strip.tex
# extract web page version to subdirectory
--command --input ./extract_html
html _master*.html
--input --invisible --match _master.html
--output --invisible html/_master.html
--invisible --phony html
--command cat
--input custom.css
--input --match (_master).css
> --output html/{0}.css
--invisible --phony html
--command --once cp --once %-r
--input --match static_html/(.*)
--output html/{0}
--invisible --phony html
--command --once cp
--input --match _master.pdf
--output html/_master.pdf
--invisible --phony html