Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 4487 Get Fundamental for CSharp #4703

Merged

Conversation

C-SELLERS
Copy link
Contributor

@C-SELLERS C-SELLERS commented Sep 9, 2020

Description

Adding an additional overload for using GetFundamental() in C# notebooks. This also led to a refactor of Pythons GetFundamental so they could share the same base functions. I was able to maintain the original functionality for Python DataFrames as well, so the return type for calls from Python will still be a pandas dataframe

Changes:

  • C# GetFundmental() that returns IEnumerable of DataDictionaries (A dictionary for each day)
  • Multiple overloads for input types (String, Strings, Symbol, Symbols) Python too!
  • GetAllFundamentals helper function that utilizes FineFundamentalSubscriptionEnumerator
  • Parallel processing of Data Requests
  • Option for full fundamental data obj (no selector, C# only!)
  • Pythons retrieval of Fundamental data is now shared with C# counterpart, reference private function GetAllFundamentals
  • New PythonUtil function ConvertToSymbols which attempts to convert a given python input into a list of symbols.

Performance:

-Year long request of data for ["AAPL","AIG","BAC","GOOG","IBM"] in the cloud
Master v9303: 18.769 Seconds
This PR: 7.077

-5 Year long request of data for ["AAPL","AIG","BAC","GOOG","IBM"] in the cloud
Master v9303: 53.204 Seconds
This PR: 23.677

Related Issue

closes #4487

Motivation and Context

There was no usable GetFundamental function in C#

Requires Documentation Change

None

How Has This Been Tested?

Lots of Unit tests for all types of requests.

Also try using these notebooks with the branch to see how it operates
FundamentalsNotebookTests.zip

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • Refactor (non-breaking change which improves implementation)
  • Performance (non-breaking change which improves performance. Please add associated performance test and results)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Non-functional change (xml comments/documentation/etc)

Checklist:

  • My code follows the code style of this project.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • My branch follows the naming convention bug-<issue#>-<description> or feature-<issue#>-<description>

@C-SELLERS C-SELLERS changed the title Bug 4487 Get Fundamental fpr csharp Bug 4487 Get Fundamental for CSharp Sep 9, 2020
@C-SELLERS C-SELLERS marked this pull request as ready for review September 11, 2020 20:46
Copy link
Member

@Martin-Molinero Martin-Molinero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Almost there, some final tweaks and we should be good to go

Research/QuantBook.cs Outdated Show resolved Hide resolved
Research/QuantBook.cs Show resolved Hide resolved
Research/QuantBook.cs Outdated Show resolved Hide resolved
Research/QuantBook.cs Outdated Show resolved Hide resolved
Research/QuantBook.cs Outdated Show resolved Hide resolved
Research/QuantBook.cs Outdated Show resolved Hide resolved
Research/QuantBook.cs Outdated Show resolved Hide resolved
Tests/Research/QuantBookFundamentalTests.cs Show resolved Hide resolved
Tests/Research/QuantBookFundamentalTests.cs Outdated Show resolved Hide resolved
Copy link
Member

@Martin-Molinero Martin-Molinero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor final tweaks! 👍

Research/readme.md Outdated Show resolved Hide resolved
Research/QuantBook.cs Outdated Show resolved Hide resolved
Research/QuantBook.cs Show resolved Hide resolved
Common/Util/PythonUtil.cs Outdated Show resolved Hide resolved
Copy link
Member

@Martin-Molinero Martin-Molinero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweet! nice performance improvement too 🎉

@Martin-Molinero Martin-Molinero merged commit b8033c4 into QuantConnect:master Sep 16, 2020
@C-SELLERS C-SELLERS deleted the bug-4487-get-fundamental-csharp branch July 29, 2021 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement New Overload For QuantBook.GetFundamental that Returns C# Object
2 participants