-
Notifications
You must be signed in to change notification settings - Fork 29
Migrate pythonnet to .NET Core 3.0 #33
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
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
@@ -22,10 +22,10 @@ | |||
# Allow config/verbosity to be set from cli | |||
# 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reset verbosity back to "minimal"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see a good reason to change it.
@@ -0,0 +1,11 @@ | |||
<Project Sdk="Microsoft.NET.Sdk"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file might not be needed
Closed in favor of #47 |
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.
AUTHORS
CHANGELOG