formate tables

This commit is contained in:
whystar 2020-08-01 11:00:16 +08:00
parent dc6b38c904
commit 7883167029
6 changed files with 75 additions and 16 deletions

View File

@ -3,5 +3,11 @@
"en-US": [
"ENGLISH_WORD_REPEAT_RULE"
]
}
},
"ltex.ignoreRuleInSentence": [
{
"rule": "SENTENCE_FRAGMENT",
"sentence": "^\\QWhile repositories including longer age than those not including the documentation.\\E$"
}
]
}

View File

@ -151,11 +151,12 @@ as shown in Table~\ref{tab:doc_name}.
\begin{table}[ht!]
\small
\centering
\caption{Overall percentage of repositories including each type of documentation}
\begin{tabular}{r c c ccc}
\begin{tabular}{@{}r c c ccc@{}}
\bottomrule
\textbf{Documentation} &\texttt{\RDM} & \texttt{\LIC} &\texttt{\CON} & \texttt{\COD} & \texttt{\TMP}\\
\textbf{Documentation} &\RDM & \LIC &\CON & \COD &\TMP\\
\midrule
\tabincell{c}{\textbf{Name keyword}} & \textit{readme} & \textit{license} & \textit{contributing} & \textit{code\_of\_conduct} & \tabincell{c}{\textit{issue\_template},\\ \textit{pull\_request\_template}} \\

47
4_1.tex
View File

@ -52,9 +52,9 @@ we note that \COD has an extremely low percentage of inclusion,
\begin{table}[ht!]
\centering
\caption{Percentage of repositories including community profile documentation}
\begin{tabular}{r c c ccc}
\begin{tabular}{@{}r c c ccc@{}}
\bottomrule
\textbf{Documentation} &\texttt{\RDM} & \texttt{\LIC} &\texttt{\CON} & \texttt{\COD} & \texttt{\TMP}\\
\textbf{Documentation} &\RDM & \LIC &\CON & \COD & \TMP\\
\midrule
% \textbf{Repositories} & *** & *** & *** & *** & *** \\
\textbf{Percentage} & 99.20\%& 81.10\%& 26.45\%& 10.95\%& 23.65\%\\
@ -104,9 +104,9 @@ C, PHP, and Ruby have the lowest percentage of repositories including
\begin{table}[ht!]
\centering
\caption{Percentage of repositories including community profile documentation per programming language}
\begin{tabular}{r c c c c cc}
\begin{tabular}{@{}r c c c c cc@{}}
\bottomrule
\textbf{Language} & \textbf{Repositories} &\texttt{\RDM} & \texttt{\LIC} &\texttt{\CON} & \texttt{\COD} & \texttt{\TMP}\\
\textbf{\small Language} & \textbf{\footnotesize Repositories} &\textbf{\footnotesize\RDM} & \textbf{\footnotesize\LIC} &\textbf{\footnotesize\CON} & \textbf{\footnotesize\COD} & \textbf{\footnotesize\TMP}\\
\midrule
JavaScript &363 &99.72\%& 85.67\%& 25.90\%& 12.67\%& 20.39\%\\
Python &318 &99.69\%& 83.33\%& 24.84\%& 8.81\%& 23.90\%\\
@ -153,11 +153,12 @@ and are used to adopt the recommended practice in building an attracting communi
\begin{table}[ht!]
% \footnotesize
\centering
\caption{Percentage of repositories including community profile documentation per owner role}
\begin{tabular}{r c c c c cc}
\begin{tabular}{@{}r c c c c cc@{}}
\bottomrule
\textbf{Role} & \textbf{Repositories} &\texttt{\RDM} & \texttt{\LIC} &\texttt{\CON} & \texttt{\COD} & \texttt{\TMP}\\
\textbf{\footnotesize Role} & \textbf{\footnotesize Repositories} &\textbf{\footnotesize\RDM} & \textbf{\footnotesize\LIC} &\textbf{\footnotesize\CON} & \textbf{\footnotesize\COD} & \textbf{\footnotesize\TMP}\\
\midrule
User&1093&98.90\%& 76.12\%& 12.08\%& 5.86\%& 13.91\%\\
Organization&907&99.56\%& 87.10\%& 43.77\%& 17.09\%& 35.39\%\\
@ -169,14 +170,46 @@ and are used to adopt the recommended practice in building an attracting communi
\subsubsection{Popularity by age}
For each type of documentation,
we grouped all the projects into two groups:
\textit{Included} which contains projects whose repository includes the documentation,
and \textit{Not-included} which contains projects whose repository does not include the documentation.
Figure~\ref{fig:pop_age} presents the distribution of repository age in both groups in terms of each kind of documentation.
We found that
repositories including \RDM, \LIC, \COD, and \TMP are younger than those not including the documentation.
And repositories including \CON have longer age than those not including the documentation.
The significance of difference is tested with \textit{Mann-Whitney-Wilcoxon} test~\cite{Wilcoxon1945Individual}, as shown in Table~\ref{tab:age_test}.
\begin{figure}[ht!]
\centering
\includegraphics[width=0.9\textwidth]{resources/repo_age.pdf}
\caption{*****)}
\caption{Distribution of repository age in both groups.)}
\label{fig:pop_age}
\end{figure}
\begin{table}[h]
\footnotesize
\centering
\caption{Results of Mann-Whitney-Wilcoxon test in terms of repository age}
\begin{tabular}{@{}c c c c c c@{}}
\toprule
\textbf{Documentation}& \textbf{\RDM} & \textbf{\LIC} &\textbf{\CON} & \textbf{\COD} & \textbf{\TMP}\\ \midrule
\tabincell{c}{ Comparison between \\\textit{Included} and \textit{Not-included}} & \tabincell{c}{$W$=1.07e8\\$p$=1.17e-246}&
\tabincell{c}{$W$=2.23e8\\$p$=1.30e-192}&
\tabincell{c}{$W$=2.39e8\\$p$=6.44e-146}&
\tabincell{c}{$W$=2.39e8\\$p$=6.44e-146}&
\tabincell{c}{$W$=2.39e8\\$p$=6.44e-146}
\\
\bottomrule
\end{tabular}
\label{tab:age_test}
\end{table}
\subsubsection{Popularity by forks}
% <img src="resources/repo_fork.png" width="400" align="bottom" />

