Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Research notebook does nothing, maybe its crashing?

I'm trying to run this notebook and it just nothing after a while. If i change the dates to a smaller time window it doesn't crash. I've previously run over larger time frames with other notebooks without any issue.

Any ideas?

4 responses

One 'best practice' when creating notebooks is to 'chunk' the code into multiple cells. One can then run each cell individually and be able to better see which parts of the code are taking the most time and memory. I've separated the notebook into cells and it definitely seems the last line al.tears.create_returns_tear_sheet(merged_data, long_short=False) takes the majority of time.

When running a keep an eye on two things. First, the Research Memory: field in the middle of the top toolbar. That is the total memory used across all open notebooks. Problems happen if that get's above 100%. Maybe close any other open notebooks. Ensure it's close to zero when starting up if you are having problems. Second, look for the small circle towards the right side of the top toolbar. That will be solid filled when the kernel is working. It will be a circle when it's not. Often if the kernel is busy it's just taking a long time.

That said, I was able to run the notebook multiple times without crashing. Run this version and see if you are still having issues.

Disclaimer

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.

Thanks Dan, my original notebook did have the cells chunked, the cell which had the pipeline was crashing. Your second recommendation fixed my issue by closing down other notebooks.
Thanks for your help and quick reply!

@Kaya I'm glad that shutting down some notebooks did the trick.

I'm the worst for creating a notebook then closing the browser tab but not actually shutting down the notebook. I'll end up with a dozen running notebooks hanging out there which I'm not actually using. All consuming a part of my available memory. A good habit is to look at one's notebook list from time to time and shut things down if not needed. A word of caution. While notebooks generally continue to run in the background, they do get shutdown from time to time by Quantopian when we do an update to the research environment. Don't assume they will always up.

Good luck.

@Dan Whitnable, I have some factor to calculate which cost a lot of time(almost one day), so I close the browser, return back after one day. then I found the notebook is shutdown.
Is there any other way to do this?