{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<a id=\"top\"></a>\n",
    "<table style='border-style:none;'>\n",
    "<tr style=\"border-style:none;\">\n",
    "<td style=\"border-style:none;\">\n",
    "<a href=\"./pyMez/index.html\"><button type=\"button\" class='btn btn-primary'>\n",
    "<span style=\"font-size:20px\">API Documentation</span></button></a> \n",
    "</td>\n",
    "<td style=\"border-style:none;\">\n",
    "<a href=\"./Examples/html/Examples_Home.html\">\n",
    "<button type=\"button\" class='btn btn-primary'>\n",
    "<span style=\"font-size:20px\">Examples</span></button></a> \n",
    "</td>\n",
    "<td style=\"border-style:none;\">\n",
    "<a href=\"./Reference_Index.html\">\n",
    "<button type=\"button\" class='btn btn-primary'>\n",
    "<span style=\"font-size:20px\">Index</span></button></a> \n",
    "</td>\n",
    "</tr>\n",
    "</table>\n",
    "\n",
    "# Welcome to pyMez, an open source python library for science.\n",
    "This documentation is for the pyMez package, designed by Aric Sanders <a href=\"mailto:aric.sanders@gmail.com\"> aric.sanders@gmail.com </a> 2016. \n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n",
    "## Table of Contents\n",
    "<hr style=\"border-top: 3px double #8c8b8b;\"/>\n",
    "<ol style=\"list-style-type: upper-roman\">\n",
    "<li><h3> <a href=\"#intro\">Introduction</a> </h3></li>\n",
    "A brief introduction to pyMez and its motivation.\n",
    "<li><h3> <a href=\"#install\">Installing and Loading pyMez</a></h3> </li>\n",
    "How to install pyMez and its requirements \n",
    "<li><h3> <a href=\"#help\">Getting Help</a></h3> </li>\n",
    "How to get help on the pyMez package and general.\n",
    "<li> <h3><a href=\"#design\">The Design of pyMez</a> </h3></li>\n",
    "The overall design of pyMez, including how to contribute.\n",
    "\n",
    "<li> <h3><a href=\"#license\">License</a></h3> </li>\n",
    "pyMez License Statement\n",
    "<!--\n",
    "<li><h3> <a href=\"#pyMez-examples\">pyMez Specific Examples</a></h3> </li>\n",
    "Examples specific to the pyMez package.\n",
    "<li><h3> <a href=\"#general-examples\">General Examples</a> </h3></li>\n",
    "Examples for general tasks in python and related packages.\n",
    "<li> <h3><a href=\"#nist-examples\">NIST Examples</a> </h3></li>\n",
    "Examples pertinent to work at NIST in Boulder.-->\n",
    "</ol>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<a href=\"#top\"> <em>back to top</em></a>  |  <a href=\"#top\"> <em>previous topic</em></a>  |  <a href=\"#intro\"> <em>next topic</em></a>\n",
    " <hr style=\"border-top: 2px double #8c8b8b;\"/>\n",
    "<h2><a id=\"intro\">Introduction</a> </h2>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "pyMez is a python package born out of the daily needs of a laboratory scientist. In particular, there is a constant need to use external equipment to acquire data, store that data in a sensible way, analyze the stored data, and generate collections and reports after analyzing the data. In the world of scientific computation there is an endless universe of solutions to do this, however none of the solutions met my personal daily needs and philosophy simultaneously. This package tries to stitch together many tools to meet those needs, while serving as a backend library to a webserver. It thus has many dependencies. Some of the dependencies are os specific, however the lack of them should not prevent operation. Although it currently has a single primary developer, it is my hope that it will be adopted by at least 10's of people and help them accomplish their daily scientific goals."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<a href=\"#top\"> <em>back to top</em></a>  |  <a href=\"#intro\"> <em>previous topic</em></a>  |  <a href=\"#install\"> <em>next topic</em></a>\n",
    " <hr style=\"border-top: 2px double #8c8b8b;\"/>\n",
    "<h2><a id=\"install\">Installing and Loading pyMez</a> </h2>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Installation using pip\n",
    "`>> pip install pyMez`\n",
    "\n",
    "\n",
    "### Long Installation\n",
    "\n",
    "1.\tInstall Anaconda 2.7 from https://www.continuum.io/downloads\n",
    "2.\tInstall pyvisa using pip install pyvisa\n",
    "3.\tInstall NI-Visa from http://www.ni.com/download/ni-visa-15.0.1/5693/en/\n",
    "4.\tClone [boa](https://github.com/aricsanders/boa) repository to Anaconda2/Lib/site-packages\n",
    "5.\tClone [pyMez](https://github.com/aricsanders/pyMez) to Anaconda2/Lib/site-packages\n",
    "6.\tInstall wx from source forge http://wxpython.org/\n",
    "7.\tIn addition, the USB-GPIB interface needs drivers from NI (NI488.2 version 15) and a computer restart.\n",
    "\n",
    "### Optional Dependencies\n",
    "\n",
    "1. Inkscape from https://inkscape.org/en/download/\n",
    "2. Microscoft Office\n",
    "3. pdfkit and wkhtmltopdf pip install pdfkit and install from http://wkhtmltopdf.org/\n",
    "4. statistiCAL and Microwave Uncertainty Framework from  http://www.nist.gov/ctl/rf-technology/related-software.cfm\n",
    "\n",
    "### Development Environment Details\n",
    "A detailed description of my development environment can be found <a href=\"./Examples/html/Development_Stack.html\">here</a>\n",
    "\n",
    "### Accessing the API after installation\n",
    "The API is best accessed by importing as\n",
    "```python\n",
    "from pyMez import *\n",
    "```\n",
    "However, if a specific function or class is required then direct import also works (this form imports the full API)\n",
    "```python\n",
    "from pyMez.Code.DataHandlers.XMLModels import XMLBase\n",
    "```\n",
    "If you want to have the import skip the API, then add the pyMez folder to sys.path and then import beginning with Code\n",
    "```python\n",
    "import sys\n",
    "sys.path.append(r\"C:\\ProgramData\\Anaconda2\\Lib\\site-packages\\pyMez\")\n",
    "from Code.DataHandlers.XMLModels import XMLBase\n",
    "```"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<a href=\"#top\"> <em>back to top</em></a>  |  <a href=\"#install\"> <em>previous topic</em></a>  |  <a href=\"#help\"> <em>next topic</em></a>\n",
    " <hr style=\"border-top: 2px double #8c8b8b;\"/>\n",
    "<h2><a id=\"help\">Getting Help</a> </h2>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "There are many ways to get help on pyMez. Internal to pyMez there are several primary help components:\n",
    "<ul>\n",
    "<li>This page</li>\n",
    "<li> <a href=\"./pyMez/index.html\">API help</a></li>\n",
    "<li> <a href=\"./Examples/html/Examples_Home.html\">Html Examples </a></li>\n",
    "<li> <a href=\"./Examples/jupyter/Examples_Home.ipynb\">Jupyter Interactive Examples </a></li>\n",
    "<li><a href=\"./Reference_Index.html\">Index of All Classes and Functions in pyMez </a></li>\n",
    "\n",
    "\n",
    "</ul>\n",
    "Additionally, python has a series of help functions including the command line tool\n",
    "pydoc, in `jupyter` or Ipython help can be reached by ?object or help(object).\n",
    "`?XMLBase`\n",
    "```python\n",
    "help(XMLBase)\n",
    "```\n",
    "In addition there are several tools in <a href=\"./pyMez/Code/Utils/HelpUtils.m.html\">pyMez.Code.Utils.HelpUtils</a> for generating html based help files."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "<a href=\"#top\"> <em>back to top</em></a>  |  <a href=\"#help\"> <em>previous topic</em></a>  |  <a href=\"#design\"> <em>next topic</em></a>\n",
    " <hr style=\"border-top: 2px double #8c8b8b;\"/>\n",
    "<h2><a id=\"design\">The Design of pyMez</a> </h2>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Overall Design Goal\n",
    "pyMez was designed with the overall goal of being easy to use, well documented, well tested and modular. The overall design follows a pattern of Models (DataHandlers), View and View-Controllers (FrontEnds), Anaylsis and Instrument Control. The python modules that compose pyMez follow these <a href=\"./Examples/jupyter/pyMez_Module_Specification.ipynb\">jupyter version of the guidelines</a> or <a href=\"./Examples/html/pyMez_Module_Specification.html\">html version of the guidelines</a>\n",
    "\n",
    "### Directory Structure\n",
    "<ul>\n",
    "<li> pyMez : The top directory that should be installed in python27/Lib/site-packages or C:\\ProgramData\\Anaconda2\\Lib\\site-packages\n",
    "<ul>\n",
    "<li> Code: The top level folder for the code repository </li>\n",
    "<ul>\n",
    "<li>Utils: Subpackage for utility functions needed by all of pyMez</li>\n",
    "<li>DataHandlers: Data models needed by everything but Utils</li>\n",
    "<li>Analysis: Functions and classes based on analyzing data. Requires Utils and DataHandlers.</li>\n",
    "<li>InstrumentControl: Functions and classes that communicate with external devices. Requires Utils and DataHandlers</li>\n",
    "<li>FrontEnds: Functions and classes that tie it altogether for the user, requires all other modules.</li>\n",
    "</ul>\n",
    "<li> Documentation: Top level folder for docs including examples </li>\n",
    "<li> Instruments: A repository for XML sheets describing instruments </li>\n",
    "<li> Data: A repository for data, this is volatile and likely to change </li> \n",
    "<ul> \n",
    "<li>Measurements: Storage for measurement data, either in xml or ascii</li>\n",
    "<li>Logs: Storage for xml logs</li>\n",
    "<li>States: Storage for Instrument and Experimental States</li>\n",
    "<li>Reports: Storage for formatted output </li>\n",
    "\n",
    "</ul>\n",
    "</ul>\n",
    "</li>\n",
    "</ul>\n",
    "\n",
    "### Testing Infrastructure\n",
    "pyMez has a multi-tiered testing infrastructure. It is comprised of basic unit tests, mesoscopic in-module tests, and integration tests. \n",
    "1. __Unit tests :__ These tests check if functions and classes with a basic input return what is expected. They are found in the module <a href=\"./pyMez/Code/Utils/pyMezUnitTest.m.html\">pyMez.Code.Utils.pyMezUnitTests</a> \n",
    "2. __In Module Tests :__ Theses tests are scripts included in each module that test a series of things about functions or classes, they are typically named test_thing_of_interest(). For example in the module pyMez.Code.DataHandlers.XMLModels there are >15 scripts to test functions and classes with names like <a href=\"./pyMez/Code/DataHandlers/XMLModels.m.html#pyMez.Code.DataHandlers.XMLModels.test_get_header\">test_get_header</a>.\n",
    "3. __Integration Tests:__ These tests check if a large number of interacting components work as expected. For the wx frontend this is primarily the class <a href=\"./pyMez/Code/FrontEnds/AdvancedInterfaceFrame.m.html\"> AdvancedInterfaceFrame</a>, or an integrated application that can open new window panels, run the in module tests and check if data objects appear as they are expected. For the django FrontEnd this is a Test_Server run using Django's development server found in manage.py. For Jupyter, this is a series of <a href=\"./Examples/jupyter/Examples_Home.ipynb\">examples</a> that live in pyMez/Documentation/Examples. \n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "<a href=\"#top\"> <em>back to top</em></a>  |  <a href=\"#help\"> <em>previous topic</em></a>  |  <a href=\"#license\"> <em>next topic</em></a>\n",
    " <hr style=\"border-top: 2px double #8c8b8b;\"/>\n",
    "<h2><a id=\"license\">License</a> </h2>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "This is free and unencumbered software released into the public domain.\n",
    "\n",
    "Anyone is free to copy, modify, publish, use, compile, sell, or\n",
    "distribute this software, either in source code form or as a compiled\n",
    "binary, for any purpose, commercial or non-commercial, and by any\n",
    "means.\n",
    "\n",
    "In jurisdictions that recognize copyright laws, the author or authors\n",
    "of this software dedicate any and all copyright interest in the\n",
    "software to the public domain. We make this dedication for the benefit\n",
    "of the public at large and to the detriment of our heirs and\n",
    "successors. We intend this dedication to be an overt act of\n",
    "relinquishment in perpetuity of all present and future rights to this\n",
    "software under copyright law.\n",
    "\n",
    "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n",
    "EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n",
    "MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n",
    "IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR\n",
    "OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,\n",
    "ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n",
    "OTHER DEALINGS IN THE SOFTWARE.\n",
    "\n",
    "For more information, please refer to <http://unlicense.org/>"
   ]
  }
 ],
 "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.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
