From 4c41be9fefcf3da2c2273082b5b6cdcb8993ae1b Mon Sep 17 00:00:00 2001 From: Hezheng Yin Date: Sun, 26 May 2019 23:00:03 -0700 Subject: [PATCH] Add demo notebook --- notebooks/demo.ipynb | 72 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 notebooks/demo.ipynb diff --git a/notebooks/demo.ipynb b/notebooks/demo.ipynb new file mode 100644 index 00000000000..48ddf3760fb --- /dev/null +++ b/notebooks/demo.ipynb @@ -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/')\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 +}