{
"cells": [
{
"cell_type": "code",
"execution_count": 22,
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"import os\n",
"import shutil"
]
},
{
"cell_type": "code",
"execution_count": 23,
"metadata": {},
"outputs": [],
"source": [
"contributing_ranef = pd.read_csv(\"../mlm/data/0201_contributing_dweek_ranefs.csv\")\n",
"readme_ranef = pd.read_csv(\"../mlm/data/0201_readme_dweek_ranefs.csv\")"
]
},
{
"cell_type": "code",
"execution_count": 24,
"metadata": {},
"outputs": [],
"source": [
"contributing_ranef['repo_id'] = contributing_ranef['level']\n",
"readme_ranef['repo_id'] = readme_ranef['level']"
]
},
{
"cell_type": "code",
"execution_count": 25,
"metadata": {},
"outputs": [],
"source": [
"contributing_manifest = pd.read_csv(\"../all_fvf_CONTRIBUTING_manifest-link.csv\")\n",
"readme_manifest = pd.read_csv(\"../all_fvf_README_manifest-link.csv\")"
]
},
{
"cell_type": "code",
"execution_count": 35,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"
\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" repo_id | \n",
" commits_filepath | \n",
" fvf_filepath | \n",
" effect | \n",
" group | \n",
" level | \n",
" term | \n",
" estimate | \n",
" std.error | \n",
" conf.low | \n",
" conf.high | \n",
" ranef_grouping | \n",
" rank | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" aio-libs_aiomysql.git | \n",
" _aio-libs_aiomysql.git_commits.csv | \n",
" aio-libs_aiomysql.git_hullabaloo_CONTRIBUTING.rst | \n",
" ran_vals | \n",
" project_id | \n",
" aio-libs_aiomysql.git | \n",
" before_after:week_index | \n",
" -0.142476 | \n",
" 0.116488 | \n",
" -0.370789 | \n",
" 0.085838 | \n",
" 1 | \n",
" 222.0 | \n",
"
\n",
" \n",
" 1 | \n",
" qTox_qTox | \n",
" _qTox_qTox_commits.csv | \n",
" qTox_qTox_hullabaloo_CONTRIBUTING.md | \n",
" ran_vals | \n",
" project_id | \n",
" qTox_qTox | \n",
" before_after:week_index | \n",
" 0.385689 | \n",
" 0.048433 | \n",
" 0.290763 | \n",
" 0.480615 | \n",
" 2 | \n",
" 684.0 | \n",
"
\n",
" \n",
" 2 | \n",
" gohugoio_hugo.git | \n",
" _gohugoio_hugo.git_commits.csv | \n",
" gohugoio_hugo.git_hullabaloo_CONTRIBUTING.md | \n",
" ran_vals | \n",
" project_id | \n",
" gohugoio_hugo.git | \n",
" before_after:week_index | \n",
" 0.334518 | \n",
" 0.053172 | \n",
" 0.230302 | \n",
" 0.438733 | \n",
" 2 | \n",
" 647.0 | \n",
"
\n",
" \n",
" 3 | \n",
" ycm-core_ycmd | \n",
" _ycm-core_ycmd_commits.csv | \n",
" ycm-core_ycmd_hullabaloo_CONTRIBUTING.md | \n",
" ran_vals | \n",
" project_id | \n",
" ycm-core_ycmd | \n",
" before_after:week_index | \n",
" -0.000605 | \n",
" 0.094662 | \n",
" -0.186139 | \n",
" 0.184928 | \n",
" 1 | \n",
" 328.0 | \n",
"
\n",
" \n",
" 4 | \n",
" aio-libs_aiohttp.git | \n",
" _aio-libs_aiohttp.git_commits.csv | \n",
" aio-libs_aiohttp.git_hullabaloo_CONTRIBUTING.rst | \n",
" ran_vals | \n",
" project_id | \n",
" aio-libs_aiohttp.git | \n",
" before_after:week_index | \n",
" 0.348421 | \n",
" 0.051826 | \n",
" 0.246845 | \n",
" 0.449997 | \n",
" 2 | \n",
" 658.0 | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" repo_id commits_filepath \\\n",
"0 aio-libs_aiomysql.git _aio-libs_aiomysql.git_commits.csv \n",
"1 qTox_qTox _qTox_qTox_commits.csv \n",
"2 gohugoio_hugo.git _gohugoio_hugo.git_commits.csv \n",
"3 ycm-core_ycmd _ycm-core_ycmd_commits.csv \n",
"4 aio-libs_aiohttp.git _aio-libs_aiohttp.git_commits.csv \n",
"\n",
" fvf_filepath effect group \\\n",
"0 aio-libs_aiomysql.git_hullabaloo_CONTRIBUTING.rst ran_vals project_id \n",
"1 qTox_qTox_hullabaloo_CONTRIBUTING.md ran_vals project_id \n",
"2 gohugoio_hugo.git_hullabaloo_CONTRIBUTING.md ran_vals project_id \n",
"3 ycm-core_ycmd_hullabaloo_CONTRIBUTING.md ran_vals project_id \n",
"4 aio-libs_aiohttp.git_hullabaloo_CONTRIBUTING.rst ran_vals project_id \n",
"\n",
" level term estimate std.error \\\n",
"0 aio-libs_aiomysql.git before_after:week_index -0.142476 0.116488 \n",
"1 qTox_qTox before_after:week_index 0.385689 0.048433 \n",
"2 gohugoio_hugo.git before_after:week_index 0.334518 0.053172 \n",
"3 ycm-core_ycmd before_after:week_index -0.000605 0.094662 \n",
"4 aio-libs_aiohttp.git before_after:week_index 0.348421 0.051826 \n",
"\n",
" conf.low conf.high ranef_grouping rank \n",
"0 -0.370789 0.085838 1 222.0 \n",
"1 0.290763 0.480615 2 684.0 \n",
"2 0.230302 0.438733 2 647.0 \n",
"3 -0.186139 0.184928 1 328.0 \n",
"4 0.246845 0.449997 2 658.0 "
]
},
"execution_count": 35,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"contributing_merged = pd.merge(contributing_manifest, contributing_ranef, on=['repo_id'], how='inner')\n",
"contributing_merged = contributing_merged.drop(columns='Unnamed: 0')\n",
"contributing_merged.head()"
]
},
{
"cell_type": "code",
"execution_count": 36,
"metadata": {},
"outputs": [],
"source": [
"contributing_merged.to_csv('0203_contributing_merged_manifest.csv', index=False)"
]
},
{
"cell_type": "code",
"execution_count": 27,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Empty DataFrame\n",
"Columns: [repo_id, commits_filepath, fvf_filepath]\n",
"Index: []\n"
]
}
],
"source": [
"#duplicates = readme_manifest[readme_manifest.duplicated(subset=['repo_id'], keep=False)]\n",
"#len(duplicates)\n",
"#print(duplicates)"
]
},
{
"cell_type": "code",
"execution_count": 37,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" repo_id | \n",
" commits_filepath | \n",
" fvf_filepath | \n",
" effect | \n",
" group | \n",
" level | \n",
" term | \n",
" estimate | \n",
" std.error | \n",
" conf.low | \n",
" conf.high | \n",
" ranef_grouping | \n",
" rank | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" italiangrid_voms | \n",
" _italiangrid_voms_commits.csv | \n",
" italiangrid_voms_hullabaloo_README.md | \n",
" ran_vals | \n",
" project_id | \n",
" italiangrid_voms | \n",
" before_after:week_index | \n",
" -0.014093 | \n",
" 0.638314 | \n",
" -1.265166 | \n",
" 1.236980 | \n",
" 1 | \n",
" 2294.0 | \n",
"
\n",
" \n",
" 1 | \n",
" ultrajson_ultrajson | \n",
" _ultrajson_ultrajson_commits.csv | \n",
" ultrajson_ultrajson_hullabaloo_README | \n",
" ran_vals | \n",
" project_id | \n",
" ultrajson_ultrajson | \n",
" before_after:week_index | \n",
" 0.096429 | \n",
" 0.616497 | \n",
" -1.111884 | \n",
" 1.304742 | \n",
" 1 | \n",
" 2814.0 | \n",
"
\n",
" \n",
" 2 | \n",
" swipely_docker-api | \n",
" _swipely_docker-api_commits.csv | \n",
" swipely_docker-api_hullabaloo_README.md | \n",
" ran_vals | \n",
" project_id | \n",
" swipely_docker-api | \n",
" before_after:week_index | \n",
" 0.084690 | \n",
" 0.612034 | \n",
" -1.114875 | \n",
" 1.284254 | \n",
" 1 | \n",
" 2760.0 | \n",
"
\n",
" \n",
" 3 | \n",
" aio-libs_aiomysql.git | \n",
" _aio-libs_aiomysql.git_commits.csv | \n",
" aio-libs_aiomysql.git_hullabaloo_README | \n",
" ran_vals | \n",
" project_id | \n",
" aio-libs_aiomysql.git | \n",
" before_after:week_index | \n",
" -0.494687 | \n",
" 0.731528 | \n",
" -1.928454 | \n",
" 0.939081 | \n",
" 1 | \n",
" 118.0 | \n",
"
\n",
" \n",
" 4 | \n",
" shekyan_slowhttptest | \n",
" _shekyan_slowhttptest_commits.csv | \n",
" shekyan_slowhttptest_hullabaloo_README.md | \n",
" ran_vals | \n",
" project_id | \n",
" shekyan_slowhttptest | \n",
" before_after:week_index | \n",
" -0.335128 | \n",
" 0.704815 | \n",
" -1.716541 | \n",
" 1.046284 | \n",
" 1 | \n",
" 1027.0 | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" repo_id commits_filepath \\\n",
"0 italiangrid_voms _italiangrid_voms_commits.csv \n",
"1 ultrajson_ultrajson _ultrajson_ultrajson_commits.csv \n",
"2 swipely_docker-api _swipely_docker-api_commits.csv \n",
"3 aio-libs_aiomysql.git _aio-libs_aiomysql.git_commits.csv \n",
"4 shekyan_slowhttptest _shekyan_slowhttptest_commits.csv \n",
"\n",
" fvf_filepath effect group \\\n",
"0 italiangrid_voms_hullabaloo_README.md ran_vals project_id \n",
"1 ultrajson_ultrajson_hullabaloo_README ran_vals project_id \n",
"2 swipely_docker-api_hullabaloo_README.md ran_vals project_id \n",
"3 aio-libs_aiomysql.git_hullabaloo_README ran_vals project_id \n",
"4 shekyan_slowhttptest_hullabaloo_README.md ran_vals project_id \n",
"\n",
" level term estimate std.error \\\n",
"0 italiangrid_voms before_after:week_index -0.014093 0.638314 \n",
"1 ultrajson_ultrajson before_after:week_index 0.096429 0.616497 \n",
"2 swipely_docker-api before_after:week_index 0.084690 0.612034 \n",
"3 aio-libs_aiomysql.git before_after:week_index -0.494687 0.731528 \n",
"4 shekyan_slowhttptest before_after:week_index -0.335128 0.704815 \n",
"\n",
" conf.low conf.high ranef_grouping rank \n",
"0 -1.265166 1.236980 1 2294.0 \n",
"1 -1.111884 1.304742 1 2814.0 \n",
"2 -1.114875 1.284254 1 2760.0 \n",
"3 -1.928454 0.939081 1 118.0 \n",
"4 -1.716541 1.046284 1 1027.0 "
]
},
"execution_count": 37,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"readme_merged = pd.merge(readme_manifest, readme_ranef, on=['repo_id'], how='inner')\n",
"readme_merged = readme_merged.drop(columns='Unnamed: 0')\n",
"readme_merged.head()"
]
},
{
"cell_type": "code",
"execution_count": 38,
"metadata": {},
"outputs": [],
"source": [
"readme_merged.to_csv('0203_readme_merged_manifest.csv', index=False)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "base",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.2"
}
},
"nbformat": 4,
"nbformat_minor": 2
}