diff --git a/config.yaml b/config.yaml index 512eeea6..58356387 100644 --- a/config.yaml +++ b/config.yaml @@ -7,6 +7,7 @@ PIDS: [nokia_0000003] # See https://www.rapids.science/latest/setup/configuration/#automatic-creation-of-participant-files CREATE_PARTICIPANT_FILES: + USERNAMES_CSV: "data/external/usernames.csv" CSV_FILE_PATH: "data/external/example_participants.csv" # see docs for required format PHONE_SECTION: ADD: True diff --git a/rules/preprocessing.smk b/rules/preprocessing.smk index 2f80ab4f..5a02361b 100644 --- a/rules/preprocessing.smk +++ b/rules/preprocessing.smk @@ -4,6 +4,14 @@ rule create_example_participant_files: shell: "echo 'PHONE:\n DEVICE_IDS: [a748ee1a-1d0b-4ae9-9074-279a2b6ba524]\n PLATFORMS: [android]\n LABEL: test-01\n START_DATE: 2020-04-23 00:00:00\n END_DATE: 2020-05-04 23:59:59\nFITBIT:\n DEVICE_IDS: [a748ee1a-1d0b-4ae9-9074-279a2b6ba524]\n LABEL: test-01\n START_DATE: 2020-04-23 00:00:00\n END_DATE: 2020-05-04 23:59:59\n' >> ./data/external/participant_files/example01.yaml && echo 'PHONE:\n DEVICE_IDS: [13dbc8a3-dae3-4834-823a-4bc96a7d459d]\n PLATFORMS: [ios]\n LABEL: test-02\n START_DATE: 2020-04-23 00:00:00\n END_DATE: 2020-05-04 23:59:59\nFITBIT:\n DEVICE_IDS: [13dbc8a3-dae3-4834-823a-4bc96a7d459d]\n LABEL: test-02\n START_DATE: 2020-04-23 00:00:00\n END_DATE: 2020-05-04 23:59:59\n' >> ./data/external/participant_files/example02.yaml" +rule prepare_participants_csv: + input: + username_list = config["CREATE_PARTICIPANT_FILES"]["USERNAMES_CSV"] + output: + participants_file = config["CREATE_PARTICIPANT_FILES"]["CSV_FILE_PATH"] + script: + "../src/data/streams/translate_usernames_into_participants_data.R" + rule create_participants_files: input: participants_file = config["CREATE_PARTICIPANT_FILES"]["CSV_FILE_PATH"]