Skip to content

Commit

Permalink
Dynamo core annotations 1-10 (#11103)
Browse files Browse the repository at this point in the history
* String from Object Annotations Update

**NODE:  String from Object**
-CHANGES: Rename str to string, obj to object,  Output description: String representation of the object.
-NOT APPLICABLE: Name has spaces, does not have DS Syntax
-FUTURE EDITS: Retain Existing -> Pending explanation from Sol

* String from Array Annotations Update

**NODE:  String from Array**
-CHANGES: Rename str to string, arr to array
-NOT APPLICABLE: Name has spaces, does not have DS Syntax
-FUTURE EDITS:  Retain Existing -> Pending explanation from Sol

* Function.Apply Annotations Update

**NODE:  Function Apply**
-CHANGES: Rename func to function, arg1 to argument1 func(args) to result,
Description:  Returns the result of a function with supplied arguments. Ex: arguments of a point and vector are applied to a translate function returning a translated point.
-NOT APPLICABLE: Name has spaces, does not have DS Syntax, items is not zero indexed, doesnt pass object-type

* Function Compose Annotation Update

**NODE:  Function Compose**
-CHANGES: Rename func0 to function0, fun to function
Description:  Returns a single function from multiple functions. Ex: the modulus and divide functions are composed into a single function to apply to a list.
-NOT APPLICABLE: Name has spaces, does not have DS Syntax

* List.LaceShortest List.LaceLongest List.Combine Annotation Update

**NODES: List.LaceShortest List.LaceLongest List.Combine**
-CHANGES: Rename comb to combinator, list1 to list0, combined to list
Input Description: function to use as combinator

* List.GroupByFunction Annotation Update

**NODE: List.GroupByFunction**
-CHANGES: Rename func to groupFunction, var[]..[] to list
Description:   Returns a new list grouped by a function.
Description Inputs:
groupFunction = function for grouping list
groupedList = Grouped list

* Using appropiate tooltip for Object to String description

Tooltip FormulaPortDataResultToolTip was being used for String from Object output description

* Function Apply index to 0

All indexes should start at 0

* List.GroupByFunction search update

Eliminate groupByfunction search option as it is name of node and is not needed for search.

* List.GroupByFunction Update output description

List.GroupByFunction output description updated to reflect type:
type: var[]..[] (list of arbitrary rank/levels)

* List.LaceShortest, List.LaceLongest, List.Combine, List.CartesionProduct update input name

combinator -> combineFunction

* List.GroupByFunction update output description

>type: var[]..[] (list of arbitrary rank/levels)
to
List of arbitrary rank/levels (type: var[]..[])
  • Loading branch information
martinstacey authored Oct 6, 2020
1 parent 5c37318 commit 3e50feb
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 30 deletions.
3 changes: 2 additions & 1 deletion src/DynamoCore/BuiltInAndOperators/BuiltIn.xml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@
<member name="List.GroupByFunction">
<summary>Use a function to determine how list items should be grouped.</summary>
<param name="list">list of values</param>
<param name="function"></param>
<param name="groupFunction">Function to group list</param>
<returns name="groupedList">List of arbitrary rank/levels (type: var[]..[])</returns>
<search>group,function</search>
</member>
<member name="List.TrueForAll">
Expand Down
4 changes: 2 additions & 2 deletions src/Engine/ProtoCore/ExtendedLibraries/BuiltIn.ds
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ class List extends DSCore.List
return __Equals(objectA, objectB);
}

public static def GroupByFunction(list: var[]..[], func: Function)
public static def GroupByFunction(list: var[]..[], groupFunction: Function)
{
return __GroupByFunction(list, func);
return __GroupByFunction(list, groupFunction);
}

