-
Notifications
You must be signed in to change notification settings - Fork 15
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
BHoM_Engine: Add DisplayText support on enums #2930
Conversation
@adecler to confirm, the following actions are now queued:
There are 29 requests in the queue ahead of you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quick comment on an initial test @adecler - are we happy with the DisplayText
value being displayed in the One Locally Defined Value
area at the bottom?
Personally I am (because also I would expect people will put more appropriate display text items rather than what I've tested with) but just thought I'd raise it as a question while I test
@BHoMBot check compliance |
@FraserGreenroyd to confirm, the following actions are now queued:
There are 14 requests in the queue ahead of you. |
Yes, this is exactly what the ToText methods are for. Great to see it already is being used on a wider scope. Ideally we would always like to see enum displayed in a human readable way and never show the code version if there is a |
A quick question on how this Assume the DisplayText is meant to be an alias, as a short alternative name (allowing white space etc)? If so I can see a use for both. Just wanted to make sure there is not to much overlap :) |
@IsakNaslundBh , check teh description of the issue: BHoM/BHoM#1440 |
@BHoMBot check required |
@adecler to confirm, the following actions are now queued:
|
The check |
The check |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have tested both PRs by adding the new attribute to a couple of enum attributes and it is displaying well, in combination with displaying the default values where the attribute does not exist.
I am happy to see this merged, and am happy for now to not have unit tests for the methods on the basis that we currently do not have any enum values implementing the attribute in the oM - when that changes we will then want to add some unit tests for this method for the future.
Thanks @FraserGreenroyd . Yes, I agree on unit tests. They should be plenty of opportunities for the |
@BHoMBot check installer |
@FraserGreenroyd to confirm, the following actions are now queued:
There are 49 requests in the queue ahead of you. |
@adecler to confirm, the following actions are now queued:
|
NOTE: Depends on
BHoM/BHoM#1441
Issues addressed by this PR
See BHoM/BHoM#1440
Test files
Not a file per se since there isn't obviously a case of
DisplayText
usage in the BHoM yet. But here's a working example:Best is to add the attribute yourself to a random enum and test that it is well supported. Happy to jump to a call if it is easier for the review though.