From 985a4d18d65c037a6773829499c05b9b43f54278 Mon Sep 17 00:00:00 2001 From: Eli Jones Date: Thu, 30 Nov 2023 18:00:36 -0500 Subject: [PATCH] addresses flake8 errors. --- forest/jasmine/traj2stats.py | 12 ++++++------ forest/sycamore/base.py | 4 ++-- forest/willow/log_stats.py | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/forest/jasmine/traj2stats.py b/forest/jasmine/traj2stats.py index 4cbc990a..97ee20ad 100644 --- a/forest/jasmine/traj2stats.py +++ b/forest/jasmine/traj2stats.py @@ -1611,8 +1611,8 @@ def gps_stats_main( else: frequencies = [frequency] - # Ensure that the correct output folder structures exist, centralize folder names. - # Note that frequencies + # Ensure that the correct output folder structures exist, centralize folder + # names. Note that frequencies trajectory_folder = f"{output_folder}/trajectory" logs_folder = f"{output_folder}/logs" os.makedirs(output_folder, exist_ok=True) @@ -1636,7 +1636,7 @@ def gps_stats_main( if participant_ids is None: participant_ids = get_ids(study_folder) - # Create a record of processed user participant_id and starting/ending time. + # Create a record of processed participant_id and starting/ending time. # These are updated and saved to disk after each participant is processed. all_memory_dict_file = f"{output_folder}/all_memory_dict.pkl" all_bv_set_file = f"{output_folder}/all_bv_set.pkl" @@ -1737,7 +1737,8 @@ def gps_stats_main( index=False ) - # generate summary stats. (variable "frequency" is already declared in signature) + # generate summary stats. + # (variable "frequency" is already declared in signature) for freq in frequencies: gps_stats_generate_summary( traj=traj, @@ -1766,8 +1767,7 @@ def gps_stats_generate_summary( logs_folder: str, parameters: Hyperparameters, places_of_interest: Optional[list] = None, - osm_tags: Optional[List[OSMTags]] = None, - ): + osm_tags: Optional[List[OSMTags]] = None): """This is simply the inner functionality of gps_stats_main. Runs summaries code, writes to disk, saves logs if required. """ summary_stats, logs = gps_summaries( diff --git a/forest/sycamore/base.py b/forest/sycamore/base.py index ff9a03b5..86649926 100644 --- a/forest/sycamore/base.py +++ b/forest/sycamore/base.py @@ -251,7 +251,7 @@ def get_submits_for_tableau( end_date: The latest survey data to read in, in YYYY-MM-DD format users: - List of users in study for which we are generating a survey schedule + List of users in study that we are generating a survey schedule for interventions_filepath: filepath where interventions json file is. submits_timeframe: @@ -305,4 +305,4 @@ def get_submits_for_tableau( ss_summary = summarize_submits(ss_detail, freq, False) write_data_by_user( ss_summary, f"{output_folder}/{freq.name.lower()}", users - ) \ No newline at end of file + ) diff --git a/forest/willow/log_stats.py b/forest/willow/log_stats.py index d162ba9a..12c192b8 100644 --- a/forest/willow/log_stats.py +++ b/forest/willow/log_stats.py @@ -509,9 +509,9 @@ def log_stats_inner( # num_uniq_individuals_call_or_text is the cardinality of the union of # several sets. It should should always be at least as large as the - # cardinality of any one of the sets, and it should never be larger than the - # sum of the cardinalities of all of the sets. (it may be equal if all the - # sets are disjoint) + # cardinality of any one of the sets, and it should never be larger than + # the sum of the cardinalities of all of the sets. (it may be equal if all + # the sets are disjoint) num_uniq_column = "num_uniq_individuals_call_or_text" # legibility hax. sum_all_set_cols = pd.Series([0]*stats_pdframe.shape[0]) for column in [