{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<b>Example use of VolumePredictor: </b> *Predict volume of Si*"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Initial vol: 40.0447946443\n",
      "Predicted vol: 32.7873368881\n"
     ]
    }
   ],
   "source": [
    "from matminer.learners.volume_prediction import VolumePredictor\n",
    "from pymatgen.util.testing import PymatgenTest\n",
    "\n",
    "s = PymatgenTest.get_structure(\"Si\")\n",
    "pred_vol = VolumePredictor().predict(s)\n",
    "print(\"Initial vol: {}\".format(s.volume))\n",
    "print(\"Predicted vol: {}\".format(pred_vol))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Predicted structure: \n",
      "Full Formula (Si2)\n",
      "Reduced Formula: Si\n",
      "abc   :   3.592584   3.592585   3.592584\n",
      "angles: 119.999991  90.000000  60.000009\n",
      "Sites (2)\n",
      "  #  SP       a    b     c\n",
      "---  ----  ----  ---  ----\n",
      "  0  Si    0     0    0\n",
      "  1  Si    0.75  0.5  0.75\n",
      "Predicted volume: 32.7873368881\n"
     ]
    }
   ],
   "source": [
    "# Get predicted structure\n",
    "pred_structure = VolumePredictor().get_predicted_structure(s)\n",
    "print(\"Predicted structure: \\n{}\".format(pred_structure))\n",
    "print(\"Predicted volume: {}\".format(pred_structure.volume))"
   ]
  }
 ],
 "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.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
