<commit_before>{
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  },
  "name": "",
  "signature": "sha256:612b93caafb2f9d158f4aa72966283aa339978b2069af8fdd2b3d8af73a1b696"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "TRAPpy: Interactive Plotting"
     ]
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Re Run the cells to generate the graphs"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "%pylab inline\n",
      "import sys,os\n",
      "sys.path.append(\"..\")\n",
      "import pandas as pd\n",
      "import shutil\n",
      "import tempfile\n",
      "import trappy\n",
      "trace_thermal = \"./trace.txt\"\n",
      "trace_sched = \"../tests/raw_trace.dat\"\n",
      "TEMP_BASE = \"/tmp\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Populating the interactive namespace from numpy and matplotlib\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "def setup_thermal():\n",
      "    tDir = tempfile.mkdtemp(dir=\"/tmp\", prefix=\"trappy_doc\", suffix = \".tempDir\")\n",
      "    shutil.copyfile(trace_thermal, os.path.join(tDir, \"trace.txt\"))\n",
      "    return tDir\n",
      "\n",
      "def setup_sched():\n",
      "    tDir = tempfile.mkdtemp(dir=\"/tmp\", prefix=\"trappy_doc\", suffix = \".tempDir\")\n",
      "    shutil.copyfile(trace_sched, os.path.join(tDir, \"trace.dat\"))\n",
      "    return tDir"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 2
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "temp_thermal_location = setup_thermal()\n",
      "trace1 = trappy.FTrace(temp_thermal_location)\n",
      "trace2 = trappy.FTrace(temp_thermal_location)\n",
      "trace2.thermal.data_frame[\"temp\"] = trace1.thermal.data_frame[\"temp\"] * 2\n",
      "trace2.cpu_out_power.data_frame[\"power\"] = trace1.cpu_out_power.data_frame[\"power\"] * 2"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Interactive Line Plotting"
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Interactive Line Plots Supports the same API as the LinePlot but provide an interative plot that can be zoomed by clicking and dragging on the desired area. Double clicking resets the zoom."
     ]<commit_msg>doc: fix misspelling<commit_after>{
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  },
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "TRAPpy: Interactive Plotting"
     ]
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Re Run the cells to generate the graphs"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "%pylab inline\n",
      "import sys,os\n",
      "sys.path.append(\"..\")\n",
      "import pandas as pd\n",
      "import shutil\n",
      "import tempfile\n",
      "import trappy\n",
      "trace_thermal = \"./trace.txt\"\n",
      "trace_sched = \"../tests/raw_trace.dat\"\n",
      "TEMP_BASE = \"/tmp\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Populating the interactive namespace from numpy and matplotlib\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "def setup_thermal():\n",
      "    tDir = tempfile.mkdtemp(dir=\"/tmp\", prefix=\"trappy_doc\", suffix = \".tempDir\")\n",
      "    shutil.copyfile(trace_thermal, os.path.join(tDir, \"trace.txt\"))\n",
      "    return tDir\n",
      "\n",
      "def setup_sched():\n",
      "    tDir = tempfile.mkdtemp(dir=\"/tmp\", prefix=\"trappy_doc\", suffix = \".tempDir\")\n",
      "    shutil.copyfile(trace_sched, os.path.join(tDir, \"trace.dat\"))\n",
      "    return tDir"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 2
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "temp_thermal_location = setup_thermal()\n",
      "trace1 = trappy.FTrace(temp_thermal_location)\n",
      "trace2 = trappy.FTrace(temp_thermal_location)\n",
      "trace2.thermal.data_frame[\"temp\"] = trace1.thermal.data_frame[\"temp\"] * 2\n",
      "trace2.cpu_out_power.data_frame[\"power\"] = trace1.cpu_out_power.data_frame[\"power\"] * 2"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Interactive Line Plotting"
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Interactive Line Plots Supports the same API as the LinePlot but provide an interactive plot that can be zoomed by clicking and dragging on the desired area. Double clicking resets the zoom."
     ]
{'fraction_non_alphanumeric': 0.1966166613469518, 'fraction_numerical': 0.014044047239067986, 'mean_word_length': 2.3036373220875066, 'pattern_counts': {'":': 119, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7631504', 'n_tokens_mistral': 2328, 'n_tokens_neox': 2234, 'n_words': 418}