{ "metadata": { "name": "", "signature": "sha256:31e47feffb00b301259bd8f83327926a71927c86e6f9064984a2c8047858445b" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "code", "collapsed": false, "input": [ "name = '2015-06-01-cf_units'\n", "title = 'Yet another units module'\n", "\n", "import os\n", "from datetime import datetime\n", "\n", "from IPython.core.display import HTML\n", "\n", "with open('creative_commons.txt', 'r') as f:\n", " html = f.read()\n", "\n", "html = '''\n", "\n", "
This post was written as an IPython notebook.\n", " It is available for download\n", " or as a static html.
\n", "\n", "%s''' % (name, name, html)\n", "\n", "%matplotlib inline\n", "from matplotlib import style\n", "style.use('ggplot')\n", "\n", "hour = datetime.utcnow().strftime('%H:%M')\n", "comments=\"true\"\n", "\n", "date = '-'.join(name.split('-')[:3])\n", "slug = '-'.join(name.split('-')[3:])\n", "\n", "metadata = dict(title=title,\n", " date=date,\n", " hour=hour,\n", " comments=comments,\n", " slug=slug,\n", " name=name)\n", "\n", "markdown = \"\"\"Title: {title}\n", "date: {date} {hour}\n", "comments: {comments}\n", "slug: {slug}\n", "\n", "{{% notebook {name}.ipynb cells[1:] %}}\n", "\"\"\".format(**metadata)\n", "\n", "content = os.path.abspath(os.path.join(os.getcwd(), os.pardir, os.pardir, '{}.md'.format(name)))\n", "with open('{}'.format(content), 'w') as f:\n", " f.writelines(markdown)" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 1 }, { "cell_type": "markdown", "metadata": {}, "source": [ "I have been working in splitting\n", "[iris units](https://github.com/SciTools/cf_units)\n", "module into its own module for a while and recently we had our\n", "[first release](https://pypi.python.org/pypi/cf_units),\n", "and our first external use: the IOOS\n", "[compliance-checker](https://github.com/ioos/compliance-checker/pull/114).\n", "\n", "(Warning! Before reading the post please watch the video below.)" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from IPython.display import YouTubeVideo\n", "\n", "YouTubeVideo(\"N-edLdxiM40\")" ], "language": "python", "metadata": {}, "outputs": [ { "html": [ "\n", " \n", " " ], "metadata": {}, "output_type": "pyout", "prompt_number": 2, "text": [ "This post was written as an IPython notebook.\n", " It is available for download\n", " or as a static html.
\n", "\n", "