Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
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
2 changes: 1 addition & 1 deletion src/DynamoCore/DynamoCore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<PackageReference Include="Lucene.Net" Version="4.8.0-beta00016" />
<PackageReference Include="Lucene.Net.Analysis.Common" Version="4.8.0-beta00016" />
<PackageReference Include="Lucene.Net.QueryParser" Version="4.8.0-beta00016" />
<PackageReference Include="DynamoVisualProgramming.PythonEngine.PythonNet3" Version="1.4.5" GeneratePathProperty="true" ExcludeAssets="all" />
<PackageReference Include="DynamoVisualProgramming.PythonEngine.PythonNet3" Version="1.4.6" GeneratePathProperty="true" ExcludeAssets="all" />
<PackageReference Include="DynamoVisualProgramming.Analytics" Version="4.2.3.10496" />
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="DiffPlex" Version="1.6.3" CopyMetaData="true" />
<PackageReference Include="DynamoVisualProgramming.PythonEngine.PythonNet3" Version="1.4.5">
<PackageReference Include="DynamoVisualProgramming.PythonEngine.PythonNet3" Version="1.4.6">
<ExcludeAssets>runtime;native;contentFiles;build;buildTransitive;analyzers</ExcludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion test/Libraries/DynamoPythonTests/DynamoPythonTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<PackageReference Include="DynamicLanguageRuntime" Version="1.2.2" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
<PackageReference Include="DynamoVisualProgramming.PythonEngine.PythonNet3" Version="1.4.5">
<PackageReference Include="DynamoVisualProgramming.PythonEngine.PythonNet3" Version="1.4.6">
<ExcludeAssets>runtime;native;contentFiles;build;buildTransitive;analyzers</ExcludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
53 changes: 46 additions & 7 deletions test/Libraries/DynamoPythonTests/PythonEvalTestsWithLibraries.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,7 @@ from FFITarget import DummyMath
}
}

/// <summary>
/// PythonNet3 vs DesignScript list interop issue:
/// DSCore list ops expect DS lists; PythonNet passes .NET lists, causing wrong overloads/comparers.
/// Quarantined until parity fix.
/// </summary>
[Test]
[Category("Failure")]
[Category("TechDebt")]
public void TestListDecoding()
{
string code = @"
Expand Down Expand Up @@ -344,6 +337,52 @@ import DSCore
}
}

[Test]
public void TryDecode_ConvertsNestedPythonListsToClrLists()
Comment on lines +340 to +341
Copy link

Copilot AI Dec 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding a test case that verifies the behavior when List.Flatten is called with different depth parameters (e.g., 0, 1) to ensure the fix handles various flattening levels correctly, not just the complete flatten with -1.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now addressed

{
string code = @"
import clr
clr.AddReference('DSCoreNodes')
from DSCore import List

data = [[[1, 2], [3]], [[4, 5], [6]]]
OUT = data, List.Flatten(data, 1), List.Flatten(data, 2), List.Flatten(data)
";
var emptyInputs = new ArrayList();
var expected = new ArrayList
{
new ArrayList
{
new ArrayList
{
new ArrayList { 1, 2 },
new ArrayList { 3 }
},
new ArrayList
{
new ArrayList { 4, 5 },
new ArrayList { 6 }
}
},
new ArrayList
{
new ArrayList { 1, 2 },
new ArrayList { 3 },
new ArrayList { 4, 5 },
new ArrayList { 6 }
},
new ArrayList { 1, 2, 3, 4, 5, 6 },
new ArrayList { 1, 2, 3, 4, 5, 6 }
};

foreach (var pythonEvaluator in Evaluators)
{
var result = pythonEvaluator(code, emptyInputs, emptyInputs);
Assert.That(result, Is.InstanceOf<IEnumerable>());
CollectionAssert.AreEqual(expected, result as IEnumerable);
}
}

private void DictionaryAssert(IDictionary expected, IDictionary actual)
{
Assert.AreEqual(expected.Count, actual.Count);
Expand Down
Loading