Created
August 10, 2017 16:20
-
-
Save chambbj/5a305b98ceb5aa7e59b114f7382ae26a to your computer and use it in GitHub Desktop.
Validating & Executing the Pipeline
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"We can check that we have defined a valid pipeline." | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 4, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"Is pipeline valid? True\n" | |
] | |
} | |
], | |
"source": [ | |
"valid = p.validate()\n", | |
"print('Is pipeline valid? %s' % valid)" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"Next, we execute the pipeline." | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 5, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"Pipeline processed 38010 points.\n" | |
] | |
} | |
], | |
"source": [ | |
"count = p.execute()\n", | |
"print('Pipeline processed %d points.' % count)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 6, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"Pipeline contains 1 array(s) of type <type 'numpy.ndarray'>.\n" | |
] | |
} | |
], | |
"source": [ | |
"arr = p.arrays[0]\n", | |
"print('Pipeline contains %d array(s) of type %s.' % (len(p.arrays), type(arr)))" | |
] | |
} | |
], | |
"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.12" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 2 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment