Migrate pythonnet to .NET Core 3.0#33
Closed
gsalaz98 wants to merge 92 commits intoQuantConnect:masterfrom
Closed
Conversation
Convertes System.Decimal to decimal.decimal and vice-versa
Converts System.DateTime and System.TimeSpan to datetime.datetime and datetime.timedelta and vice-versa
DECREF'ing datetime timezone argument when DateTimeKind is Unspecified was causing `Fatal Python error: deallocating None` because the object was set to `Runtime.PyNone`. Fixed the input to datetime constructor as we were passing milliseconds, where it should be microseconds.
…-none-datetime-timezone Do not include timezone if DateTimeKind is Unspecified
…sioning Sets the version to 1.0.5.12 to match QuantConnect's nuget one.
- C# decimal conversion will use C# double and python float due to the big performance impact of converting C# decimal to python decimal.
…ean-2825-decimal-csharp-to-python-float C# decimal to Python conversion
Convertes System.Decimal to decimal.decimal and vice-versa
Converts System.DateTime and System.TimeSpan to datetime.datetime and datetime.timedelta and vice-versa
DECREF'ing datetime timezone argument when DateTimeKind is Unspecified was causing `Fatal Python error: deallocating None` because the object was set to `Runtime.PyNone`. Fixed the input to datetime constructor as we were passing milliseconds, where it should be microseconds.
- C# decimal conversion will use C# double and python float due to the big performance impact of converting C# decimal to python decimal.
Rebase to pythonnet master
Revert "Rebase to pythonnet master"
- Increasing minor version to 14 - Adding `UnsafeDispose()` for `PyObject` which does not require acquiring/releasing the lock - Adding check before calling `SetArgsAndCause` for the `ClrObject`, the call only makes sense when we are an exception and causes an overhead
…mprovements-dispose-clrobject Performance improvements ClrObject - Dispose PyObj
…finalizer-v2 Fix memory leak finalizer
…when-shutting-down Fix deadlock when shuting down
This addresses the following scenario: 1. A C# object `a` is created and filled with some data. 2. `a` is passed via Python.NET to Python. To do that Python.NET creates a wrapper object `w`, and stores reference to `a` in one of its fields. 3. Python code later passes `w` back to C#, e.g. calls `SomeCSharpMethod(w)`. 4. Python.NET has to unwrap `w`, so it reads the reference to `a` from it. Prior to this change in 4. Python.NET had to determine what kind of an object `a` is. If it is an exception, a different offset needed to be used. That check was very expensive (up to 4 calls into Python interpreter). This change replaces that check with computing offset unconditionally by subtracting a constant from the object size (which is read from the wrapper), thus avoiding calls to Python interpreter.
Improve Python.NET interop performance
Can load .NET Core into python Pass clr PyObject back to Python
gsalaz98
commented
Jul 8, 2019
Author
gsalaz98
left a comment
There was a problem hiding this comment.
Just an initial review. Expect more to come in the future
| return; | ||
| } | ||
|
|
||
| if (!GetClrFilesAbsolutePath(pn_args->entry_path, "/home/gerry/dotnet/shared/Microsoft.NETCore.App/2.0.0", &pn_args->clr_path)) |
Author
There was a problem hiding this comment.
We need to figure out a way to remove the hard coded path from here. I believe that we can pass NULL as the parameter value and it'll try to determine the path automatically.
| # http://stackoverflow.com/a/4792601/5208670 | ||
| CONFIG = "Release" # Release or Debug | ||
| VERBOSITY = "minimal" # quiet, minimal, normal, detailed, diagnostic | ||
| VERBOSITY = "normal" # quiet, minimal, normal, detailed, diagnostic |
Author
There was a problem hiding this comment.
Reset verbosity back to "minimal"?
Member
There was a problem hiding this comment.
I don't see a good reason to change it.
| @@ -0,0 +1,11 @@ | |||
| <Project Sdk="Microsoft.NET.Sdk"> | |||
Member
|
Closed in favor of #47 |
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.
What does this implement/fix? Explain your changes.
Migrates and adds support for .NET Core 3.0 for pythonnet. This is required for python algorithms to run in LEAN .NET Core
Does this close any currently open issues?
No
Any other comments?
I believe this might break backwards compatibility with .NET Framework 4.5.2 -- which is what LEAN currently runs on. Will have to do some testing for that.
Checklist
Check all those that are applicable and complete.
AUTHORSCHANGELOG