Skip to content

Conversation

@sm6srw
Copy link
Contributor

@sm6srw sm6srw commented Oct 15, 2018

Purpose

This pull request addresses JIRA task QNTM-5568.

This pull request does

  • format the value string in output nodes using the InvariantCulture format
  • use the InvariantCulture format when converting the value string in input and output nodes to double
  • Added tests for InputData and OutputData
  • Added test for loading and comparing dyn files while being in a different culture.

Declarations

Check these if you believe they are true

  • The code base is in a better state after this PR
  • Is documented according to the standards
  • The level of testing this PR includes is appropriate
  • User facing strings, if any, are extracted into *.resx files
  • All tests pass using the self-service CI.
  • Snapshot of UI changes, if any.
  • Changes to the API follow Semantic Versioning, and are documented in the API Changes document.

Reviewers

@longc @mjkkirschner

FYIs

@mjkkirschner
Copy link
Member

This looks good, do you intend on adding localized tests?
Also will you take advantage of @saintentropy 's new property?

@sm6srw
Copy link
Contributor Author

sm6srw commented Oct 15, 2018

Yes, I can try to add tests for it. Do we have a something similar somewhere?
@saintentropy What new property?

@saintentropy
Copy link
Contributor

He means my #9170

@sm6srw
Copy link
Contributor Author

sm6srw commented Oct 15, 2018

Ah, so that was the spelling thing. I didn't even notice!

@saintentropy
Copy link
Contributor

LGTM @sm6srw

@sm6srw
Copy link
Contributor Author

sm6srw commented Oct 15, 2018

@mjkkirschner I added some tests. PTAL.


[Test]
[Category("RegressionTests")]
public void TestNodeOutputDataInDifferentCulture()
Copy link
Member

Choose a reason for hiding this comment

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

@sm6srw are these node2code tests?

Copy link
Contributor Author

@sm6srw sm6srw Oct 15, 2018

Choose a reason for hiding this comment

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

Well, that's where I found other similar tests. Do you want me to move these somewhere else?

Copy link
Member

Choose a reason for hiding this comment

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

this seems like the wrong location - node2Code has to do with using the node to designscript feature.

I would put this in tests related to inputOutputData etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Make sense, thanks!

serializationTestUtils.SaveWorkspaceComparisonData);

Thread.CurrentThread.CurrentCulture = currentCulture;
Thread.CurrentThread.CurrentUICulture = currentUICulture;
Copy link
Member

Choose a reason for hiding this comment

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

does this actually set the culture back to the correct culture? could we assert it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes it does. But I added some asserts just in case.

Copy link
Member

Choose a reason for hiding this comment

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

I guess I meant does this actually set it back to en-us or something - I might be totally confused but this line var currentCulture = Thread.CurrentThread.CurrentCulture;
looks like it might just make a reference to the current Culture so when you set the culture to the french culture it seems that it would also update.

Is the currentCulture a value type or reference type?

Copy link
Contributor Author

@sm6srw sm6srw Oct 16, 2018

Choose a reason for hiding this comment

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

Yes, it sets it back to what was there before, in our case en-us. It must be value type because the switching works (verified in the debugger).

@sm6srw
Copy link
Contributor Author

sm6srw commented Oct 16, 2018

@mjkkirschner PTAL when you have a moment.

@sm6srw
Copy link
Contributor Author

sm6srw commented Oct 17, 2018

@mjkkirschner PTAFL!

@mjkkirschner
Copy link
Member

mjkkirschner commented Oct 17, 2018 via email

