Skip to content
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

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open

Update base.py #230

wants to merge 2 commits into from

Conversation

daimm2000
Copy link

Add scripts to notify user about missing survey_answers or survey_timings.

daimm2000 and others added 2 commits December 5, 2023 20:52
Add scripts to notify user about missing survey_answers or survey_timings.
@hackdna
Copy link
Member

hackdna commented Dec 15, 2023

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.
https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/requesting-a-pull-request-review

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')
Copy link
Collaborator

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))]
Copy link
Collaborator

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.")
Copy link
Collaborator

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.")
Copy link
Collaborator

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.")
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants