Remove nested progress bars

master
Dan Howe 3 years ago
parent 6c76e45757
commit 38ad08bef2

@ -420,7 +420,7 @@ def process(beach_name, beach_scenario, n_runs, start_year, end_year,
np.array(ref_vol)[sort_idx]) np.array(ref_vol)[sort_idx])
# Load profile data for current beach # Load profile data for current beach
pbar_profiles = tqdm(['ZSA', 'ZFC']) pbar_profiles = tqdm(['ZSA', 'ZFC'], leave=False)
for profile_type in pbar_profiles: for profile_type in pbar_profiles:
pbar_profiles.set_description('{}'.format(profile_type)) pbar_profiles.set_description('{}'.format(profile_type))
@ -432,8 +432,8 @@ def process(beach_name, beach_scenario, n_runs, start_year, end_year,
col_names = [c for c in df_in.columns if c.isdigit()] col_names = [c for c in df_in.columns if c.isdigit()]
# Loop through profiles # Loop through profiles
pbar_profile = tqdm(df_in[df_in['beach'] == beach_name].iterrows(), dff = df_in[df_in['beach'] == beach_name]
total=df_in[df_in['beach'] == beach_name].shape[0]) pbar_profile = tqdm(dff.iterrows(), total=dff.shape[0], leave=False)
for i, prof in pbar_profile: for i, prof in pbar_profile:
pbar_profile.set_description( pbar_profile.set_description(
@ -449,7 +449,7 @@ def process(beach_name, beach_scenario, n_runs, start_year, end_year,
fp=profile_chainage[valid_idx]) fp=profile_chainage[valid_idx])
# Loop through years # Loop through years
pbar_year = tqdm(output_years) pbar_year = tqdm(output_years, leave=False)
for year in pbar_year: for year in pbar_year:
pbar_year.set_description('Year: {}'.format(year)) pbar_year.set_description('Year: {}'.format(year))
@ -580,10 +580,6 @@ def process(beach_name, beach_scenario, n_runs, start_year, end_year,
header=False, header=False,
float_format='%g') float_format='%g')
pbar_year.close()
pbar_profile.close()
pbar_profiles.close()
def main(): def main():

Loading…
Cancel
Save