Skip to content
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

Update NodeModel nodes out port types #11631

Merged
merged 9 commits into from
Apr 26, 2021
Merged

Conversation

QilongTang
Copy link
Contributor

@QilongTang QilongTang commented Apr 19, 2021

Please Note:

  1. Before submitting the PR, please review How to Contribute to Dynamo
  2. Dynamo Team will meet 1x a month to review PRs found on Github (Issues will be handled separately)
  3. PRs will be reviewed from oldest to newest
  4. If a reviewed PR requires changes by the owner, the owner of the PR has 30 days to respond. If the PR has seen no activity by the next session, it will be either closed by the team or depending on its utility will be taken over by someone on the team
  5. PRs should use either Dynamo's default PR template or one of these other template options in order to be considered for review.
  6. PRs that do not have one of the Dynamo PR templates completely filled out with all declarations satisfied will not be reviewed by the Dynamo team.
  7. PRs made to the DynamoRevit repo will need to be cherry-picked into all the DynamoRevit Release branches that Dynamo supports. Contributors will be responsible for cherry-picking their reviewed commits to the other branches after a LGTM label is added to the PR.

Purpose

As an alternative than #11621, do an audit to existing all NodeModel nodes and update their in/out port types. Due to Github crash, I lost all my notes for my progress in this PR of the ~50 nodes. Will update again tomorrow when I find the time.

Updated to DSCore.Color

  • "Core.Color.Color Palette"
  • "Core.Color.Color Range"

Remain as var

  • "Core.View.Watch 3D"
  • "Core.View.Watch"
  • "Core.View.Watch Image"

Updated to var

  • "Core.File.Directory From Path"
  • "Core.File.File From Path"

Remain as dateTime

  • "Core.Input.Date Time"

Remain as not defined

  • CodeBlockNode - this NodeModel node can output any type
  • "Core.Input.Input" - this NodeModel node only used in custom node to define custom node input
  • "Core.Input.Output" - this NodeModel node only used in custom node to define custom node output
  • DummyNode - this NodeModel node only appear when corrupted node found during file open, should not be used in NodeAutoComplete
  • TestNode - seems to be a NodeModel node only used internally for testing
  • "Core.Input.String" : BasicInteractive
  • "Core.Evaluate.Function Apply" - the output of this node can be anything
  • "Core.List.Range" - I failed to find where this NodeModel node is defined
  • "Core.List.Sequence"- I failed to find where this NodeModel node is defined

Remain as List

  • "Core.List.List.LaceShortest"
  • "Core.List.List.LaceLongest"
  • "Core.List.List.CartesianProduct"

Updated to List

  • "Core.List.List.Map"
  • "Core.List.List Create"
  • "Core.List.List.Combine"
  • "Core.List.List.Reduce"
  • "Core.List.List.Scan"

Updated to List,List

  • "Core.List.List.Filter"

Updated to number

  • "Core.Input.Number"

Remain as number

  • "Core.Units.Convert Between Units"
  • "Core.Input.Number Slider"
  • "Core.Units.Number From Feet and Inches"

Remain as int

  • "Core.Input.Integer Slider"

Updated to string

  • "Core.Input.Directory Path"
  • "Geometry.Geometry.ExportToSAT"

Remain as string

  • "Core.String.String from Object"
  • "Core.String.String from Array"
  • "Core.Input.File Path"

Remain as bool

  • "Core.Math.=="
  • "Core.Math.And"
  • "Core.Math.Or"
  • "Core.Input.Boolean"

Remain as Function

  • "Core.Scripting.Formula"
  • "Core.Logic.If"
  • "Core.Logic.ScopeIf"

Update as Function

  • "Core.Evaluate.Function Compose"

Removed type as object

Remain as type

  • "Core.Units.Unit Types"

Remain as var[]..[]

  • "Core.Scripting.Python Script"
  • "Core.Scripting.Python Script From String"

Updated to var[]..[]

  • "Core.List.ReplaceByCondition"
  • "Core.Web.Web Request"

ColorNodeAutoComplete

Declarations

Check these if you believe they are true

  • The codebase 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.
  • This PR modifies some build requirements and the readme is updated

Reviewers

@DynamoDS/dynamo

FYIs

@QilongTang
Copy link
Contributor Author

@aparajit-pratap @mjkkirschner Please check this one out about my audit results. Especially about the undefined ones, is there a particular node you think output type should be defined? Let me know and I can update the PR

@QilongTang QilongTang marked this pull request as ready for review April 23, 2021 13:27
@QilongTang
Copy link
Contributor Author

I will fix the unit test and update PR again

@@ -73,6 +73,7 @@ public override IEnumerable<AssociativeNode> BuildOutputAst(List<AssociativeNode
[NodeName("Function Compose")]
[NodeCategory(BuiltinNodeCategories.CORE_EVALUATE)]
[NodeDescription("FunctionComposeDescription", typeof(Resources))]
[OutPortTypes("Function")]
Copy link
Member

Choose a reason for hiding this comment

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

@aparajit-pratap should this have a namespace or the classes defined . ds files don't have namespaces?

@@ -317,6 +317,7 @@ public override void Dispose()
[NodeCategory("Core.File")]
[NodeDescription("DirectoryObjectNodeDescription",typeof(Resources))]
[NodeSearchTags("DirectoryPathSearchTags", typeof(Resources))]
[OutPortTypes("object")]
Copy link
Member

Choose a reason for hiding this comment

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

shouldn't this be var?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mjkkirschner I updated to be consistent with file from path, see PR description. I think anyway object seem to be made up, but I am not sure how many instances of that so I only make it consistent for now

Copy link
Member

@mjkkirschner mjkkirschner Apr 25, 2021

Choose a reason for hiding this comment

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

but looking at the buildOutputAST method for FileSystemObject<T> - it looks like the correct return type is T

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, I removed type object and updated for three nodes

@mjkkirschner
Copy link
Member

It looks like a good improvement to me @QilongTang - except shouldn't string input node return a string?

@QilongTang
Copy link
Contributor Author

It looks like a good improvement to me @QilongTang - except shouldn't string input node return a string?

It should but it seems an exception of regular node model node so I found no way to set the output type :(

@QilongTang QilongTang merged commit a9ce92c into master Apr 26, 2021
@QilongTang QilongTang deleted the NodeModelNodesOutPortTypes branch April 26, 2021 14:24
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.

2 participants