From b0859165ec9853dea25e9aa16be8513de4c9e8ce Mon Sep 17 00:00:00 2001 From: Zachary Clement Date: Tue, 7 Mar 2023 19:31:59 -0500 Subject: [PATCH] downgrade warnings to info to not confuse users --- forest/sycamore/common.py | 14 +++++++------- forest/sycamore/read_audio.py | 10 +++++----- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/forest/sycamore/common.py b/forest/sycamore/common.py index 3d4f5ddc..6c8b12c5 100644 --- a/forest/sycamore/common.py +++ b/forest/sycamore/common.py @@ -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, @@ -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]") @@ -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 @@ -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]") @@ -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) @@ -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]") @@ -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, diff --git a/forest/sycamore/read_audio.py b/forest/sycamore/read_audio.py index 478e7ab2..e91bfab6 100644 --- a/forest/sycamore/read_audio.py +++ b/forest/sycamore/read_audio.py @@ -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 @@ -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]") @@ -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) @@ -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 = [ @@ -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"