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

Breakpointing at the D=D line and inspecting D gives:

0_2010-11-22 00:00:00+00:00: 120.15  
1_2010-11-23 00:00:00+00:00: 118.42  
2_2010-11-24 00:00:00+00:00: 120.18  
3_2010-11-26 00:00:00+00:00: 118.42  
4_2010-11-29 00:00:00+00:00: 120.15  
5_2010-11-30 00:00:00+00:00: 118.42  
6_2010-12-01 00:00:00+00:00: 120.18  
7_2010-12-02 00:00:00+00:00: 118.42  
8_2010-12-03 00:00:00+00:00: 120.15  
9_2010-12-06 00:00:00+00:00: 118.42  
10_2010-12-07 00:00:00+00:00: 120.18  
11_2010-12-08 00:00:00+00:00: 118.42  
12_2010-12-09 00:00:00+00:00: 120.15  
(etc)

which doesn't seem right to me?

12 responses

What's not correct? --Grant

The values repeat:

120.15, 118.42, 120.18, 118.42 again, 120.15 again, 118.42 again, 120.18 again, etc....

Querying individual elements gets different results:

D[0] gives 120.15 (correct)  
D[1] gives 118.42 (correct)  
D[2] gives 120.18 (correct)  
D[3] gives 118.8 (different)  
D[4] gives 119.17 (different)  
D[5] gives 118.45 (different)  
D[6] gives 121.01 (different)  
etc  

Sorry about this, a fix should be available soon. This is an issue with how the data is being displayed in the repl; however, the data is still there. As a temporary workaround, you can coerce the data into a different structure to inspect it. For example, try:

from collections import OrderedDict;OrderedDict(zip(D.index, D.values))  
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 Joe!

Thanks Joe!

Good, good news. We not only fixed this issue but added a new feature to the debugger.

This week we deployed a fix to the debugger that has solved this (and other) problems with the debugger. The values displayed in the debugger output no longer get overwritten by previous values:

"new debugger"

For those not familiar with the debugger, you can set a breakpoint in your algorithm code when working in the IDE by clicking on a line number in the left hand side of the IDE:

"setting breakpoint"

Once you set the breakpoint, you can interactively enter expressions for debugging your algorithm.

We didn't just solve this single bug with this release. We also have introduced a new feature in the debugger -- Watch Expressions:

"watch expressions"

With this new feature, you can save expressions for use in the debugger every time you open the debugger for a particular algorithm. So you no longer have to type the same thing over and over in the debugger.

I know this was a frustrating bug for many -- it came up frequently in the forums. We hope this helps to make you more productive with Quantopian.

All the best,
Josh

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.

The improved display of data structures (and no more need to use "print") is great -- thank you for fixing it. However, I'm seeing the following error when using breakpoints:

TypeError: fmt_breakpoint_dict() takes exactly 3 arguments (2 given)

Here's a simple case that causes the error (in Chrome): In the following code, set a breakpoint on the last line. Press "Build Algorithm." After the algo starts, click on the breakpoint to unset it and cause the error.

def initialize(context):  
    sid(8554)

def handle_data(context, data):  
    foo = 1  

Michael, thanks for the heads up. I wasn't able to reproduce the error, but we'll take a look.

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.

had the same issue, whenever you click on the breakpoint (you set previously) whilst in break it will crash the algo.

Also. Here's another way to try to reproduce that ...

1. Create a new algorithm  
2. Place a breakpoint on the order() line  
3. 'Build Algorithm'  
4. When paused at that breakpoint ...  
5. Click the breakpoint to clear it  

Expect the breakpoint to disappear (no longer set).

Result:
Error. End of test.
TypeError: fmt_breakpoint_dict() takes exactly 3 arguments (2 given) There was a runtime error on line 16.

I was able to reproduce. Thanks folks!

Good now.