Skip to content

Commit

Permalink
downgrade warnings to info to not confuse users
Browse files Browse the repository at this point in the history
  • Loading branch information
clementzach committed Mar 8, 2023
1 parent a2e6fb3 commit b085916
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
14 changes: 7 additions & 7 deletions forest/sycamore/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def read_and_aggregate(
< timestamp_end):
survey_data_list.append(safe_read_csv(file))
if len(survey_data_list) == 0:
logger.warning("No survey_timings for user %s.", user)
logger.info("No survey_timings for user %s.", user)
return pd.DataFrame(columns=["UTC time"], dtype="datetime64[ns]")

survey_data: pd.DataFrame = pd.concat(survey_data_list,
Expand All @@ -124,7 +124,7 @@ def read_and_aggregate(
survey_data["DOW"] = survey_data["UTC time"].dt.dayofweek
return survey_data
else:
logger.warning("No survey_timings for user %s.", user)
logger.info("No survey_timings for user %s.", user)
return pd.DataFrame(columns=["UTC time"], dtype="datetime64[ns]")


Expand Down Expand Up @@ -310,7 +310,7 @@ def parse_surveys(config_path: str, answers_l: bool = False) -> pd.DataFrame:
surv["answer_" + str(j)] = a["text"]
output.append(pd.DataFrame([surv]))
if len(output) == 0:
logger.warning("No Data Found")
logger.warning("No Data Found in config file")
return pd.DataFrame()
output = pd.concat(output).reset_index(drop=True)
return output
Expand Down Expand Up @@ -714,7 +714,7 @@ def read_user_answers_stream(
all_files.append(filepath)

if len(all_files) == 0:
logger.warning("No survey_answers for user %s in given time "
logger.info("No survey_answers for user %s in given time "
"frames.", user)
return pd.DataFrame(columns=["Local time"],
dtype="datetime64[ns]")
Expand All @@ -741,7 +741,7 @@ def read_user_answers_stream(

survey_dfs.append(current_df)
if len(survey_dfs) == 0:
logger.warning("No survey_answers for user %s.", user)
logger.info("No survey_answers for user %s.", user)
return pd.DataFrame(columns=["UTC time"],
dtype="datetime64[ns]")
survey_data = pd.concat(survey_dfs, axis=0, ignore_index=True)
Expand All @@ -764,7 +764,7 @@ def read_user_answers_stream(
return pd.DataFrame(columns=["Local time"], dtype="datetime64[ns]")
return pd.concat(all_surveys, axis=0, ignore_index=True)
else:
logger.warning("No survey_answers for user %s.", user)
logger.info("No survey_answers for user %s.", user)
return pd.DataFrame(columns=["Local time"], dtype="datetime64[ns]")


Expand Down Expand Up @@ -821,7 +821,7 @@ def read_aggregate_answers_stream(
aggregated_data = pd.concat(all_users_list, axis=0, ignore_index=True)

if aggregated_data.shape[0] == 0:
logger.warning("No survey_answers data found")
logger.info("No survey_answers data found")
return pd.DataFrame(columns=["Local time"], dtype="datetime64[ns]")

aggregated_data = fix_radio_answer_choices(aggregated_data, config_path,
Expand Down
10 changes: 5 additions & 5 deletions forest/sycamore/read_audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def read_user_audio_recordings_stream(
time_end = get_month_from_today()
audio_dir = os.path.join(download_folder, user, "audio_recordings")
if not os.path.isdir(audio_dir):
logger.warning("No survey_answers for user %s.", user)
logger.info("No audio_recordings for user %s.", user)
return pd.DataFrame(columns=["Local time"], dtype="datetime64[ns]")

# get all survey IDs included for this user (data will have one folder
Expand All @@ -132,7 +132,7 @@ def read_user_audio_recordings_stream(
))

if len(all_files) == 0:
logger.warning("No audio_recordings for user %s in given time "
logger.info("No audio_recordings for user %s in given time "
"frames.", user)
return pd.DataFrame(columns=["Local time"],
dtype="datetime64[ns]")
Expand Down Expand Up @@ -169,7 +169,7 @@ def read_user_audio_recordings_stream(
})
survey_dfs.append(current_df)
if len(survey_dfs) == 0:
logger.warning("No survey_answers for user %s.", user)
logger.info("No survey_answers for user %s.", user)
return pd.DataFrame(columns=["Local time"],
dtype="datetime64[ns]")
survey_data = pd.concat(survey_dfs, axis=0, ignore_index=True)
Expand Down Expand Up @@ -236,7 +236,7 @@ def read_aggregate_audio_recordings_stream(
if users is None:
users = get_ids(download_folder)
if len(users) == 0:
logger.warning("No users found")
logger.info("No users found")
return pd.DataFrame(columns=["Local time"], dtype="datetime64[ns]")

all_users_list = [
Expand All @@ -249,7 +249,7 @@ def read_aggregate_audio_recordings_stream(
aggregated_data = pd.concat(all_users_list, axis=0, ignore_index=True)

if aggregated_data.shape[0] == 0:
logger.warning("No audio_recordings data found")
logger.info("No audio_recordings data found")
return pd.DataFrame(columns=["Local time"], dtype="datetime64[ns]")

aggregated_data["data_stream"] = "audio_recordings"
Expand Down

0 comments on commit b085916

Please sign in to comment.