If any request returns `{'success': False}` or throws an exception, `Api.Execute` will not exit the execution, will log and return the result. This change will enable re-try logic.
- Refactor to simplify `quantconnect.api.Api` class. Adds `Execute` method that accepts a bolean to distinguish a `POST` from a `GET` request.
In the previous version, some methods were using the `params` argument instead of `data` in the `POST` case which threw an exception for big json objects.
- Adds option to save logs and backtest report to disk.
- Adds `Result` class to optionally convert the json objects into `pandas.DataFrame` when getting backtest or live results
- Subversion bump
Discrepencies were being noted between the plotted asset holdings and the actual holdings weights. Additionally, the plot was changing between HTML renderings using the same backtest data.
Updated the monthly returns matrix text labeling. Force the top row of labels to align bottom and the bottom row of labels to align top. As originally done, the local report created was fine but the report in the cloud still have overlapping label/axis issues. This fixes that problem.
Add try-except controls to ensure successful report creation when backtest result is incomplete. Prevents issues popping up with None types for Total Performance and Portfolio Statistics.
Passing chunk_size=None to iter_content() works fine for chunk-encoded
responses, but still leaves us buffering the entire response when the
server just specifies a Content-Length.
Now, stream the response 256k at a time.
Why 256k? It's large enough that you won't be in a tight loop doing tiny
reads, but small enough that it shouldn't be any great memory concern.
If anyone finds that it's problematic, they can always monkey-patch
quantconnect.api.DOWNLOAD_CHUNK_SIZE.
Previously, the entire response would be read and buffered in memory
before any of it was written to disk.
Now, stream the response and write down data as it's received.
Adds Lean Symbol object decoder. Given a string with ticker + security ID, returns some of the security properties (market, security type, etc)
Closes#2909
Some users have the Symbol string object but don't know what the ID means. This python class can be used to translate the ID.
Added unit test.