Skip to content

Conversation

@ramramps
Copy link
Collaborator

@ramramps ramramps commented Nov 3, 2017

Purpose

This PR sets the DayOfWeek node as deprecated in Dynamo. DayOfWeek node is enum, and hence a new constructor is added to check for obsolete property on Enum fields.

Samplegraph

{
  "Uuid": "3c9d0464-8643-5ffe-96e5-ab1769818209",
  "IsCustomNode": false,
  "Description": "",
  "Name": "Home",
  "ElementResolver": {
    "ResolutionMap": {}
  },
  "Inputs": [],
  "Nodes": [
    {
      "ConcreteType": "Dynamo.Graph.Nodes.ZeroTouch.DSFunction, DynamoCore",
      "NodeType": "FunctionNode",
      "FunctionSignature": "DSCore.DayOfWeek.Friday",
      "Id": "e299fd0add574ff99a87e642983dbc9f",
      "Inputs": [],
      "Outputs": [
        {
          "Id": "d9ca877201d04441bb12f6dcd3548ac8",
          "Name": "DayOfWeek",
          "Description": "DayOfWeek",
          "UsingDefaultValue": false,
          "Level": 2,
          "UseLevels": false,
          "KeepListStructure": false
        }
      ],
      "Replication": "Auto",
      "Description": "DayOfWeek.Friday: DayOfWeek"
    }
  ],
  "Connectors": [],
  "Dependencies": [],
  "Bindings": [],
  "View": {
    "Dynamo": {
      "ScaleFactor": 1.0,
      "HasRunWithoutCrash": true,
      "IsVisibleInDynamoLibrary": true,
      "Version": "2.0.0.3064",
      "RunType": "Automatic",
      "RunPeriod": "1000"
    },
    "Camera": {
      "Name": "Background Preview",
      "EyeX": -17.0,
      "EyeY": 24.0,
      "EyeZ": 50.0,
      "LookX": 12.0,
      "LookY": -13.0,
      "LookZ": -58.0,
      "UpX": 0.0,
      "UpY": 1.0,
      "UpZ": 0.0
    },
    "NodeViews": [
      {
        "Id": "e299fd0add574ff99a87e642983dbc9f",
        "Name": "DayOfWeek.Friday",
        "ShowGeometry": true,
        "Excluded": false,
        "X": 294.0,
        "Y": 232.75
      }
    ],
    "Annotations": [],
    "X": 0.0,
    "Y": 0.0,
    "Zoom": 1.0
  }
}

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

(FILL ME IN) Reviewer 1 (If possible, assign the Reviewer for the PR)

(FILL ME IN, optional) Any additional notes to reviewers or testers.

FYIs

(FILL ME IN, Optional) Names of anyone else you wish to be notified of

@mjkkirschner
Copy link
Member

mjkkirschner commented Nov 3, 2017

@aparajit-pratap I wonder if you have some insight into the original code here and could help with the review.

@ramramps
Copy link
Collaborator Author

ramramps commented Nov 3, 2017

@gregmarr FYI. These nodes are deprecated in Dynamo.

@gregmarr
Copy link
Contributor

gregmarr commented Nov 3, 2017

Are you deprecating the DayOfWeek DayOfWeek(System.DateTime dateTime) function then, or is this just deprecating the node that creates the enum value?

@gregmarr
Copy link
Contributor

gregmarr commented Nov 3, 2017

TS doesn't have anything for handling a node of type DayOfWeek.

@ramramps
Copy link
Collaborator Author

ramramps commented Nov 3, 2017

@gregmarr This is Deprecating DayOfWeek enum. I got this when I ran this node in cogs
screen shot 2017-11-03 at 12 52 34 pm

@gregmarr
Copy link
Contributor

gregmarr commented Nov 3, 2017

@ramramps Okay, not sure how we're handling that, can you share the Graph?

@ramramps
Copy link
Collaborator Author

ramramps commented Nov 3, 2017

@gregmarr The graph is attached in this PR.

@gregmarr
Copy link
Contributor

gregmarr commented Nov 3, 2017