public static def SortByFunction(list: var[]..[], sortFunction: Function)
Expand Down
18 changes: 9 additions & 9 deletions src/Libraries/CoreNodeModels/HigherOrder/Apply.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,26 @@ private ApplyFunction(IEnumerable<PortModel> inPorts, IEnumerable<PortModel> out

public ApplyFunction() : base()
{
InPorts.Add(new PortModel(PortType.Input, this, new PortData("func", Resources.ApplyPortDataFuncToolTip)));
OutPorts.Add(new PortModel(PortType.Output, this, new PortData("func(args)", Resources.ApplyPortDataFuncArgToolTip)));
InPorts.Add(new PortModel(PortType.Input, this, new PortData("function", Resources.ApplyPortDataFuncToolTip)));
OutPorts.Add(new PortModel(PortType.Output, this, new PortData("result", Resources.ApplyPortDataFuncArgToolTip)));
AddInput();
RegisterAllPorts();
}

protected override string GetInputName(int index)
{
if (index == 0)
return "func";
return "function";

return "arg" + index;
return "argument" + (index-1);
}

protected override string GetInputTooltip(int index)
{
if (index == 0)
return "Function to apply.";

return "Argument #" + index;
return "Argument #" + (index-1);
}

protected override void RemoveInput()
Expand Down Expand Up @@ -85,15 +85,15 @@ private ComposeFunctions(IEnumerable<PortModel> inPorts, IEnumerable<PortModel>

public ComposeFunctions()
{
InPorts.Add(new PortModel(PortType.Input, this, new PortData("func0", Resources.ComposePortDataFunc0ToolTip)));
InPorts.Add(new PortModel(PortType.Input, this, new PortData("func1", Resources.ComposePortDataFunc1ToolTip)));
OutPorts.Add(new PortModel(PortType.Output, this, new PortData("func", Resources.ComposePortDataResultToolTip)));
InPorts.Add(new PortModel(PortType.Input, this, new PortData("function0", Resources.ComposePortDataFunc0ToolTip)));
InPorts.Add(new PortModel(PortType.Input, this, new PortData("function1", Resources.ComposePortDataFunc1ToolTip)));
OutPorts.Add(new PortModel(PortType.Output, this, new PortData("function", Resources.ComposePortDataResultToolTip)));
RegisterAllPorts();
}

protected override string GetInputName(int index)
{
return "func" + index;
return "function" + index;
}

protected override string GetInputTooltip(int index)
Expand Down
10 changes: 5 additions & 5 deletions src/Libraries/CoreNodeModels/HigherOrder/MapCombineLacing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ protected CombinatorNode(IEnumerable<PortModel> inPorts, IEnumerable<PortModel>

protected CombinatorNode() : this(3)
{
InPorts.Add(new PortModel(PortType.Input, this, new PortData("comb", Resources.CombinatorPortDataCombToolTip)));
InPorts.Add(new PortModel(PortType.Input, this, new PortData("combineFunction", Resources.CombinatorPortDataCombToolTip)));
InPorts.Add(new PortModel(PortType.Input, this, new PortData("list0", Resources.PortDataListToolTip + " #0")));
InPorts.Add(new PortModel(PortType.Input, this, new PortData("list1", Resources.PortDataListToolTip + " #1")));
InPorts.Add(new PortModel(PortType.Input, this, new PortData("list2", Resources.PortDataListToolTip + " #2")));

OutPorts.Add(new PortModel(PortType.Output, this, new PortData("combined", Resources.CombinatorPortDataResultToolTip)));
OutPorts.Add(new PortModel(PortType.Output, this, new PortData("list", Resources.CombinatorPortDataResultToolTip)));

RegisterAllPorts();
}
Expand All @@ -73,12 +73,12 @@ protected CombinatorNode(int minPorts)

protected override string GetInputName(int index)
{
return "list" + index;
return "list" + (index-1);
}

protected override string GetInputTooltip(int index)
{
return Resources.PortDataListToolTip + " #" + index;
return Resources.PortDataListToolTip + " #" + (index-1);
}

protected override void RemoveInput()
Expand Down
6 changes: 3 additions & 3 deletions src/Libraries/CoreNodeModels/Properties/Resources.Designer.cs

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

6 changes: 3 additions & 3 deletions src/Libraries/CoreNodeModels/Properties/Resources.en-US.resx
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
<value>A list of values between 0.0 and 1.0. These values are used to look up the color within the range.</value>
</data>
<data name="CombinatorPortDataCombToolTip" xml:space="preserve">
<value>Combinator</value>
<value>Function to use as combinator</value>
</data>
<data name="CombinatorPortDataResultToolTip" xml:space="preserve">
<value>Combined lists</value>
Expand Down Expand Up @@ -265,11 +265,11 @@
<comment>Search tags. When do translation, appending localized tags to the existing tags and use ';' to seperate them</comment>
</data>
<data name="FunctionApplyDescription" xml:space="preserve">
<value>Applies a function to arguments.</value>
<value>Returns the result of a function with supplied arguments. Ex: arguments of a point and vector are applied to a translate function returning a translated point.</value>
<comment>Description for Function.Apply</comment>
</data>
<data name="FunctionComposeDescription" xml:space="preserve">
<value>Compose multiple functions.</value>
<value>Returns a single function from multiple functions. Ex: the modulus and divide functions are composed into a single function to apply to a list.</value>
<comment>Description for Function.Compose</comment>
</data>
<data name="IfDescription" xml:space="preserve">
Expand Down
6 changes: 3 additions & 3 deletions src/Libraries/CoreNodeModels/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
<value>A list of values between 0.0 and 1.0. These values are used to look up the color within the range.</value>
</data>
<data name="CombinatorPortDataCombToolTip" xml:space="preserve">
<value>Combinator</value>
<value>Function to use as combinator</value>
</data>
<data name="CombinatorPortDataResultToolTip" xml:space="preserve">
<value>Combined lists</value>
Expand Down Expand Up @@ -265,11 +265,11 @@
<comment>Search tags. When do translation, appending localized tags to the existing tags and use ';' to seperate them</comment>
</data>
<data name="FunctionApplyDescription" xml:space="preserve">
<value>Applies a function to arguments.</value>
<value>Returns the result of a function with supplied arguments. Ex: arguments of a point and vector are applied to a translate function returning a translated point.</value>
<comment>Description for Function.Apply</comment>
</data>
<data name="FunctionComposeDescription" xml:space="preserve">
<value>Compose multiple functions.</value>
<value>Returns a single function from multiple functions. Ex: the modulus and divide functions are composed into a single function to apply to a list.</value>
<comment>Description for Function.Compose</comment>
</data>
<data name="IfDescription" xml:space="preserve">
Expand Down
8 changes: 4 additions & 4 deletions src/Libraries/CoreNodeModels/String.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ private FromObject(IEnumerable<PortModel> inPorts, IEnumerable<PortModel> outPor
public FromObject() : base("__ToStringFromObject")
{
ArgumentLacing = LacingStrategy.Disabled;
InPorts.Add(new PortModel(PortType.Input, this, new PortData("obj", Resources.FromObjectPortDataObjToolTip)));
OutPorts.Add(new PortModel(PortType.Output, this, new PortData("str", Resources.FormulaPortDataResultToolTip)));
InPorts.Add(new PortModel(PortType.Input, this, new PortData("object", Resources.FromObjectPortDataObjToolTip)));
OutPorts.Add(new PortModel(PortType.Output, this, new PortData("string", Resources.FromObjectPortDataResultToolTip)));
RegisterAllPorts();
}
}
Expand All @@ -103,8 +103,8 @@ private FromArray(IEnumerable<PortModel> inPorts, IEnumerable<PortModel> outPort
public FromArray() : base("__ToStringFromArray")
{
ArgumentLacing = LacingStrategy.Disabled;
InPorts.Add(new PortModel(PortType.Input, this, new PortData("arr", Resources.FromArrayPortDataArrayToolTip)));
OutPorts.Add(new PortModel(PortType.Output, this, new PortData("str", Resources.FromArrayPortDataResultToolTip)));
InPorts.Add(new PortModel(PortType.Input, this, new PortData("array", Resources.FromArrayPortDataArrayToolTip)));
OutPorts.Add(new PortModel(PortType.Output, this, new PortData("string", Resources.FromArrayPortDataResultToolTip)));
RegisterAllPorts();
}
}
Expand Down

0 comments on commit 3e50feb

Please sign in to comment.