Back to Community
Pipeline Tutorial

Today, we published the second Quantopian tutorial: the Pipeline Tutorial. The tutorial will walk you through dynamic security selection using factors, filters, and classifiers in research and the IDE.

Currently, only the written version of the tutorial is available, the video version will be made available at a later date.

Feedback is welcome. If you have any questions/comments, please post them here!


The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.

5 responses

I got an error in the tutorial when I cloned the notebook from Pipeline Tutorial - Lesson 3. Other people also got similar errors, as listed here ( I don't know enough about Python, but could it be that there is an extra comma on line 397 of run_pipeline? Also, I have no idea who should fix this. Thanks for your support.

My code looks like:

def make_pipeline():

  mean_close_10 = SimpleMovingAverage(inputs=[USEquityPricing.close], window_length=10)

  return Pipeline(  
      '10_day_mean_close': mean_close_10  

result = run_pipeline(make_pipeline(), '2015-05-05', '2015-05-05')  

The resulting error looks like:

KeyError Traceback (most recent call last)
in ()
----> 1 result = run_pipeline(make_pipeline(), '2015-05-05', '2015-05-05')
2 result.head()

/build/src/extensions/extensions/ in run_pipeline(pipeline, start_date, end_date) 396 start_date=adjust_date,
397 end_date=adjust_date,
--> 398 )
399 def run_pipeline(pipeline, start_date, end_date):
400 """

/build/src/extensions/extensions/ in run_pipeline(pipeline, start_date, end_date) 404 PipelineEngine.run_pipeline.
405 """
--> 406 return engine.run_pipeline(pipeline, start_date, end_date)
407 return run_pipeline

/build/src/qexec_repo/zipline_repo/zipline/pipeline/engine.pyc in run_pipeline(self, pipeline, start_date, end_date) 171 dates,
172 assets,
--> 173 initial_workspace={self._root_mask_term: root_mask_values},
174 )

/build/src/qexec_repo/zipline_repo/zipline/pipeline/engine.pyc in compute_chunk(self, graph, dates, assets, initial_workspace) 352 loader = get_loader(term)
353 loaded = loader.load_adjusted_array(
--> 354 to_load, mask_dates, assets, mask,
355 )
356 workspace.update(loaded)

/build/src/qexec_repo/zipline_repo/zipline/pipeline/loaders/equity_pricing_loader.pyc in load_adjusted_array(self, columns, dates, assets, mask) 75 start_date,
76 end_date,
---> 77 assets,
78 )
79 adjustments = self.adjustments_loader.load_adjustments(

/build/src/qexec_repo/qexec/sources/resource_proxy.pyc in method(self, args, **kwargs) 134 def method(self, *args, **kwargs):
135 with self.resource as proxied:
--> 136 return getattr(proxied, name)(
args, **kwargs)
137 return method

/build/src/qexec_repo/zipline_repo/zipline/data/us_equity_pricing.pyc in load_raw_arrays(self, columns, start_date, end_date, assets) 560 def load_raw_arrays(self, columns, start_date, end_date, assets):
561 # Assumes that the given dates are actually in calendar.
--> 562 start_idx = self._calendar.get_loc(start_date)
563 end_idx = self._calendar.get_loc(end_date)
564 first_rows, last_rows, offsets = self._compute_slices(

/build/src/qexec_repo/zipline_repo/zipline/utils/memoize.pyc in get(self, instance, owner) 51 return self._cache[instance]
52 except KeyError:
---> 53 self._cache[instance] = val = self._get(instance)
54 return val

/build/src/qexec_repo/zipline_repo/zipline/data/us_equity_pricing.pyc in calendar(self) 472 @lazyval
473 def _calendar(self):
--> 474 return DatetimeIndex(self.
table.attrs['calendar'], tz='UTC')
476 @lazyval

/usr/local/lib/python2.7/dist-packages/bcolz/attrs.pyc in getitem(self, name) 93
94 def getitem(self, name):
---> 95 return self.attrs[name]
97 def setitem(self, name, obj):

KeyError: 'calendar'

Hi Enrique,

We've got to wait till Monday for this to get fixed (its failing on every single tutorial & notebook).
Meanwhile the IDE is still there :)


Hi Enrique, I've notified our engineers, they will look into the issue. Thanks for reporting it.

The issue has been fixed, you should now be able to run the notebooks all the way through. Sorry for the inconvenience.

Thanks for putting this tutorial together. I'm learning a ton and loving it!