Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save chambbj/5a305b98ceb5aa7e59b114f7382ae26a to your computer and use it in GitHub Desktop.
Save chambbj/5a305b98ceb5aa7e59b114f7382ae26a to your computer and use it in GitHub Desktop.
Validating & Executing the Pipeline
Display the source blob
Display the rendered blob
Raw
{
"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