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

Python consolidator removal directly from Python #7995

Merged

Conversation

jhonabreul
Copy link
Collaborator

@jhonabreul jhonabreul commented May 3, 2024

Description

Keep cache for python consolidators in the SubscriptionManager to avoid loosing references to the underlying PyObject consolidator instance.

A manual removal of the consolidator from Python, when a custom Python class consolidator or a generic C# one is used, failed because they get wrapped internally in a DataConsolidatorPythonWrapper.

Additional fix: PyObject.TryConvert extension method to succeed for python objects that wrap a C# instance of a generic class.

Related Issue

Closes #7968

Motivation and Context

Requires Documentation Change

How Has This Been Tested?

  • Unit tests
  • Existing PearsonCorrelationPairsTradingAlphaModelFrameworkAlgorithm using the Python PearsonCorrelationPairsTradingAlphaModel

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>

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 work! 👍 shared minor comment in slack

@jhonabreul jhonabreul merged commit bac3ec0 into QuantConnect:master May 6, 2024
7 checks passed
@jhonabreul jhonabreul deleted the bug-7986-maually-removing-indicator branch May 6, 2024 18:44
Martin-Molinero added a commit that referenced this pull request May 9, 2024
Martin-Molinero added a commit that referenced this pull request May 9, 2024
jhonabreul added a commit to jhonabreul/Lean that referenced this pull request May 9, 2024
@jhonabreul jhonabreul mentioned this pull request May 9, 2024
11 tasks
jhonabreul added a commit that referenced this pull request May 9, 2024
* Reapply "Python consolidator removal directly from Python (#7995)" (#8006)

This reverts commit f5f2da3.

* Reapply "Fix: interface property implementation in python models (#7987)" (#8007)

This reverts commit 356b51f.

* Fix: PyObject.TryConvert compares c# and py type by reference
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.

Manually remove identity consolidator
2 participants