Skip to content

QuantConnect Update #1385

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

Closed
wants to merge 34 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
062a0bc
Reflect PR #1 Support for Decimal
C-SELLERS Feb 3, 2021
5ed5a96
Reflect PR#8 MISSING CONVERTER.CS L516-528 Changes
C-SELLERS Feb 3, 2021
9b5445e
Reflect PR #14
C-SELLERS Feb 4, 2021
709643a
Reflect PR #15
C-SELLERS Feb 4, 2021
a481700
Reflect PR #19
C-SELLERS Feb 4, 2021
de0328c
Reflect PR #25
C-SELLERS Feb 4, 2021
481f4d0
Reflect PR #34
C-SELLERS Feb 4, 2021
863530d
Reflect PR #35
C-SELLERS Feb 4, 2021
5839d21
Implement List Conversion, Reflect PR #37 Tests
C-SELLERS Feb 4, 2021
c362816
Reflect PR #38 Partial: Assembly Manager Improvements
C-SELLERS Feb 4, 2021
cde9b51
Reflect PR #38
C-SELLERS Feb 4, 2021
101624e
Reflect PR #42 KeyValuePairEnumerableObject
C-SELLERS Feb 4, 2021
56a4bcf
Reflect PR #10 Runtime DecimalType
C-SELLERS Feb 4, 2021
508db2e
Add TimeDelta and DateTime tests
C-SELLERS Feb 5, 2021
ebbafad
Fix DecimalConversion test for float conversion
C-SELLERS Feb 5, 2021
53375ce
Converter mod tweaks
C-SELLERS Feb 6, 2021
c8fdbcb
Adjust a few broken PyTests
C-SELLERS Feb 6, 2021
af30873
Use _pydecimal to not interfere with Lean/decimal.py
C-SELLERS Feb 9, 2021
bf1755d
Add MethodBinder tests
C-SELLERS Feb 9, 2021
58d5df0
MethodBinder implicit resolution
Martin-Molinero Feb 4, 2021
0c94228
Fix bad cherry pick
C-SELLERS Feb 10, 2021
44e089a
Refactoring precedence resolution
Martin-Molinero Feb 5, 2021
108eacf
Deal with operator binding
C-SELLERS Feb 10, 2021
6379568
Fix `TestNoOverloadException` unit test
C-SELLERS Feb 10, 2021
9f2796a
Fix for DomainReload tests
C-SELLERS Feb 10, 2021
b0aca5c
Add InEquality Operator Test
C-SELLERS Feb 11, 2021
0f5f0ba
Dont PyObjects precedence in Operator methods
C-SELLERS Feb 11, 2021
ed6ab18
Revert "Merge pull request #1240 from danabr/auto-cast-ret-val-to-int…
C-SELLERS Feb 12, 2021
d87584b
Fix Primitive Conversion to Int
C-SELLERS Feb 15, 2021
f59335f
Post rebase fix
C-SELLERS Feb 15, 2021
bd94e49
Add PrimitiveIntConversion test
C-SELLERS Feb 16, 2021
cd06d10
Add test for interface derived classes
C-SELLERS Feb 16, 2021
aeb20c0
Add to Authors.md
C-SELLERS Feb 16, 2021
ae34f30
Load in current directory into Python Path
C-SELLERS Feb 18, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Reflect PR #38
  • Loading branch information