@sm6srw sm6srw merged commit abc6d62 into DynamoDS:master Oct 17, 2018
@sm6srw sm6srw deleted the QNTM-5568 branch October 17, 2018 12:51
saintentropy pushed a commit to saintentropy/Dynamo that referenced this pull request Oct 22, 2018
…, part Deux (DynamoDS#9178)

* Don't culture format value strings.

* Assume value strings are formated with `InvariantCulture`

* Add tests

* More work on tests

* Clarify switching of cultures
saintentropy added a commit that referenced this pull request Oct 24, 2018
* Add RegisterFroTrace attribute as a trigger in Json serialization of trace

* PR comment

* [ 2.0 Release Cut ] Bump Up Master Patch Version (#8647)

* Bump Up Patch Version

* Add version

* Update comments and version baseline

* Address Comments

* CubicMillimeterToCubicMeter conversion

* Revert "CubicMillimeter To CubicMeter conversion"

* Fix the units bug

* Remove thread sleep

* missed the test

* Fix static property compilation and crash (#8649)

* fix crash, compilation of static property

* code cleanup

* add test

* add test graph

* QNTM-3646: Fix creation of unwanted input port for list index-assignment (#8648)

* fix for additional input port

* fixes for output ports

* update tests

* added test, code cleanup

* address review comments

* QNTM-3279: Fix for crash when trying to directly call properties on class name (#8661)


* fix for compiling property method as function pointer

* code cleanup

* add tests

* Cherry-pick #8663  (#8664)

* Update failing tests (#8663)

* update tests

* Merge LibG binaries with Geometry.Approximate API (#8666)

* merge LibG binaries with Geometry.Approximate()

* Update license

* scroll bar fix in incanvas search

* QNTM-3641: Prevent ColorRange node from crashing with old style List syntax (#8670) (#8674)

* fix crash with ColorRange1D node

* add test

* add test
set unsaved changes false when initializing json custom node

* Update changes from librarie.js to fix QNTM-3710 (#8678)

After investigating the errors in the EngOps check it was thought that these changes could not have caused the current failures. Other PRs have also shown the same issues. Given all of that, this PR is being merged.

* address comments

* Update LibG binaries for ASM224 branch (#8681)

* update LibG binaries for ASM224 branch

* PR comment

* QNTM-3841 Add geometry creation option to Dynamo CLI (#8775)

* POC

* Cleanup code.

* Add command line option -g for generating geometry json file.

* Remove filtering

* Fix node state flags at load time.

* Use UpdateValue for setting isVisible on node model. Revert set to private.

* Remove filtering.

* Clean up holder code.

* Cleanup converter code. Use node model defaults as starting point.

* Preload the same libraries for CLI as for Sandbox.

* Add color support

* Simplify json

* Update file format.

* Remove property expressions.

* Restore comment.

* Restore Cef Settings

* Add unit test for CLI geometry option.

* Remove comment.

* Don't extend CommandLineRunner.

* Use var when possible.

* Remove commented out code.

* Use DynamoViewModel in CLI.

* Use DefaultWatch3DViewModel for CLI.

* Add new project DynamoWPFCLI.

* Let CommandLineRunnerWPF inherit from CommandLineRunner.

* Fix review comments.

* Fix unstable unit tests.

* Remove Dispose method.

* Add comments

* Fix type check

* Apply same fix to NodeInputData

* Add serialization tests

* Fix typo in Extansion.

* QNTM-4278 DynamoWPFCLI should use CoGs geometry format (#8887)

* POC

* Cleanup code.

* Add command line option -g for generating geometry json file.

* Remove filtering

* Fix node state flags at load time.

* Use UpdateValue for setting isVisible on node model. Revert set to private.

* Remove filtering.

* Clean up holder code.

* Cleanup converter code. Use node model defaults as starting point.

* Preload the same libraries for CLI as for Sandbox.

* Add color support

* Simplify json

* Update file format.

* Remove property expressions.

* Restore comment.

* Restore Cef Settings

* Add unit test for CLI geometry option.

* Remove comment.

* Don't extend CommandLineRunner.

* Use var when possible.

* Remove commented out code.

* Use DynamoViewModel in CLI.

* Use DefaultWatch3DViewModel for CLI.

* Add new project DynamoWPFCLI.

* Let CommandLineRunnerWPF inherit from CommandLineRunner.

* Fix review comments.

* Fix unstable unit tests.

* Remove Dispose method.

* Add comments

* First pass

* Formatting fixes.

* Remove XML stuff.

* Some final adjustments.

* Add more comments.

* Move comment.

* Only store the geometry array.

* Refactor.

* Add interface

* Make interface internal

* Rename implmentation.

* Allow internal access for CLI

* Move default implementation to core.

* Make setters private

* Address review comments.

* match Revit CEF intitializtion settings

* match Revit CEF intitializtion settings

* match Revit CEF intitializtion settings

* QNTM-5580 - Correct Typo in the Dynamo json serialization to match CoGS API (#9170)

* Fix typo

* Obsolete the existing property

* Update test

* remove expression body syntax

* Add serialization test with typo

* AVP NumberInputNode deserialization

* add testing

* QNTM-5568 Refinery needs to support culture invariance for number fmt, part Deux (#9178)

* Don't culture format value strings.

* Assume value strings are formated with `InvariantCulture`

* Add tests

* More work on tests

* Clarify switching of cultures
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants