ogstools.logparser.common_ogs_analyses module#
- ogstools.logparser.common_ogs_analyses.pre_post_check(interest, context)[source]#
A decorator for analyzing pandas DataFrames before and after applying a function. It checks the DataFrame against specified ‘interest’ and ‘context’ criteria both before and after the function is called.
- Parameters:
interest (list[str]) – indicates the columns of interest in the DataFrame.
context (list[str]) – indicates the context columns in the DataFrame that should be checked.
- Returns:
A decorator function that takes a function accepting a pandas DataFrame and returns a modified DataFrame, wrapping it with pre-check and post-check logic based on the specified ‘interest’ and ‘context’.
- Return type:
Callable
- ogstools.logparser.common_ogs_analyses.analysis_time_step(df)[source]#
Analysis with focus on computation time per time step. It combines time step specific measurements ‘output time’ and ‘time step solution time’ with iteration specific measurements ‘assembly time’, ‘linear solver time’, ‘Dirichlet time’. Time from iteration are accumulated.
- Return type:
DataFrame
- ogstools.logparser.common_ogs_analyses.analysis_convergence_newton_iteration(df)[source]#
Convergence metrics need to be interpreted as norm |x|,`|dx|`, |dx|/|x| and are specific to defined <convergence_criterion> in prj - file.
- Return type:
DataFrame
- ogstools.logparser.common_ogs_analyses.analysis_convergence_coupling_iteration(df)[source]#
- Return type:
Any
- ogstools.logparser.common_ogs_analyses.analysis_simulation_termination(df)[source]#
- Return type:
DataFrame
- ogstools.logparser.common_ogs_analyses.fill_ogs_context(df_raw_log)[source]#
Fill missing values in OpenGeoSys (OGS) log DataFrame by context. This function fills missing values in an OpenGeoSys (OGS) log DataFrame by context.
- Parameters:
df_raw_log (DataFrame) – DataFrame containing the raw OGS log data. Usually, the result of pd.DataFrame(parse_file(file))
- Returns:
pd.DataFrame with missing values filled by context.
- Return type:
DataFrame
References: Pandas documentation : https://pandas.pydata.org/pandas-docs/stable/user_guide/
Notes: Some logs do not contain information about time_step and iteration. The information must be collected by context (by surrounding log lines from same mpi_process). Logs are grouped by mpi_process to get only surrounding log lines from same mpi_process. There are log lines that give the current time step (when time step starts). It can be assumed that in all following lines belong to this time steps, until next collected value of time step. Some columns that contain actual integer values are converted to float. See https://pandas.pydata.org/pandas-docs/stable/user_guide/integer_na.html ToDo list of columns with integer values are known from regular expression