-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update base.py #230
base: develop
Are you sure you want to change the base?
Update base.py #230
Conversation
Add scripts to notify user about missing survey_answers or survey_timings.
Hi Michelle, if you'd like to get this merged you need to request a code review from at least one team member. In this case me or @GeorgeEfstathiadis. |
participant_path = os.path.join(study_folder, participant) | ||
survey_answers_path = os.path.join(participant_path, 'survey_answers') | ||
survey_timings_path = os.path.join(participant_path, 'survey_timings') | ||
gps_path = os.path.join(participant_path, 'gps') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove gps_path
, since it is an unused variable
@@ -107,6 +107,24 @@ def compute_survey_stats( | |||
if end_date is None: | |||
end_date = get_month_from_today() | |||
|
|||
# List all directories in the base folder | |||
participants = [d for d in os.listdir(study_folder) if os.path.isdir(os.path.join(study_folder, d))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need participants
instead use users
, which is defined before
if not os.path.exists(survey_timings_path): | ||
print(f"Participant '{participant}' does not have a 'survey_timings' folder.") | ||
#if not os.path.exists(gps_path): | ||
# print(f"Participant '{participant}' does not have a 'gps' folder.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove commented code
|
||
# Check if the 'survey_answers' folder exists | ||
if not os.path.exists(survey_answers_path): | ||
print(f"Participant '{participant}' does not have a 'survey_answers' folder.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't use print
in forest, you can replace it with something like logger.warning
if not os.path.exists(survey_answers_path): | ||
print(f"Participant '{participant}' does not have a 'survey_answers' folder.") | ||
if not os.path.exists(survey_timings_path): | ||
print(f"Participant '{participant}' does not have a 'survey_timings' folder.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as before, we don't use print
in forest, you can replace it with something like logger.warning
Add scripts to notify user about missing survey_answers or survey_timings.