6. Post-Processing Module#
This module contains the post-processing functions of BuckPy.
- buckpy.buckpy_postprocessing.pp_buckpy(work_dir, input_file_name, pipeline_id, scenario_no, prob_exceed_char_fric, df_pp_plot, df_vap_plot, df_pp_buckle_prop, df_scen, df_pp_set, n_sim, output_combination, bl_verbose=False)[source]#
Post-processing of probabilistic buckling results.
- Parameters:
work_dir (str) – The working directory where the analysis files are located.
input_file_name (str) – The name of the input file.
pipeline_id (str) – Identifier of the pipeline.
scenario_no (int) – The scenario number.
prob_exceed_char_fric (float) – Probability of exceedance for the calculation of the characteristic friction factor.
df_pp_plot (DataFrame) – Definition on assessed mesh of CBF and EAF in different conditions for case to plot.
df_vap_plot (DataFrame) – Definition of virtual anchor points for case to plot.
df_pp_buckle_prop (DataFrame) – Results for all buckles triggered.
df_scen (DataFrame) – Dataframe containing the design data along the pipeline route (mesh) that remains constant among deterministic and Monte-Carlo simulations.
df_pp_set (DataFrame) – Definition of element sets for post-processing outputs.
n_sim (int) – Number of Monte-Carlo simulations to be run.
output_combination (Boolean) – Switch to write the most frequent combination set of buckles in the result file.
- buckpy.buckpy_postprocessing.pp_char_fric(df_pp, df_buckling, df_set, prob_exceed_char_fric)[source]#
Determine the characteristic lateral breakout friction.
- Parameters:
df_pp (pandas DataFrame) – DataFrame containing pipeline element analysis results.
df_buckling (pandas DataFrame) – DataFrame containing buckling data.
df_set (pandas DataFrame) – DataFrame containing sets along the pipeline route.
prob_exceed_char_fric (float) – Probability of exceeding characteristic lateral breakout friction.
- Returns:
df_set – Updated DataFrame containing characteristic lateral breakout friction information.
- Return type:
pandas DataFrame
- buckpy.buckpy_postprocessing.pp_char_vas(df_pp, df_buckling, df_set)[source]#
Determine the characteristic VAS.
- Parameters:
df_pp (pandas DataFrame) – DataFrame containing pipeline element analysis results.
df_buckling (pandas DataFrame) – DataFrame containing buckling data.
df_set (pandas DataFrame) – DataFrame containing sets along the pipeline route.
- Returns:
df_set – Updated DataFrame containing characteristic VAS information.
- Return type:
pandas DataFrame
- buckpy.buckpy_postprocessing.pp_comb_buckles_per_section(df_pp, df_scen, n_sim)[source]#
Count the number of set combinations and sort based on the most frequent set combinations based on section number in the route data.
- Parameters:
df_pp (pandas DataFrame) – DataFrame containing pipeline element analysis results.
df_scen (DataFrame) – Dataframe containing the design data along the pipeline route (mesh) that remains constant among deterministic and Monte-Carlo simulations.
n_sim (int) – Number of simulations.
- Returns:
df_set_comb – DataFrame containing post-processed statistics about the number of set combination with buckles along the pipeline.
- Return type:
pandas DataFrame
- buckpy.buckpy_postprocessing.pp_comb_buckles_per_set(df_pp, df_pp_set, n_sim)[source]#
Count the number of set combinations and sort based on the most frequent set combinations based on post-processing set.
- Parameters:
df_pp (pandas DataFrame) – DataFrame containing pipeline element analysis results.
df_pp_set (pandas DataFrame) – DataFrame containing the definition of the post-processed sets.
n_sim (int) – Number of simulations.
- Returns:
df_set_comb – DataFrame containing post-processed statistics about the number of set combination with buckles along the pipeline.
- Return type:
pandas DataFrame
- buckpy.buckpy_postprocessing.pp_comb_prob(df_in, df_buckle, col_no, n_sim)[source]#
Count the number of set combinations based on given set number
- Parameters:
df_in (pandas DataFrame) – DataFrame containing the set number of combination with buckles along the pipeline.
df_buckle (pandas DataFrame) – DataFrame containing the count and probability of set number of combination with buckles.
col_no (String) – Column name of the set number
n_sim (int) – Number of simulations.
- Returns:
df_out – DataFrame containing post-processed statistics about the number of set combination with buckles along the pipeline.
- Return type:
pandas DataFrame
- buckpy.buckpy_postprocessing.pp_eaf(df_pp_plot)[source]#
Converts units and renames columns for pipeline EAF plot DataFrame.
- Parameters:
df_pp_plot (pandas DataFrame) – DataFrame containing pipeline plot data.
- Returns:
df_pp_plot – DataFrame with converted units and renamed columns.
- Return type:
pandas DataFrame
- buckpy.buckpy_postprocessing.pp_elem(df_pp, n_sim)[source]#
Perform post-processing of the probability of buckling, VAS and lateral breakout friction at each element along the pipeline route.
- Parameters:
df_pp (pandas DataFrame) – DataFrame containing the results of the analyses.
n_sim (int) – Total number of simulations.
- Returns:
df_elem – DataFrame containing post-processed probabilities, VAS and lateral breakout friction for each pipeline element.
- Return type:
pandas DataFrame
- buckpy.buckpy_postprocessing.pp_no_buckles(df_pp, n_sim)[source]#
Perform post-processing of the number of buckles along the pipeline.
- Parameters:
df_pp (pandas DataFrame) – DataFrame containing pipeline element analysis results.
n_sim (int) – Total number of simulations.
- Returns:
df_no_buckles – DataFrame containing post-processed statistics about the number of buckles along the pipeline.
- Return type:
pandas DataFrame
- buckpy.buckpy_postprocessing.pp_outputs(output_file_name, n_sim, output_combination, df_pp_buckle_prop, df_pp_set, df_pp_plot, prob_exceed_char_fric, df_scen)[source]#
Perform post-processing of analysis outputs.
- Parameters:
output_file_name (str) – Name of the output Excel file
n_sim (int) – Number of simulations.
output_combination (Boolean) – Switch to write the most frequent combination set of buckles in the result file.
df_pp_buckle_prop (pandas DataFrame) – DataFrame containing post-processed buckling properties.
df_pp_set (DataFrame) – Definition of element sets for post-processing outputs.
df_pp_plot (pandas DataFrame) – DataFrame containing post-processed plot data.
prob_exceed_char_fric (float) – Probability of exceedance associated with the characteristic lateral breakout friction.
df_pp_set – Definition of element sets for post-processing outputs.
df_scen (DataFrame) – Dataframe containing the design data along the pipeline route (mesh) that remains constant among deterministic and Monte-Carlo simulations.
- Returns:
df_no_buckles (pandas DataFrame) – DataFrame containing post-processed statistics about the number of buckles along the pipeline.
df_sets (pandas DataFrame) – DataFrame containing post-processed statistics grouped by pipeline sets.
- buckpy.buckpy_postprocessing.pp_plots(plot_file_name, df_scen, df_plot, df_vap_plot, df_no_buckles, df_sets, prob_exceed_char_fric)[source]#
Plot deterministic and probabilistic results
- Parameters:
plot_file_name (str) – Name of the *.png file
df_scen (DataFrame) – Dataframe containing the design data along the pipeline route (mesh) that remains constant among deterministic and Monte-Carlo simulations.
df_plot (DataFrame) – Definition on assessed mesh of CBF and EAF in different conditions. for case to plot
df_vap_plot (DataFrame) – Definition of virtual anchor points for case to plot. Columns: [‘ielt VAP’, ‘KP VAP’, ‘ESF VAP’].
df_no_buckles (DataFrame) – Probability of number of buckles over pipeline.
df_sets (DataFrame) – Probability of buckling and characteristic VAS and friction factors by set.
prob_exceed_char_fric (float) – Probability of exceedance for characteristic friction factors.
plot_file_name – File name where plots are to be saved.
- buckpy.buckpy_postprocessing.pp_raw(df)[source]#
Converts units and renames columns of the DataFrame containing the raw data from the BuckPy simulations.
- Parameters:
df (pandas DataFrame) – DataFrame containing raw data from the BuckPy simulations.
- Returns:
df – DataFrame with converted units and renamed columns.
- Return type:
pandas DataFrame
- buckpy.buckpy_postprocessing.pp_rename_columns(df_in, df_out)[source]#
Rename columns in the post-processing DataFrame.
- Parameters:
df_in (pandas DataFrame) – DataFrame containing the set number of combination with buckles along the pipeline.
df_out (pandas DataFrame) – DataFrame containing post-processed statistics about the number of set combination with buckles along the pipeline.
- Returns:
df_out – DataFrame containing post-processed statistics about the number of set combination with buckles along the pipeline.
- Return type:
pandas DataFrame
Notes
Use the Python built-in
setfor unique labels, e.g.,set(labels).
- buckpy.buckpy_postprocessing.pp_save(output_combination, output_file_name, *args)[source]#
Saves DataFrames to an Excel file with specified formatting.
- Parameters:
output_combination (Boolean) – Switch to write the most frequent combination set of buckles in the result file.
output_file_name (str) – Name of the output Excel file.
df_elem (pandas DataFrame) – DataFrame containing element data.
df_sets (pandas DataFrame) – DataFrame containing set data.
df_no_buckles (pandas DataFrame) – DataFrame containing data related to the number of buckles.
df_pp_plot (pandas DataFrame) – DataFrame containing force profile data.
df_pp_buckle_prop (pandas DataFrame) – DataFrame containing raw data related to buckling properties.
df_comb_per_set (pandas DataFrame) – DataFrame containing raw data related to KP set combinations based on post-processing set.
df_comb_per_section (pandas DataFrame) – DataFrame containing raw data related to KP set combinations based on route point id.
- Return type:
None
- buckpy.buckpy_postprocessing.pp_sets(df_pp, n_sim, prob_exceed_char_fric, df_pp_set, df_scen)[source]#
Perform post-processing of the probability of buckling, VAS and lateral breakout friction at each post-processing set along the pipeline route.
- Parameters:
df_pp (pandas DataFrame) – DataFrame containing pipeline element analysis results.
n_sim (int) – Total number of simulations.
prob_exceed_char_fric (float) – Probability of exceedance of the characteristic lateral breakout friction.
df_pp_set (DataFrame) – Definition of element sets for post-processing outputs.
df_scen (DataFrame) – Dataframe containing the design data along the pipeline route (mesh) that remains constant among deterministic and Monte-Carlo simulations.
- Returns:
df_set – DataFrame containing post-processed statistics about pipeline sets.
- Return type:
pandas DataFrame