Skip to content

Commit

Permalink
DOCS/MAINT: Apply nbstrip_jq to notebooks.
Browse files Browse the repository at this point in the history
  • Loading branch information
timstaley committed Feb 22, 2017
1 parent 61e037c commit 80c198d
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 170 deletions.
108 changes: 23 additions & 85 deletions documentation/source/tutorial/01-parsing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"from __future__ import print_function\n",
Expand All @@ -36,9 +34,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"# Uncomment the following and hit enter:\n",
Expand All @@ -59,9 +55,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"with open('voevent.xml') as f:\n",
Expand All @@ -78,9 +72,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"# Uncomment the following and hit tab:\n",
Expand All @@ -104,9 +96,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"# v.Who.Date.text\n",
Expand All @@ -116,9 +106,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"print(\"Inferred reason is\", v.Why.Inference.Name.text)\n",
Expand All @@ -140,9 +128,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"print(v.attrib['ivorn'])\n",
Expand All @@ -152,9 +138,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"v.Why.Inference.attrib"
Expand All @@ -163,9 +147,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"print(vp.prettystr(v.Who))"
Expand All @@ -182,9 +164,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"print(vp.prettystr(v.What.Group))"
Expand All @@ -202,9 +182,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"v.What[0] # v.What behaves like a list!"
Expand All @@ -220,9 +198,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"v.What is v.What[0]"
Expand All @@ -238,9 +214,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"for par in v.What.Group.Param:\n",
Expand All @@ -257,9 +231,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"len(v.What.Group.Param)"
Expand All @@ -268,9 +240,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"v.What.Group.Param[1].Description"
Expand All @@ -288,9 +258,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"print(v.Why.Inference.Name) # More syntax sugar - if it has a string-value but no children, print the string\n",
Expand All @@ -309,9 +277,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"# Consult the docstring\n",
Expand All @@ -322,9 +288,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"grouped_params = vp.get_grouped_params(v)\n",
Expand All @@ -335,9 +299,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"grouped_params['source_flux']['peak_flux']['value']"
Expand All @@ -357,9 +319,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"for child in v.Who.iterchildren():\n",
Expand All @@ -369,9 +329,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"for child in v.WhereWhen.ObsDataLocation.ObservationLocation.iterchildren():\n",
Expand All @@ -389,9 +347,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"v.find(\".//Param[@name='int_flux']\").attrib['value']"
Expand All @@ -412,25 +368,7 @@
]
}
],
"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.6"
}
},
"metadata": {},
"nbformat": 4,
"nbformat_minor": 0
}
Loading

0 comments on commit 80c198d

Please sign in to comment.