Ah, right, it just creates a function node for it, and we execute it as a no-param function, which picks up all the enums in the system.

@mjkkirschner
Copy link
Member

@gregmarr please note that AVP does not yet create functions in the library for enums, just thought I'd mention it if you're looking into this.

@gregmarr
Copy link
Contributor

gregmarr commented Nov 3, 2017

So I guess the question is, why is this being deprecated?

@ramramps
Copy link
Collaborator Author

ramramps commented Nov 3, 2017

Question for @Racel - why this node is deprecated?
One reason is there is DayOfWeek node and there is individual DayOfWeekNode. Racel wants only the DayOfWeekNode in Dscore.DateTime and not individual DayofWeeknode. (She ran the analytics and found these nodes are hardly used).

@Racel
Copy link
Contributor

Racel commented Nov 3, 2017

What @ramramps said. We want to reduce the complexity of the node library, and no one could figure out a good reason why people would use these nodes in the first place. Looking at analytics, the most frequently used node was used ~300 times in the past 2 years over 10,000,000 nodes that have been created.

@ramramps
Copy link
Collaborator Author

ramramps commented Nov 3, 2017

yes @Racel. I am ok with deprecating this node.

@jnealb
Copy link
Collaborator

jnealb commented Nov 3, 2017

@Racel @ramramps @QilongTang @mjkkirschner If someone did need comprehensive datetime arithmetic capabilitites, can we point them to a package?

@Racel
Copy link
Contributor

Racel commented Nov 3, 2017

@jnealb The nodes we are deprecating aren't of any real value. They create a DayOfWeek object that can not be used in any other node. Users can utilize the 'DayOfWeek' node (which we are not deprecating) to retrieve the specific Day of the week for any given datetime.

@gregmarr
Copy link
Contributor

gregmarr commented Nov 3, 2017

@Racel They can use them in comparisons with the result of the output of the DayOfWeek node.

@Racel
Copy link
Contributor

Racel commented Nov 3, 2017

Ah. You are right, but you could also convert the output of DayOfWeek to a string and do a string comparison. I don’t think the comparison argument is enough to keep the nodes that are barely used over the past 2 years. We hope to be deprecating more OOTB nodes that have little utility.

@gregmarr
Copy link
Contributor

gregmarr commented Nov 4, 2017

As long as they can continue to use the enum value in a CBN, that's probably good enough.

@aparajit-pratap
Copy link
Contributor

aparajit-pratap commented Nov 6, 2017

@ramramps any idea why doesn't the IsVisible(false) attribute suffice for making the DayOfWeek enum hidden together with all the enum nodes?

@mjkkirschner
Copy link
Member

@aparajit-pratap the IsVisible attribute is enough - but it only hides the node, it does not apply the obsolete message.

@ramramps
Copy link
Collaborator Author

ramramps commented Nov 6, 2017

@aparajit-pratap as mike mentioned, obsolete message is not applied to any enums (or something we missed).

@aparajit-pratap
Copy link
Contributor

Yes, of course. I guess my next question would be why doesn't applying the attribute on the enum apply to all of its members?

@ramramps
Copy link
Collaborator Author

ramramps commented Nov 6, 2017

@aparajit-pratap parseEnumType traverse all fieldInfo. Also, it is possible to set few fields as obsolete and leave the remaining.

@ramramps ramramps changed the title [WIP] Deprecate DayOfWeek Enum node Deprecate DayOfWeek Enum node Nov 7, 2017
@ramramps
Copy link
Collaborator Author

ramramps commented Nov 7, 2017

@mjkkirschner @QilongTang @aparajit-pratap let me know if this is good to merge.

@mjkkirschner
Copy link
Member

@ramramps changes look good, can you run the self service tests though to make sure no regression with other zero touch import?

@ramramps
Copy link
Collaborator Author

ramramps commented Nov 8, 2017

@mjkkirschner done.
screen shot 2017-11-07 at 8 30 18 pm

@QilongTang
Copy link
Contributor

Thanks @ramramps LGTM as well. Merging this to get a build early

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.

7 participants