pypetb.Repeatability
Module Contents
Classes
Repeatability numeric gage analysis. |
- class pypetb.Repeatability.RNumeric(mydf_Raw, mydict_key, mydbl_tol=None)
Repeatability numeric gage analysis. RNumeric works as a model. It is defined using a measurement dataframe. Log method could be called in order to check each parameter calculation. There are 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 .R_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_RawPandas DataFrame containing 2 columns
part and value
- mydict_keyDictionary containing column names.
key 1 for Part column , key 2 for Value column
- mydbl_tolOptional. Int or Float
system tolerance
Methods:
- getLog: string
printable string containing all individual calculations
- RSolve: none
determine all variables to make the RnR analysis
- RAnova: Pandas DataFrame
two way anova
- R_varTable: Pandas DataFrame
RnR variance analysis
- R_SDTable: Pandas DataFrame
RnR standard deviation analysis
- R_RunChart: Figure
Running chart for your measurement
- R_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 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[‘2’] is a non numerical type column
- Init_04
mydbl_tol is not a number
- Init_05
mydict_key is not correctly defined
- getLog()
Return a string which contain all important calculations.
Returns:
- log: String
all step logged
- RSolve(bol_bias=False)
Calculate each individual value needed to make the RnR analysis and conclusions.
Args:
- bol_biasOptional. 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
- RAnova()
After calling .RSolve() anova available calculations 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
- R_varTable()
After calling .RSolve() 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
- R_SDTable()
After calling .RSolve() 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
- R_RunChart()
Run chart is a figure that contain a chart per pieze where all the measurement made by the operator are showed.
Returns:
- Fig1matplotlib figure
Set of charts
- R_Report(report_name=None)
R_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:
- Fig2matplotlib figure
Set of charts