<commit_before>{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## PySAL Change Log Statistics\n",
    "\n",
    "This notebook generates the summary statistics for a package. \n",
    "\n",
    "It assumes you are running this under the `tools` directory at the toplevel of the package\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Change the values only in the next cell"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-10-22T21:36:03.766277Z",
     "start_time": "2020-10-22T21:36:03.763668Z"
    }
   },
   "outputs": [],
   "source": [
    "package_name = \"spaghetti\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**This notebook will generate a file in the current directory with the name ``changelog.md``. You can edit and append this on front of the ``CHANGELOG.md`` file for the package release.**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-10-22T21:36:04.090911Z",
     "start_time": "2020-10-22T21:36:03.768293Z"
    }
   },
   "outputs": [],
   "source": [
    "from __future__ import print_function\n",
    "import os\n",
    "import json\n",
    "import re\n",
    "import sys\n",
    "import pandas\n",
    "\n",
    "from datetime import datetime, timedelta\n",
    "from time import sleep\n",
    "from subprocess import check_output, Popen, PIPE\n",
    "try:\n",
    "    from urllib import urlopen\n",
    "except:\n",
    "    from urllib.request import urlopen\n",
    "\n",
    "import ssl\n",
    "import yaml\n",
    "\n",
    "context = ssl._create_unverified_context()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-10-22T21:36:04.434941Z",
     "start_time": "2020-10-22T21:36:04.093347Z"
    }
   },
   "outputs": [],
   "source": [
    "#  get date of last tag\n",
    "x, err = Popen(\n",
    "    'git log -1 --tags --simplify-by-decoration --pretty=\"%ai\"| cat',\n",
    "    stdin=PIPE,\n",
    "    stdout=PIPE,\n",
    "    stderr=PIPE,\n",
    "    shell=True\n",
    ").communicate()\n",
    "start_date = x.split()[0].decode(\"utf-8\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-10-22T21:36:04.442244Z",
     "start_time": "2020-10-22T21:36:04.439905Z"
    }
   },
   "outputs": [],
   "source": [
    "#  today's date\n",
    "release_date = str(datetime.today()).split()[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-10-22T21:36:04.451770Z",
     "start_time": "2020-10-22T21:36:04.443871Z"
    }
   },
   "outputs": [],
   "source": [
    "CWD = os.path.abspath(os.path.curdir)\n",
    "CWD"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-10-22T21:36:04.459442Z",
     "start_time": "2020-10-22T21:36:04.455310Z"
    }
   },
   "outputs": [],
   "source": [
    "since_date = '--since=\"{start}\"'.format(start=start_date)\n",
    "since_date\n",
    "since = datetime.strptime(start_date+\" 0:0:0\", \"%Y-%m-%d %H:%M:%S\")\n",
    "since"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2021-09-19T21:40:58.557330Z",
     "start_time": "2021-09-19T21:40:58.550183Z"
    }
   },
   "outputs": [],
   "source": [
    "# get __version__\n",
    "run ../spaghetti/_version.py"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2021-09-19T21:40:59.056406Z",
     "start_time": "2021-09-19T21:40:58.965594Z"
    }
   },
   "outputs": [],
   "source": [
    "__version__ = get_versions()[\"version\"]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Total commits by subpackage"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-10-22T21:36:04.541685Z",
     "start_time": "2020-10-22T21:36:04.465876Z"
    }
   },<commit_msg>syntax correction<commit_after>{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## PySAL Change Log Statistics\n",
    "\n",
    "This notebook generates the summary statistics for a package. \n",
    "\n",
    "It assumes you are running this under the `tools` directory at the toplevel of the package\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Change the values only in the next cell"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2021-09-21T20:39:33.196730Z",
     "start_time": "2021-09-21T20:39:33.194161Z"
    }
   },
   "outputs": [],
   "source": [
    "package_name = \"spaghetti\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**This notebook will generate a file in the current directory with the name ``changelog.md``. You can edit and append this on front of the ``CHANGELOG.md`` file for the package release.**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2021-09-21T20:39:52.290833Z",
     "start_time": "2021-09-21T20:39:52.258721Z"
    }
   },
   "outputs": [],
   "source": [
    "from __future__ import print_function\n",
    "import os\n",
    "import json\n",
    "import re\n",
    "import sys\n",
    "import pandas\n",
    "\n",
    "from datetime import datetime, timedelta\n",
    "from time import sleep\n",
    "from subprocess import check_output, Popen, PIPE\n",
    "try:\n",
    "    from urllib import urlopen\n",
    "except:\n",
    "    from urllib.request import urlopen\n",
    "\n",
    "import ssl\n",
    "import yaml\n",
    "\n",
    "context = ssl._create_unverified_context()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2021-09-21T20:39:53.266567Z",
     "start_time": "2021-09-21T20:39:53.111629Z"
    }
   },
   "outputs": [],
   "source": [
    "#  get date of last tag\n",
    "x, err = Popen(\n",
    "    'git log -1 --tags --simplify-by-decoration --pretty=\"%ai\"| cat',\n",
    "    stdin=PIPE,\n",
    "    stdout=PIPE,\n",
    "    stderr=PIPE,\n",
    "    shell=True\n",
    ").communicate()\n",
    "start_date = x.split()[0].decode(\"utf-8\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2021-09-21T20:39:54.680518Z",
     "start_time": "2021-09-21T20:39:54.675815Z"
    }
   },
   "outputs": [],
   "source": [
    "#  today's date\n",
    "release_date = str(datetime.today()).split()[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2021-09-21T20:39:55.591729Z",
     "start_time": "2021-09-21T20:39:55.575390Z"
    }
   },
   "outputs": [],
   "source": [
    "CWD = os.path.abspath(os.path.curdir)\n",
    "CWD"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2021-09-21T20:39:56.484646Z",
     "start_time": "2021-09-21T20:39:56.475350Z"
    }
   },
   "outputs": [],
   "source": [
    "since_date = '--since=\"{start}\"'.format(start=start_date)\n",
    "since_date\n",
    "since = datetime.strptime(start_date+\" 0:0:0\", \"%Y-%m-%d %H:%M:%S\")\n",
    "since"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2021-09-21T20:41:29.379320Z",
     "start_time": "2021-09-21T20:41:29.366354Z"
    }
   },
   "outputs": [],
   "source": [
    "# get __version__\n",
    "%run ../spaghetti/_version.py"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2021-09-21T20:41:42.275746Z",
     "start_time": "2021-09-21T20:41:42.181611Z"
    }
   },
   "outputs": [],
   "source": [
    "__version__ = get_versions()[\"version\"]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Total commits by subpackage"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-10-22T21:36:04.541685Z",
     "start_time": "2020-10-22T21:36:04.465876Z"
    }
   },
{'fraction_non_alphanumeric': 0.21118655771665323, 'fraction_numerical': 0.0844746230866613, 'mean_word_length': 2.573190789473684, 'pattern_counts': {'":': 166, '<': 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': '5284972', 'n_tokens_mistral': 3953, 'n_tokens_neox': 3509, 'n_words': 587}