:py:mod:`pypetb.RnR` ==================== .. py:module:: pypetb.RnR Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: pypetb.RnR.RnRNumeric pypetb.RnR.RnRAttribute .. py:class:: RnRNumeric(mydf_Raw, mydict_key, mydbl_tol=None) Repeatability and Reproducibility numeric gage analysis. RnRNumerics works as a model. It is defined using a measurement dataframe. Log method could be called in order to check each parameter calculation. There is possibilities to get an anova table, standard deviation table or variance table, which are returned as pandas dataframe, or Report, where a matplotlib figure with the full analysis will be returned. Be sure to import matplotlib.pyplot in your script and write plt.show() after call .RnR_Report() or .Run_chart() to get the figures. Importind seaborn as sns and sns.set() is highly recommended to improve the sigth of the reports. Args: ------- mydf_Raw : Pandas DataFrame containing 3 columns Operator, part and value mydict_key : Dictionary containing column names. key 1 to Operator column , key 2 for Part column , key 3 for Value column mydbl_tol : Optional. Int or Float system tolerance Methods: ---------- getLog: string printable string containing all individual calculations RnRSolve: none determine all variables to make the RnR analysis RnRAnova: Pandas DataFrame two way anova RnR_varTable: Pandas DataFrame RnR variance analysis RnR_SDTable: Pandas DataFrame RnR standard deviation analysis RnR_RunChart: Figure Running chart for your measurement RnR_Report: Figure RnR whole report t: integer number of operator p: integer number of Piezes r: integer number of runs Total_Data: integer number of data in the input dataframe Total_min: float minimum measurement Total_max: float maximum measurement dbl_Range_avg: float average measures range dbl_Range_UCL: float Range upper control limit dbl_Range_LCL: float Range Lower control limit Total_avg: float whole measures average dbl_Avg_UCL: float average upper control limit dbl_Avg_LCL: float average lower control limit Sstd2: float Sum of deviation by operator SStechnician: float Total Operator Sum of deviation Sstd2_: float Sum of deviation by part SSpart: float Total Part Sum of deviation SStotal: float Total squared deviation SSequipment: float Equipment squared deviation ndc: int number of distinct categories Raises: --------- TypeError Init_01 When input mydict_key contains a column which is not a mydf_Raw column name Init_02 mydf_Raw contain nan values Init_03 mydict_key['3'] is a non numerical type column Init_04 mydbl_tol is not a number Init_05 mydict_key is not correctly defined .. py:method:: getLog() Return a string which contain all important calculations. Returns: --------- log: String all step logged .. py:method:: RnRSolve(bol_bias=False) Calculate each individual value needed to make the RnR analysis and conclusions. Args: ------- bol_bias : Optional. Boolean if bol_bias==False, RnRSolve will check if all piezes has the same number of runs and raise an error if not. If bol_bias==True then solve even if all piezes has no the same Number of runs Raises: --------- TypeError Solve_01 if bol_bias==False get this error if some pieze has different number of runs .. py:method:: RnRAnova() After calling .RnRSolve() anova analysis could be done. It will be returned as pandas DataFrame and all of the values will be accesibles from the dataframe. Returns: --------- Pandas DataFrame Anova result tabulated into a pandas dataframe .. py:method:: RnR_varTable() After calling .RnRSolve() variance table could be done. It will be returned as pandas DataFrame and all of the values will be accesibles from the dataframe. Returns: --------- Pandas DataFrame Variante table result tabulated into a pandas dataframe .. py:method:: RnR_SDTable() After calling .RnRSolve() standard deviation table could be done. It will be returned as pandas DataFrame and all of the values will be accesibles from the dataframe. Returns: --------- Pandas DataFrame Standard deviation table result tabulated into a pandas dataframe .. py:method:: RnR_RunChart() Run chart is a figure that contain a chart per pieze where all the measurement made by the operator are showed. Returns: --------- Fig1 : matplotlib figure Set of charts .. py:method:: RnR_Report(report_name=None) RnR_Report chart is a figure that contain six important chart in order to conclude the status of the measurement system First chart will show the impact of each parameter that affect to the variation of the measurement. Second one shows a point chart in order to detect the measurement of each pieze. In the third one, average measures range is showed, while the fourth one is a violin plot of how measure each operator. The fith one shows the average measure per pieze and operator and the last one shows the average value per pieze measured by each operator. Trend color are ramdon and sometimes could be low visible, just repeat the command to change it. Returns: --------- Fig2 : matplotlib figure Set of charts .. py:class:: RnRAttribute(mydf_Raw, mydict_key) Repeatability and Reproducibility analysis for atributes measurement. RnRAtribute works as a model. It is defined using a measurement dataframe. Once model is solved, RnR report could be extracted. If atributes measurement is yes/no, a yes/no matrix could be analyzed. Args: ------- df_Raw : Pandas DataFrame containing 3 columns Operator, part and value mydict_key : Dictionary containing column names. key 1 to Operator column , key 2 for Part column , key 3 for expert/ref column , key 4 for measure value Methods: ---------- getLog: string printable string containing all individual calculations Report: Figure RnR whole report Raises: --------- TypeError Init_01 Input mydict_key keys are not corretly defined Init_02 Input mydict_key values are not contained on source dataframe .. py:method:: __RnRSolve() Purpose : Make all the required calculations DateTime : 11/11/2023 Author : Jose GarcĂ­a Herruzo Updates : DATE USER DESCRIPTION N/A @Arg: N/A @Get: N/A .. py:method:: getLog() Return a string which contain all important calculations. Returns: --------- log: String all step logged .. py:method:: Report() Return a figure to deal with attributes RnR analysis. It shows two focus, one based on the attributes concordance, which is more restrictive and the other based on ref. values. Returns: --------- Fig_R : matplotlib figure Set of charts