PEP8 style algorithm API - #7909
Merged
Martin-Molinero merged 16 commits intoApr 12, 2024
Merged
Conversation
| /// containing the new key-value pair along with the original ones. | ||
| /// We do this in order to avoid the overhead of using locks or concurrent dictionaries and still be thread-safe. | ||
| /// </summary> | ||
| private static Dictionary<string, T> AddToDictionary<T>(Dictionary<string, T> dictionary, string key, T value) |
Martin-Molinero
approved these changes
Apr 11, 2024
Used to cache methods and contains invoke functionality
jhonabreul
force-pushed
the
feature-python-pep-style
branch
from
April 11, 2024 21:19
7eb082c to
cd17661
Compare
Martin-Molinero
approved these changes
Apr 12, 2024
This was referenced Apr 15, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add PEP8 style API for Python algorithms:
QCAlgorithmmethods can be overriden with PEP8 names (snake case) as shown in the added Python algorithms:Initializecan be overriden withinitialize,OnOrderEventcan be overriden withon_order_event, etc.self.Portfolio[self.Securities[self.spy]].HoldingsValuecan be replaced withself.portfolio[self.securities[self.spy]].holdings_value.self.add_equity("SPY", extended_market_hours=True).Resolution.MINUTEorOrderStatus.PARTIALLY_FILLED.Depends on QuantConnect/pythonnet#83 and QuantConnect/pythonnet#84
Related Issue
Motivation and Context
Having PEP8 conforming algorithms.
Users comming from Python would find the API easier to use.
Requires Documentation Change
Document the new API.
How Has This Been Tested?
Types of changes
Checklist:
bug-<issue#>-<description>orfeature-<issue#>-<description>