Lean icon indicating copy to clipboard operation
Lean copied to clipboard

Adds Custom ToString Method to API Classes

Open AlexCatarino opened this issue 4 years ago • 4 comments

Expected Behavior

Be able to visualize the results from API calls with ToString method. It's particularly helpful in Jupyter Notebooks.

Actual Behavior

The string representation looks like this:

<QuantConnect.Api.Compile object at 0x7f7082330978>

Potential Solution

Implement Custom ToString

Checklist

  • [x] I have completely filled out this template
  • [x] I have confirmed that this issue exists on the current master branch
  • [x] I have confirmed that this is not a duplicate issue by searching issues

AlexCatarino avatar Mar 12 '21 01:03 AlexCatarino

Hi, can I take it ?

MaxTube-dot avatar Sep 11 '22 14:09 MaxTube-dot

Hey @MaxTube-dot! yes please go ahead, suggest just implementing one at the time with it's unit test 👍

Martin-Molinero avatar Sep 13 '22 13:09 Martin-Molinero

Hi @AlexCatarino, do you mean ToString Method should be added to this document below? https://github.com/QuantConnect/Lean/blob/master/Api/Api.cs What steps did you go through to get the message <QuantConnect.Api.Compile object at 0x7f7082330978>

jfweonc avatar Feb 06 '23 06:02 jfweonc

Hey @jfweonc! The ToString methods should be added for the objects returned by the Api methods, can see them at https://github.com/QuantConnect/Lean/tree/master/Common/Api. Suggest taking them one at the time.

What steps did you go through to get the message <QuantConnect.Api.Compile object at 0x7f7082330978>

This is just the default to string implementation that python takes from a C# class. If ToString was implemented it would use it instead

Martin-Molinero avatar Feb 16 '23 20:02 Martin-Molinero