diff --git a/probabilistic-analysis/probabilistic_assessment.py b/probabilistic-analysis/probabilistic_assessment.py index c7516a0..ac67dbe 100644 --- a/probabilistic-analysis/probabilistic_assessment.py +++ b/probabilistic-analysis/probabilistic_assessment.py @@ -420,7 +420,7 @@ def process(beach_name, beach_scenario, n_runs, start_year, end_year, np.array(ref_vol)[sort_idx]) # Load profile data for current beach - pbar_profiles = tqdm(['ZSA', 'ZFC']) + pbar_profiles = tqdm(['ZSA', 'ZFC'], leave=False) for profile_type in pbar_profiles: 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()] # Loop through profiles - pbar_profile = tqdm(df_in[df_in['beach'] == beach_name].iterrows(), - total=df_in[df_in['beach'] == beach_name].shape[0]) + dff = df_in[df_in['beach'] == beach_name] + pbar_profile = tqdm(dff.iterrows(), total=dff.shape[0], leave=False) for i, prof in pbar_profile: 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]) # Loop through years - pbar_year = tqdm(output_years) + pbar_year = tqdm(output_years, leave=False) for year in pbar_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, float_format='%g') - pbar_year.close() - pbar_profile.close() - pbar_profiles.close() - def main():