@@ -12,6 +12,7 @@ PYTHON:=env/bin/python
1212QUALTRICS =$(shell $(PYTHON ) -m delphi_utils get input_dir)
1313WEIGHTS =$(shell $(PYTHON ) -m delphi_utils get weights_in_dir)
1414CIDS =$(shell $(PYTHON ) -m delphi_utils get weights_out_dir)
15+ CIDS_EXP =$(shell $(PYTHON ) -m delphi_utils get experimental_weights_out_dir)
1516INDIVIDUAL =$(shell $(PYTHON ) -m delphi_utils get individual_dir)
1617INDIVIDUAL_RACEETH =$(shell $(PYTHON ) -m delphi_utils get individual_raceeth_dir)
1718ARCHIVE =$(shell $(PYTHON ) -m delphi_utils get archive_dir)
@@ -25,7 +26,9 @@ SFTP_OPTIONS=$(shell $(PYTHON) -m delphi_utils get sftp_options)
2526MAX_WEIGHTED =ls -1 $(WEIGHTS ) | grep dap | tail -1 | sed 's/_.*//;s/-//g;'
2627
2728ANTIJOIN: ="antijoin.cids.sorted.txt"
29+ ANTIJOIN_EXP: ="antijoin.experimental.cids.sorted.txt"
2830CIDS_DEST: ="fb-interchange/cmu_respondent_ids"
31+ CIDS_EXP_DEST: ="fb-interchange/cmu_respondent_ww_ids"
2932INDIVID_DEST: ="fb-public-results/"
3033INDIVID_RACEETH_DEST: ="protected-race-ethnicity-data/"
3134RAW_DEST: ="raw"
@@ -59,7 +62,7 @@ tidy: receiving
5962 mv scratch/* .tgz tidy/
6063
6164clean :
62- rm -f $(RECEIVING ) /* .csv $(INDIVIDUAL ) /* .csv $(INDIVIDUAL_RACEETH ) /* .csv $(CIDS ) /* .csv
65+ rm -f $(RECEIVING ) /* .csv $(INDIVIDUAL ) /* .csv $(INDIVIDUAL_RACEETH ) /* .csv $(CIDS ) / * .csv $( CIDS_EXP ) /* .csv
6366
6467clean-archive :
6568 rm -f $(ARCHIVE ) /* .Rds
@@ -78,6 +81,9 @@ install: install-python install-R
7881$(CIDS ) :
7982 [ -f $( CIDS) ] || mkdir -p $(CIDS )
8083
84+ $(CIDS_EXP ) :
85+ [ -f $( CIDS_EXP) ] || mkdir -p $(CIDS_EXP )
86+
8187init-qualtrics :
8288 grep ' "token": "..*"' params.json
8389
@@ -133,14 +139,14 @@ dev: delphiFacebook_1.0.tar.gz
133139lib :
134140 R -e ' roxygen2::roxygenise("delphiFacebook")'
135141
136- run-R : $(CIDS )
142+ run-R : $(CIDS ) $( CIDS_EXP )
137143 rm -rf tmp
138144 time Rscript run.R 2>&1 | tee tmp
139145 grep " run_facebook completed successfully" tmp
140146 grep " scheduled core" tmp ; \
141147 [ " $$ ?" -eq 1 ]
142148
143- pipeline : scratch init-qualtrics params.json $(WEIGHTS ) run-R post-cids post-individual post-individual-raceeth post-done tidy
149+ pipeline : scratch init-qualtrics params.json $(WEIGHTS ) run-R post-cids post-experimental-cids post- individual post-individual-raceeth post-done tidy
144150 grep $(TODAY ) params.json
145151 [ -f $( YESTERDAY) ] && rm $(YESTERDAY ) || true
146152 touch $@
@@ -184,6 +190,28 @@ post-cids: $(TODAY) $(CIDS)
184190 echo " SUCCESS: $( DRY_MESSAGE) Posted ` echo $$ {POST} | wc -w` cid files" >> $(MESSAGES )
185191 touch $@
186192
193+ post-experimental-cids : $(TODAY ) $(CIDS_EXP )
194+ rm -rf tmp
195+ touch $(ANTIJOIN_EXP )
196+ POST=` find $( CIDS_EXP) -maxdepth 1 -newer $( TODAY) -name " cvid_cids_*.csv" ` ; \
197+ [ -n " $$ {POST}" ]; \
198+ LC_ALL=C find $(CIDS_EXP ) -maxdepth 1 -daystart -mtime +0 -name " cvid_cids*.csv" -exec sort -u -o ${ANTIJOIN_EXP} {} +; \
199+ BATCH=" " ; \
200+ for f in $$ {POST}; do \
201+ LC_ALL=C comm -23 <( LC_ALL=C sort $$ f) ${ANTIJOIN_EXP} > tmp; \
202+ diff -q tmp $$ f || mv $$ f $$ f.bak; \
203+ mv tmp $$ f; \
204+ ncids=` wc -l $$ f | awk ' {print $$1}' ` ; \
205+ if [[ $$ ncids == " 0" ]]; then \
206+ echo " ERROR: 0 CIDs reported for $$ f" ; \
207+ exit 73; \
208+ fi ; \
209+ BATCH=" $$ {BATCH}put $$ f ${CIDS_EXP_DEST} \n" ; \
210+ done ; \
211+ $(SFTP_POST ) ; \
212+ echo " SUCCESS: $( DRY_MESSAGE) Posted ` echo $$ {POST} | wc -w` experimental cid files" >> $(MESSAGES )
213+ touch $@
214+
187215post-individual : $(TODAY ) $(INDIVIDUAL )
188216 POST=` find $( INDIVIDUAL) -maxdepth 1 -newer $( TODAY) -name " cvid_responses_*.csv" ` ; \
189217 [ -n " $$ {POST}" ]; \
@@ -210,10 +238,12 @@ post-individual-raceeth: $(TODAY) $(INDIVIDUAL_RACEETH)
210238 echo " SUCCESS: $( DRY_MESSAGE) Posted ` echo $$ {POST} | wc -w` race-ethnicity microresponse files" >> $(MESSAGES )
211239 touch $@
212240
213- post-done : post-cids
241+ post-done : post-cids post-experimental-cids
214242 touch $(YESTERDAY ) .done
215243 BATCH=" put $( YESTERDAY) .done $( CIDS_DEST) \n" ; \
216244 $(SFTP_POST )
245+ BATCH=" put $( YESTERDAY) .done $( CIDS_EXP_DEST) \n" ; \
246+ $(SFTP_POST )
217247 echo " SUCCESS: $( DRY_MESSAGE) Posted $( YESTERDAY) .done" >> $(MESSAGES )
218248
219249validate-covidcast :
0 commit comments