-
Notifications
You must be signed in to change notification settings - Fork 665
Add marshaling between Dynamo and Python dictionaries #9296
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
| dict.Cast<dynamic>().ToDictionary(x => Marshal(x.Key), x => Marshal(x.Value))); | ||
| { | ||
| // Dictionary<TKey, TValue> and IronPython.Runtime.PythonDictionary both implement IDictionary | ||
| return dict.Keys.Cast<object>().ToDictionary(key => Marshal(key), key => Marshal(dict[key])); |
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.
does this work nicely for nested dictionaries?
|
@aparajit-pratap looks good |
|
@mjkkirschner seems to work for lists and nested dictionaries. |
|
@aparajit-pratap Awesome LGTM! Let me know if you need any sample graphs for testing, these might be useful. |
| if (val.GetType().IsValueType) | ||
| { | ||
| Assert.AreEqual(val, thisData.ValueAtKey(strKey)); | ||
| } |
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.
Added support to compare Dictionaries directly to test API: AssertValue
|
LGTM |
Purpose
Add Dynamo Dictionary <-> Python Dictionary marshaling support.
JIRA: https://jira.autodesk.com/browse/QNTM-2990
Declarations
Check these if you believe they are true
*.resxfilesI've yet to add tests and run self-service - WIP
Reviewers
@alfarok
@mjkkirschner