Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Bug in Pipeline

The documentation of Qs Pipeline states that first the screen will be applied and after that all columns will be calculated.

I'm just working on own custom factor and saw a different behavior. In my test notebook you can see, that I defined a custom US-universe. This basicly takes the definition of Q500US and returns the first two (Q2US?).

This suggest, that any custom factor will get an input for only these two securities. However, the in the notebook it gets an input which contains all securities (8204 for the chosen date) for window_length=10.

Can someone confirm this? Or am I doing something horrible wrong?

2 responses

If you want to constrain the inputs passed to the compute function you need to initialize the factor with a 'mask' via the mask argument. Changing your example to something like below should give you what you were expecting to see. Hope this helps

universe = US()  
test_factor = testFactor(mask=universe)

pipeline = Pipeline(  
    columns={'close': test_factor},  

# run pipeline  
result = run_pipeline(pipeline, '2015-01-01', '2015-01-01')  
print 'Shape of results:'  
print result.shape  

Hi, thank you for your answer. It worked just fine. Could you explain, why this behavoir was chosen? It is somewhat counter-intuitive to screen every factor and the pipeline too?