From 16b420b19d9dc18d690d81cb94a6bcfcb0659116 Mon Sep 17 00:00:00 2001
From: Eric Pellegrini <pellegrini@ill.fr>
Date: Fri, 8 Feb 2019 17:55:40 +0100
Subject: [PATCH] updated CHANGELOG added informations to the README cleaned up
 the output cells of the demo notebook

---
 CHANGELOG                                     |   7 +
 README.md                                     |  52 ++++++++
 .../HDFViewerDemo-checkpoint.ipynb            | 120 ------------------
 notebooks/HDFViewerDemo.ipynb                 |  67 +---------
 4 files changed, 66 insertions(+), 180 deletions(-)
 delete mode 100644 notebooks/.ipynb_checkpoints/HDFViewerDemo-checkpoint.ipynb

diff --git a/CHANGELOG b/CHANGELOG
index b864d6e..76ba5bb 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,10 @@
+version 0.2.0
+--------------
+* FIXED   typos due to files and classes renamings
+* CHANGED reorganized the files
+* CHANGED reorganized renamed some classes
+* CHANGED added informations in the README
+
 version 0.1.0
 --------------
 * ADDED initial contents
diff --git a/README.md b/README.md
index e69de29..6e0ef91 100644
--- a/README.md
+++ b/README.md
@@ -0,0 +1,52 @@
+Overview
+========
+
+**hdfviewer** is a python3 package for inspecting HDF files in the context of **Jupyter Lab** notebook.
+It represents each group found in the HDF file as an accordion made of the following subitems:
+- **attributes**: contains the HDF attributes of this group
+- **groups**: contains the HDF subgroups of this group 
+- **datasets**: contains the HDF datasets of this group
+
+If one of these subitems is empty (e.g. no attributes defined for a given group) the corresponding subitem is omitted.
+When one reaches a HDF dataset, informations about the dataset are collected (dimensionality, numeric type, attributes ...) and displayed in a Jupyter output widget. In case of 1D, 2D or 3D dataset, a view of the dataset is also displayed. Depending on the dimensionality of the dataset the display will consist in:
+- **1D**: simple MatPlotLib 1D plot
+- **2D**: matrix view of the dataset
+- **3D**: matrix view of the dataset
+
+In case of **2D** and **3D** datasets, the matrix view is made of a 2D image of the selected frame of the dataset (always `0` for 2D datasets) with a 1D column-projection view of the dataset on its top and a 1D row-projection view of the dataset on its right. The matrix view is interactive with the following interactions:
+- **2D**:
+    - toggle between cross and integration 1D potting mode. In cross plot mode, the 1D projection views represents resp. the row and column of the matrix image point left-clicked by the user. In integration plot mode, the 1D projection views represents the sum over resp. the row and column of the image. To switch between those two modes, press the **i** key.
+- **3D**:
+    - toggle between cross and integration 1D potting mode. See above.
+    - go to the last frame by pressing the **pgdn** key.
+    - go to the first frame by pressing the **pgup** key.
+    - go to the next frame by pressing the **down** or the **right** keys or wheeling **down** the mouse wheel
+    - go to the previous frame by pressing the **up** or the **left** keys or wheeling **up** the mouse down
+    - go the +n (n can be > 9) frame by pressing *n* number followed by the **down** or the **right** keys 
+    - go the -n (n can be > 9) frame by pressing *n* number followed by the **up** or the **left** keys 
+
+Installation
+=============
+- `cd` to the directory where lies the `setup.py` file
+- `python3 setup build`
+- `python3 setup install`
+
+Usage in a notebook
+===================
+`%matplotlib ipympl`
+
+`import h5py`
+`from hdfviewer.widgets.HDFViewer import HDFViewer`
+`from hdfviewer.widgets.PathSelector import PathSelector`
+
+`path = PathSelector(extensions=[".hdf",".h5",".nxs"])`
+`path.widget`
+
+`if path.file:`
+&emsp;&emsp;`hdf5 = h5py.File(path.file,"r")`
+&emsp;&emsp;`   display(HDFViewer(hdf5))`
+
+
+
+
+
diff --git a/notebooks/.ipynb_checkpoints/HDFViewerDemo-checkpoint.ipynb b/notebooks/.ipynb_checkpoints/HDFViewerDemo-checkpoint.ipynb
deleted file mode 100644
index 19723ba..0000000
--- a/notebooks/.ipynb_checkpoints/HDFViewerDemo-checkpoint.ipynb
+++ /dev/null
@@ -1,120 +0,0 @@
-{
- "cells": [
-  {
-   "cell_type": "code",
-   "execution_count": 1,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "%matplotlib ipympl"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": 2,
-   "metadata": {},
-   "outputs": [
-    {
-     "ename": "ImportError",
-     "evalue": "No module named 'hdfviewer.HDFViewer'",
-     "output_type": "error",
-     "traceback": [
-      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
-      "\u001b[0;31mImportError\u001b[0m                               Traceback (most recent call last)",
-      "\u001b[0;32m<ipython-input-2-4e5ea23e6fd6>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m      1\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0mh5py\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m      2\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 3\u001b[0;31m \u001b[0;32mfrom\u001b[0m \u001b[0mhdfviewer\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mHDFViewer\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0mHDFViewer\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m      4\u001b[0m \u001b[0;32mfrom\u001b[0m \u001b[0mhdfviewer\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mPathSelector\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0mPathSelector\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
-      "\u001b[0;31mImportError\u001b[0m: No module named 'hdfviewer.HDFViewer'"
-     ]
-    }
-   ],
-   "source": [
-    "import h5py\n",
-    "\n",
-    "from hdfviewer.widgets.HDFViewer import HDFViewer\n",
-    "from hdfviewer.widgets.PathSelector import PathSelector"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": 3,
-   "metadata": {},
-   "outputs": [
-    {
-     "ename": "NameError",
-     "evalue": "name 'PathSelector' is not defined",
-     "output_type": "error",
-     "traceback": [
-      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
-      "\u001b[0;31mNameError\u001b[0m                                 Traceback (most recent call last)",
-      "\u001b[0;32m<ipython-input-3-21cbad8e706b>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mpath\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mPathSelector\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mextensions\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m\".hdf\"\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\".h5\"\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\".nxs\"\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m      2\u001b[0m \u001b[0mpath\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mwidget\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
-      "\u001b[0;31mNameError\u001b[0m: name 'PathSelector' is not defined"
-     ]
-    }
-   ],
-   "source": [
-    "path = PathSelector(extensions=[\".hdf\",\".h5\",\".nxs\"])\n",
-    "path.widget"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": 4,
-   "metadata": {},
-   "outputs": [
-    {
-     "data": {
-      "application/vnd.jupyter.widget-view+json": {
-       "model_id": "2cbde8bd4b9e4ebd8e25af84d88175b8",
-       "version_major": 2,
-       "version_minor": 0
-      },
-      "text/plain": [
-       "HDFViewer(children=(HDFViewer(children=(Accordion(children=(HTML(value='/users/data/420766.nxs'), HTML(value='…"
-      ]
-     },
-     "metadata": {},
-     "output_type": "display_data"
-    }
-   ],
-   "source": [
-    "if path.file:\n",
-    "    hdf5 = h5py.File(path.file,\"r\")\n",
-    "    display(HDFViewer(hdf5))"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": []
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "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.2"
-  }
- },
- "nbformat": 4,
- "nbformat_minor": 2
-}
diff --git a/notebooks/HDFViewerDemo.ipynb b/notebooks/HDFViewerDemo.ipynb
index 19723ba..3f8b742 100644
--- a/notebooks/HDFViewerDemo.ipynb
+++ b/notebooks/HDFViewerDemo.ipynb
@@ -2,7 +2,7 @@
  "cells": [
   {
    "cell_type": "code",
-   "execution_count": 1,
+   "execution_count": null,
    "metadata": {},
    "outputs": [],
    "source": [
@@ -11,21 +11,9 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 2,
+   "execution_count": null,
    "metadata": {},
-   "outputs": [
-    {
-     "ename": "ImportError",
-     "evalue": "No module named 'hdfviewer.HDFViewer'",
-     "output_type": "error",
-     "traceback": [
-      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
-      "\u001b[0;31mImportError\u001b[0m                               Traceback (most recent call last)",
-      "\u001b[0;32m<ipython-input-2-4e5ea23e6fd6>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m      1\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0mh5py\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m      2\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 3\u001b[0;31m \u001b[0;32mfrom\u001b[0m \u001b[0mhdfviewer\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mHDFViewer\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0mHDFViewer\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m      4\u001b[0m \u001b[0;32mfrom\u001b[0m \u001b[0mhdfviewer\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mPathSelector\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0mPathSelector\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
-      "\u001b[0;31mImportError\u001b[0m: No module named 'hdfviewer.HDFViewer'"
-     ]
-    }
-   ],
+   "outputs": [],
    "source": [
     "import h5py\n",
     "\n",
@@ -35,21 +23,9 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 3,
+   "execution_count": null,
    "metadata": {},
-   "outputs": [
-    {
-     "ename": "NameError",
-     "evalue": "name 'PathSelector' is not defined",
-     "output_type": "error",
-     "traceback": [
-      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
-      "\u001b[0;31mNameError\u001b[0m                                 Traceback (most recent call last)",
-      "\u001b[0;32m<ipython-input-3-21cbad8e706b>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mpath\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mPathSelector\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mextensions\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m\".hdf\"\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\".h5\"\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\".nxs\"\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m      2\u001b[0m \u001b[0mpath\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mwidget\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
-      "\u001b[0;31mNameError\u001b[0m: name 'PathSelector' is not defined"
-     ]
-    }
-   ],
+   "outputs": [],
    "source": [
     "path = PathSelector(extensions=[\".hdf\",\".h5\",\".nxs\"])\n",
     "path.widget"
@@ -57,43 +33,14 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 4,
+   "execution_count": null,
    "metadata": {},
-   "outputs": [
-    {
-     "data": {
-      "application/vnd.jupyter.widget-view+json": {
-       "model_id": "2cbde8bd4b9e4ebd8e25af84d88175b8",
-       "version_major": 2,
-       "version_minor": 0
-      },
-      "text/plain": [
-       "HDFViewer(children=(HDFViewer(children=(Accordion(children=(HTML(value='/users/data/420766.nxs'), HTML(value='…"
-      ]
-     },
-     "metadata": {},
-     "output_type": "display_data"
-    }
-   ],
+   "outputs": [],
    "source": [
     "if path.file:\n",
     "    hdf5 = h5py.File(path.file,\"r\")\n",
     "    display(HDFViewer(hdf5))"
    ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": []
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": []
   }
  ],
  "metadata": {
-- 
GitLab