Skip to content

Commit

Permalink
review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mjkkirschner committed Nov 11, 2024
1 parent 0e73d61 commit e3d33e8
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ format specifiers should be in the form:
Some commonly used format specifiers are:
```
G : general formatting G 1000.0 -> "1000"
F : fixed point notation F4 1000.0 -> "1.0000"
N : number N 1.0 -> 1000 -> "1,000.00"
F : fixed point notation F4 1000.0 -> "1000.0000"
N : number N2 1000 -> "1,000.00"
```

The default for this node is `G`, which will output a compact, but variable representation.

[see the microsoft documentation for more detailed information.](https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-numeric-format-strings#standard-format-specifiers)
[see the microsoft documentation for more detailed information.](https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-numeric-format-strings#standard-format-specifiers)
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ format specifiers should be in the form:
Some commonly used format specifiers are:
```
G : general formatting G 1000.0 -> "1000"
F : fixed point notation F4 1000.0 -> "1.0000"
N : number N 1.0 -> 1000 -> "1,000.00"
F : fixed point notation F4 1000.0 -> "1000.0000"
N : number N2 1000 -> "1,000.00"
```

The default for this node is `G`, which will output a compact, but variable representation.

[see the microsoft documentation for more detailed information.](https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-numeric-format-strings#standard-format-specifiers)
[see the microsoft documentation for more detailed information.](https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-numeric-format-strings#standard-format-specifiers)
2 changes: 0 additions & 2 deletions src/DynamoCore/Configuration/PreferenceSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,6 @@ private readonly static Lazy<PreferenceSettings>

internal static readonly IEnumerable<string> InitialExperimentalLib_Namespaces =
[
//TODO remove tsplines - it's no longer experimental.
"ProtoGeometry.dll:Autodesk.DesignScript.Geometry.TSpline",
"ProtoGeometry.dll:Autodesk.DesignScript.Geometry.PanelSurface"
];
#endregion
Expand Down
2 changes: 1 addition & 1 deletion src/DynamoCore/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/DynamoCore/Properties/Resources.en-US.resx
Original file line number Diff line number Diff line change
Expand Up @@ -921,6 +921,6 @@ This package likely contains an assembly that is blocked. You will need to load
<value>default input name, rename me!</value>
</data>
<data name="DocsExperimentalPrefixMessage" xml:space="preserve">
<value>This node is marked experimental, its behavior, name, and signature may change!</value>
<value>This node is currently experimental. Its behavior, name, and signature are subject to change.</value>
</data>
</root>
2 changes: 1 addition & 1 deletion src/DynamoCore/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -924,6 +924,6 @@ This package likely contains an assembly that is blocked. You will need to load
<value>default input name, rename me!</value>
</data>
<data name="DocsExperimentalPrefixMessage" xml:space="preserve">
<value>This node is marked experimental, its behavior, name, and signature may change!</value>
<value>This node is currently experimental. Its behavior, name, and signature are subject to change.</value>
</data>
</root>
9 changes: 6 additions & 3 deletions src/DynamoCoreWpf/Views/Core/NodeView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -456,10 +456,13 @@
<fa:ImageAwesome Icon="Solid_Flask"
Width="16px"
Height="16px"
Foreground="{StaticResource Green300Brush}"
Foreground="{StaticResource Blue400Brush}"
VerticalAlignment="Center"
HorizontalAlignment="Center"
ToolTip="{x:Static dp:Resources.DocsExperimentalPrefixMessage}"/>
HorizontalAlignment="Center">
<fa:ImageAwesome.ToolTip>
<ToolTip Content="{x:Static dp:Resources.DocsExperimentalPrefixMessage}" Style="{StaticResource GenericToolTipLight}"/>
</fa:ImageAwesome.ToolTip>
</fa:ImageAwesome>
</Grid>
<Grid x:Name="FrozenGlyph"
Visibility="{Binding Path=IsFrozen, Converter={StaticResource BooleanToVisibilityCollapsedConverter}, Mode=OneWay}">
Expand Down
4 changes: 2 additions & 2 deletions src/Engine/ProtoCore/DSASM/Mirror/ExecutionMirror.cs
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ private string GetStringValueImplementation(StackValue val, string formatSpecifi
return "null"; // "Value not yet supported for tracing";
}

//TODO - use format specifier when converting to string
//obsolete this method and introduce another.
//TODO - use format specifier when converting classes to string
[Obsolete("This will be made internal")]
public string GetClassTrace(StackValue val, Heap heap, int langblock, bool forPrint)
{
if (!formatParams.ContinueOutputTrace())
Expand Down
2 changes: 1 addition & 1 deletion src/Libraries/CoreNodeModels/String.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,14 @@ private FormattedStringFromObject(IEnumerable<PortModel> inPorts, IEnumerable<Po
public FormattedStringFromObject() : base("__ToStringFromObjectAndFormat")
{
ArgumentLacing = LacingStrategy.Disabled;
RegisterAllPorts();
//TODO figure out how to add an inportDefaultValue attribute.
//it's not straightforward because ideally we'd have accesss to the parser.
if (InPorts?.Count() > 1)
{
InPorts.ElementAt(1).DefaultValue = AstFactory.BuildStringNode("G");
InPorts.ElementAt(1).UsingDefaultValue = true;
}
RegisterAllPorts();
}
}

Expand Down
14 changes: 11 additions & 3 deletions test/DynamoCoreTests/Nodes/StringTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -921,14 +921,22 @@ public void TestStringFromArrayWithFormat()
[Test]
public void StringFormatNodesAreCurrentlyExperimental()
{
#pragma warning disable NEWNODE_FormattedStringFromObject
#pragma warning disable NM_ISEXPERIMENTAL_GLPYH
#pragma warning disable NEWNODE_FormattedStringFromObject
#pragma warning disable NEWNODE_FormattedStringFromArray

#pragma warning disable NM_ISEXPERIMENTAL_GLPYH

var formatString = new FormattedStringFromObject();
var formatStringArr = new FormattedStringFromArray();
Assert.AreEqual(true,formatString.IsExperimental);
Assert.AreEqual(true, formatStringArr.IsExperimental);
Assert.IsTrue(formatString.InPorts[1].DefaultValue.Kind == ProtoCore.AST.AssociativeAST.AstKind.String && formatString.InPorts[1].UsingDefaultValue == true);
Assert.IsTrue(formatStringArr.InPorts[1].DefaultValue.Kind == ProtoCore.AST.AssociativeAST.AstKind.String && formatStringArr.InPorts[1].UsingDefaultValue == true);

#pragma warning restore NM_ISEXPERIMENTAL_GLPYH
#pragma warning restore NM_ISEXPERIMENTAL_GLPYH
#pragma warning restore NEWNODE_FormattedStringFromObject
#pragma warning restore NEWNODE_FormattedStringFromArray


}
#endregion
Expand Down

0 comments on commit e3d33e8

Please sign in to comment.