Skip to content

Commit

Permalink
Add demo notebook
Browse files Browse the repository at this point in the history
Merge branch 'add-demo-notebook' into 'develop'

See merge request persper/code-analytics!92
  • Loading branch information
hezyin committed May 27, 2019
2 parents ccb9147 + 4c41be9 commit acc8078
Showing 1 changed file with 72 additions and 0 deletions.
72 changes: 72 additions & 0 deletions notebooks/demo.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# import deps\n",
"import os\n",
"from persper.analytics.c import CGraphServer\n",
"from persper.analytics.analyzer2 import Analyzer\n",
"from persper.analytics.graph_server import C_FILENAME_REGEXES\n",
"from persper.util.path import root_path"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# configure your project\n",
"repo_path = os.path.join(root_path, 'repos/<your_repo_name>')\n",
"\n",
"# configure alpha for devrank\n",
"alpha = 0.5"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# start analysis and show commit devrank values\n",
"az = Analyzer(repo_path, CGraphServer(C_FILENAME_REGEXES))\n",
"await az.analyze()\n",
"ccgraph = az.graph\n",
"ccgraph.commit_devranks(alpha)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "code-analytics-8iDyuztf",
"language": "python",
"name": "code-analytics-8idyuztf"
},
"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.6.6"
}
},
"nbformat": 4,
"nbformat_minor": 2
}

0 comments on commit acc8078

Please sign in to comment.