{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "e1c3b239-d45e-43f6-9d2d-64ee46e75e61",
   "metadata": {},
   "source": [
    "1. Find available DBs\n",
    "2. Save list\n",
    "3. Refine selection\n",
    "4. Save selection\n",
    "    1. Generate `databases.json` for use in vs code extension\n",
    "    2. Generate `list-databases.json` for use by gh-mrva client\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "042947ea-8514-4318-a768-7826e494dd43",
   "metadata": {},
   "outputs": [],
   "source": [
    "from db_load_fs import dbdf_from_tree"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "43a7f75f-c3ac-4e23-b30a-096f7119edf6",
   "metadata": {},
   "outputs": [],
   "source": [
    "df = dbdf_from_tree()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "e13adbb1-c876-4712-a010-36983f6b56b6",
   "metadata": {
    "editable": true,
    "scrolled": true,
    "slideshow": {
     "slide_type": ""
    },
    "tags": []
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "2024-07-10 08:33:35 [DEBUG] /Users/hohn/work-gh/mrva/mrvacommander/client/venv/lib/python3.11/site-packages/ipykernel_launcher.py -f /Users/hohn/Library/Jupyter/runtime/kernel-8e934521-9e0d-469f-aa73-3fa1f8b9808a.json\n",
      "2024-07-10 08:33:35 [DEBUG] Hostname: ghm3\n",
      "2024-07-10 08:33:35 [DEBUG] pytest: False, flask-debug: False\n",
      "2024-07-10 08:33:35 [DEBUG] pre-locking index columns ([]) to settings[2]\n",
      "2024-07-10 08:33:35 [DEBUG] Starting new HTTP connection (1): ghm3:40000\n",
      "2024-07-10 08:33:35 [DEBUG] http://ghm3:40000 \"GET /health HTTP/11\" 200 2\n",
      "2024-07-10 08:33:35 [DEBUG] Starting new HTTP connection (1): ghm3:40000\n",
      "2024-07-10 08:33:35 [DEBUG] http://ghm3:40000 \"GET /health HTTP/11\" 200 2\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "\n",
       "        <iframe\n",
       "            width=\"100%\"\n",
       "            height=\"475\"\n",
       "            src=\"http://ghm3:40000/dtale/iframe/2\"\n",
       "            frameborder=\"0\"\n",
       "            allowfullscreen\n",
       "            \n",
       "        ></iframe>\n",
       "        "
      ],
      "text/plain": [
       "<IPython.lib.display.IFrame at 0x177618ad0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": []
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "    import dtale\n",
    "    dtale.show(df)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "29beb747-fbff-4bc9-b304-3d921ca0232b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[<Axes: title={'center': 'size'}>]], dtype=object)"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "[encoded data, 16224 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "df.hist(column='size', bins=100)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "2441f24c-e5c9-42da-9728-d7b115675648",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "2024-07-10 08:36:32 [DEBUG] Loaded backend widget version unknown.\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "array([[<Axes: title={'center': 'size'}>]], dtype=object)"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "bbacd6711fb74eeea6325aea9bb38a86",
       "version_major": 2,
       "version_minor": 0
      },
      "image/png": "[encoded data, 16828 characters]",
      "text/html": [
       "\n",
       "            <div style=\"display: inline-block;\">\n",
       "                <div class=\"jupyter-widgets widget-label\" style=\"text-align: center;\">\n",
       "                    Figure\n",
       "                </div>\n",
       "                <img src='data:image/png;base64,[encoded data, 16828 characters]' width=640.0/>\n",
       "            </div>\n",
       "        "
      ],
      "text/plain": [
       "Canvas(toolbar=Toolbar(toolitems=[('Home', 'Reset original view', 'home', 'home'), ('Back', 'Back to previous …"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%matplotlib widget\n",
    "df.hist(column='size', bins=100)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "b0794b7a-79a4-4f2c-a08d-5461b718847a",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "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.11.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
