@@ -13,6 +13,7 @@ QUALTRICS=$(shell $(PYTHON) -m delphi_utils get input_dir)
13
13
WEIGHTS =$(shell $(PYTHON ) -m delphi_utils get weights_in_dir)
14
14
CIDS =$(shell $(PYTHON ) -m delphi_utils get weights_out_dir)
15
15
INDIVIDUAL =$(shell $(PYTHON ) -m delphi_utils get individual_dir)
16
+ INDIVIDUAL_RACEETH =$(shell $(PYTHON ) -m delphi_utils get individual_raceeth_dir)
16
17
ARCHIVE =$(shell $(PYTHON ) -m delphi_utils get archive_dir)
17
18
RECEIVING =$(shell $(PYTHON ) -m delphi_utils get export_dir)
18
19
FB_CC =$(shell $(PYTHON ) -m delphi_utils get qualtrics.notify-bad-weights)
@@ -26,6 +27,7 @@ MAX_WEIGHTED=ls -1 $(WEIGHTS) | grep dap | tail -1 | sed 's/_.*//;s/-//g;'
26
27
ANTIJOIN: ="antijoin.cids.sorted.txt"
27
28
CIDS_DEST: ="fb-interchange/cmu_respondent_ids"
28
29
INDIVID_DEST: ="fb-public-results/"
30
+ INDIVID_RACEETH_DEST: ="protected-race-ethnicity-data/"
29
31
RAW_DEST: ="raw"
30
32
31
33
# dry-run mode: generate all files, but do not post them anywhere, and disable all emails to outside parties.
@@ -52,11 +54,12 @@ tidy: receiving
52
54
cp params.json tidy/
53
55
mv $(RECEIVING ) /* .csv tidy/$(RECEIVING )
54
56
mv $(INDIVIDUAL ) /* .csv* tidy/$(INDIVIDUAL )
57
+ mv $(INDIVIDUAL_RACEETH ) /* .csv* tidy/$(INDIVIDUAL_RACEETH )
55
58
tar -czf scratch/tidy-` date +" %Y-%m-%d-%H%M%S" ` .tgz --exclude=' tidy-*.tgz' tidy
56
59
mv scratch/* .tgz tidy/
57
60
58
61
clean :
59
- rm -f $(RECEIVING ) /* .csv $(INDIVIDUAL ) /* .csv $(CIDS ) /* .csv
62
+ rm -f $(RECEIVING ) /* .csv $(INDIVIDUAL ) /* .csv $(INDIVIDUAL_RACEETH ) / * .csv $( CIDS ) /* .csv
60
63
61
64
clean-archive :
62
65
rm -f $(ARCHIVE ) /* .Rds
@@ -98,6 +101,7 @@ params.json: $(TODAY)
98
101
PAT=` grep fb-survey params.json | awk ' BEGIN{FS="\""}{print $$2}' | sed ' s/ /_/g;s/^/-e /' ` ; \
99
102
$(PYTHON ) -m delphi_utils set \
100
103
debug false \
104
+ produce_individual_raceeth true \
101
105
end_date $(YESTERDAY ) \
102
106
input <( find $( QUALTRICS) -maxdepth 1 -newer $< -type f -name " *.csv" | sort | grep $$ {PAT} | tr ' \n' ' ,' | sed ' s_$(QUALTRICS)/__g;s/,$$//' ) \
103
107
parallel true \
@@ -136,7 +140,7 @@ run-R: $(CIDS)
136
140
grep " scheduled core" tmp ; \
137
141
[ " $$ ?" -eq 1 ]
138
142
139
- pipeline : scratch init-qualtrics params.json $(WEIGHTS ) run-R post-cids post-individual post-done tidy
143
+ pipeline : scratch init-qualtrics params.json $(WEIGHTS ) run-R post-cids post-individual post-individual-raceeth post- done tidy
140
144
grep $(TODAY ) params.json
141
145
[ -f $( YESTERDAY) ] && rm $(YESTERDAY ) || true
142
146
touch $@
@@ -193,6 +197,19 @@ post-individual: $(TODAY) $(INDIVIDUAL)
193
197
echo " SUCCESS: $( DRY_MESSAGE) Posted ` echo $$ {POST} | wc -w` microresponse files" >> $(MESSAGES )
194
198
touch $@
195
199
200
+ post-individual-raceeth : $(TODAY ) $(INDIVIDUAL_RACEETH )
201
+ POST=` find $( INDIVIDUAL_RACEETH) -maxdepth 1 -newer $( TODAY) -name " cvid_responses_*.csv" ` ; \
202
+ [ -n " $$ {POST}" ]; \
203
+ BATCH=" " ; \
204
+ for f in $$ {POST}; do \
205
+ (grep token $$ f; [[ $$ ? -eq 1 ]]); \
206
+ gzip -f $$ f; \
207
+ BATCH=" $$ {BATCH}put $$ {f}.gz ${INDIVID_RACEETH_DEST} \n" ; \
208
+ done ; \
209
+ $(SFTP_POST ) ; \
210
+ echo " SUCCESS: $( DRY_MESSAGE) Posted ` echo $$ {POST} | wc -w` race-ethnicity microresponse files" >> $(MESSAGES )
211
+ touch $@
212
+
196
213
post-done : post-cids
197
214
touch $(YESTERDAY ) .done
198
215
BATCH=" put $( YESTERDAY) .done $( CIDS_DEST) \n" ; \
0 commit comments