<commit_before>{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "# setup\n",
    "from planet4 import io\n",
    "from pathlib import Path\n",
    "import datetime as dt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "# test_P4DBName\n",
    "name = '2015-10-21_planet_four_classifications.csv'\n",
    "p4db = io.P4DBName(name)\n",
    "assert p4db.name == name\n",
    "assert p4db.p == Path(name)\n",
    "assert p4db.parent == Path('.')\n",
    "assert p4db.date == dt.datetime(2015, 10, 21)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {
    "collapsed": false,
    "scrolled": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "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.5.0"
  }
 },<commit_msg>add a test for the expanded `get_image_names_from_db<commit_after>{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "# setup\n",
    "from planet4 import io\n",
    "from pathlib import Path\n",
    "import datetime as dt\n",
    "from numpy.testing import assert_array_equal"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "# test_P4DBName\n",
    "name = '2015-10-21_planet_four_classifications.csv'\n",
    "p4db = io.P4DBName(name)\n",
    "assert p4db.name == name\n",
    "assert p4db.p == Path(name)\n",
    "assert p4db.parent == Path('.')\n",
    "assert p4db.date == dt.datetime(2015, 10, 21)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false,
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "# test_get_image_names_from_db\n",
    "result = io.get_image_names_from_db('./test_db.csv')\n",
    "expected = np.array(['APF000012q', 'APF000012w'])\n",
    "assert_array_equal(expected, result)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "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.5.0"
  }
 },
{'fraction_non_alphanumeric': 0.21309370988446727, 'fraction_numerical': 0.025994865211810013, 'mean_word_length': 2.848148148148148, 'pattern_counts': {'":': 82, '<': 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': '6692984', 'n_tokens_mistral': 1285, 'n_tokens_neox': 1231, 'n_words': 216}