C-SELLERS committed Feb 15, 2021
commit cde9b51cf51e108760e155630865bacb44b952dc
5 changes: 2 additions & 3 deletions src/runtime/classmanager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,8 @@ internal static Dictionary<ManagedType, InterDomainContext> RestoreRuntimeData(R
/// <returns>A Borrowed reference to the ClassBase object</returns>
internal static ClassBase GetClass(Type type)
{
ClassBase cb = null;
cache.TryGetValue(type, out cb);
if (cb != null)
ClassBase cb;
if (cache.TryGetValue(type, out cb))
{
return cb;
}
Expand Down
118 changes: 67 additions & 51 deletions src/runtime/genericutil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,43 +27,51 @@ public static void Reset()
/// <param name="t">A generic type definition (<c>t.IsGenericTypeDefinition</c> must be true)</param>
internal static void Register(Type t)
{
if (null == t.Namespace || null == t.Name)
lock (mapping)
{
return;
}
if (null == t.Namespace || null == t.Name)
{
return;
}

Dictionary<string, List<string>> nsmap;
if (!mapping.TryGetValue(t.Namespace, out nsmap))
{
nsmap = new Dictionary<string, List<string>>();
mapping[t.Namespace] = nsmap;
}
string basename = GetBasename(t.Name);
List<string> gnames;
if (!nsmap.TryGetValue(basename, out gnames))
{
gnames = new List<string>();
nsmap[basename] = gnames;
Dictionary<string, List<string>> nsmap;
if (!mapping.TryGetValue(t.Namespace, out nsmap))
{
nsmap = new Dictionary<string, List<string>>();
mapping[t.Namespace] = nsmap;
}

string basename = GetBasename(t.Name);
List<string> gnames;
if (!nsmap.TryGetValue(basename, out gnames))
{
gnames = new List<string>();
nsmap[basename] = gnames;
}

gnames.Add(t.Name);
}
gnames.Add(t.Name);
}

/// <summary>
/// xxx
/// </summary>
public static List<string> GetGenericBaseNames(string ns)
{
Dictionary<string, List<string>> nsmap;
if (!mapping.TryGetValue(ns, out nsmap))
lock (mapping)
{
return null;
}
var names = new List<string>();
foreach (string key in nsmap.Keys)
{
names.Add(key);
Dictionary<string, List<string>> nsmap;
if (!mapping.TryGetValue(ns, out nsmap))
{
return null;
}
var names = new List<string>();
foreach (string key in nsmap.Keys)
{
names.Add(key);
}
return names;
}
return names;
}

/// <summary>
Expand All @@ -79,47 +87,55 @@ public static Type GenericForType(Type t, int paramCount)
/// </summary>
public static Type GenericByName(string ns, string basename, int paramCount)
{
Dictionary<string, List<string>> nsmap;
if (!mapping.TryGetValue(ns, out nsmap))
lock (mapping)
{
return null;
}
Dictionary<string, List<string>> nsmap;
if (!mapping.TryGetValue(ns, out nsmap))
{
return null;
}

List<string> names;
if (!nsmap.TryGetValue(GetBasename(basename), out names))
{
return null;
}
List<string> names;
if (!nsmap.TryGetValue(GetBasename(basename), out names))
{
return null;
}

foreach (string name in names)
{
string qname = ns + "." + name;
Type o = AssemblyManager.LookupTypes(qname).FirstOrDefault();
if (o != null && o.GetGenericArguments().Length == paramCount)
foreach (string name in names)
{
return o;
string qname = ns + "." + name;
Type o = AssemblyManager.LookupTypes(qname).FirstOrDefault();
if (o != null && o.GetGenericArguments().Length == paramCount)
{
return o;
}
}
}

return null;
return null;
}
}

/// <summary>
/// xxx
/// </summary>
public static string GenericNameForBaseName(string ns, string name)
{
Dictionary<string, List<string>> nsmap;
if (!mapping.TryGetValue(ns, out nsmap))
lock (mapping)
{
return null;
}
List<string> gnames;
nsmap.TryGetValue(name, out gnames);
if (gnames?.Count > 0)
{
return gnames[0];
Dictionary<string, List<string>> nsmap;
if (!mapping.TryGetValue(ns, out nsmap))
{
return null;
}

List<string> gnames;
nsmap.TryGetValue(name, out gnames);
if (gnames?.Count > 0)
{
return gnames[0];
}
}

return null;
}

Expand Down