View File

@ -6,9 +6,9 @@
\begin{table}[ht!]
\centering
\caption{The distribution of locations of each documentation}
\begin{tabular}{r c c c c c}
\begin{tabular}{@{}r c c c c c@{}}
\bottomrule
\textbf{Location} &\texttt{Readme} & \texttt{License} &\texttt{Contributing} & \texttt{Code-of-Conduct} & \texttt{Template}\\
\textbf{Location} &\textbf{\RDM} & \textbf{\LIC} &\textbf{\CON} & \textbf{\COD} & \textbf{\TMP}\\
\midrule
\textit{root} & 1.00\%& 1.00\%& 0.83\%& 0.86\%& 0.12\%\\
\textit{docs} & 0.05\%& 0.01\%& 0.06\%& 0.02\%& 0.01\%\\
@ -54,7 +54,7 @@
\begin{table}[ht!]
\centering
\caption{The most frequent keywords contained in maintenance messages}
\begin{tabular}{r p{12cm}}
\begin{tabular}{@{}r p{12cm}@{}}
\bottomrule
\textbf{Documentation}&\textbf{keyword list}\\ \hline
\texttt{\RDM} & updat, add, fix, doc, link, remov, version, use, chang, badg, test, support, releas, document, new, build, exampl, merg, typo, instal

View File

@ -83,4 +83,15 @@ year={2017}
author={Vendome, Christopher and Linares-Vasquez, Mario and Bavota, Gabriele and Penta, Massimiliano Di and Poshyvanyk, Denys},
booktitle={International Conference on Software Engineering},
year={2017},
}
@article{Wilcoxon1945Individual,
title={Individual Comparisons by Ranking Methods},
author={Wilcoxon, Frank},
journal={Biometrics Bulletin},
volume={1},
number={6},
pages={80-83},
year={1945},
}

View File

@ -157,6 +157,7 @@ def _strtime2int(strtime):
import seaborn as sns
import math
from scipy.stats import mannwhitneyu
def by_age():
cursor.execute("select id, created_at from random_repos")
repos = cursor.fetchall()
@ -166,7 +167,7 @@ def by_age():
for item in repos:
repo_id, repo_create = item
repo_files = repo_profile(repo_id)
repo_age = (_strtime2int("2020-07-18T00:00:00Z") - _strtime2int(repo_create)) *1.0/3600/24/30
repo_age = (_strtime2int("2020-07-18T00:00:00Z") - _strtime2int(repo_create))*1.0/60/60/24/30
if repo_age <= 0:
print repo_create
for key in file_dist.keys():
@ -190,6 +191,12 @@ def by_age():
stats2 = pd.Series(value[1])
print key, "Yes", stats1.min(), stats1.mean(),stats1.median(),stats1.std(),stats1.max()
print key, "No", stats2.min(), stats2.mean(),stats2.median(),stats2.std(),stats2.max()
def MWW(non_dups_data,dups_data):
mwws = mannwhitneyu(non_dups_data,dups_data,alternative='two-sided')
print "\t>>> MWW: ", mwws.pvalue
return mwws.pvalue
print "----"*10
data = {
'Docmentation Type':x,
@ -215,6 +222,7 @@ def by_age():
plt.legend(ncol=2)
plt.xticks(range(0,5),["README", "LICENSE", "CONTRIBUTING", "CONDUCT", "TEMPLATE"])
plt.ylim(None,170)
plt.ylabel("Repository age (in month)")
plt.show()
@ -288,8 +296,8 @@ if __name__ == "__main__":
# overview()
# by_language()
# by_role()
# by_age()
by_forks()
by_age()
# by_forks()