-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add parametric data proto file #82
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
//--------------------------------------------------------------------- | ||
//--------------------------------------------------------------------- | ||
syntax = "proto3"; | ||
|
||
//--------------------------------------------------------------------- | ||
//--------------------------------------------------------------------- | ||
package ni.protobuf.types; | ||
|
||
//--------------------------------------------------------------------- | ||
//--------------------------------------------------------------------- | ||
option csharp_namespace = "NationalInstruments.Protobuf.Types"; | ||
option go_package = "types"; | ||
option java_multiple_files = true; | ||
option java_outer_classname = "ParametricDataProto"; | ||
option java_package = "com.ni.protobuf.types"; | ||
option objc_class_prefix = "NIPT"; | ||
option php_namespace = "NI\\PROTOBUF\\TYPES"; | ||
option ruby_package = "NI::Protobuf::Types"; | ||
|
||
message ParametricDataValue { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll admit the term parametric data doesn't quite land with me conceptually here. This essentially looks like named data with units to me. I recognize coming up with a good name for that is challenging and perhaps there isn't anything significantly better that warrants a change at this point. The best ideas I have at the moment are something like |
||
oneof value { | ||
double double_value = 1; | ||
bool bool_value = 2; | ||
string string_value = 3; | ||
int32 int_value = 4; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would recommend changing all of the field names around |
||
} | ||
string label = 5; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider making the |
||
string unit = 6; | ||
} | ||
|
||
message ParametricDataValueArray { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Have you considered collapsing this into the |
||
message DoubleArray { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Something else to consider is whether we should extract these nested message definitions into |
||
repeated double values = 1; | ||
} | ||
message BoolArray { | ||
repeated bool values = 1; | ||
} | ||
message StringArray { | ||
repeated string values = 1; | ||
} | ||
message IntArray { | ||
repeated int32 values = 1; | ||
} | ||
oneof value { | ||
DoubleArray double_array = 1; | ||
BoolArray bool_array = 2; | ||
StringArray string_array = 3; | ||
IntArray int_array = 4; | ||
} | ||
string label = 5; | ||
string unit = 6; | ||
} | ||
|
||
message ParametricData { | ||
ParametricDataValue value = 1; | ||
repeated ParametricDataValue parameters = 2; | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The meaning of this field isn't immediately obvious to me so I feel like documentation here would definitely be good. Is this meant to describes inputs/configuration that was used to produce the data value? If so, why are we limiting to scalar parameters producing a scalar data value and vice versa. Again, should we be looking to collapse scalar and array message types into a single message? |
||
|
||
message ParametricDataArray { | ||
ParametricDataValueArray values = 1; | ||
repeated ParametricDataValueArray parameters = 2; | ||
} |
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.
Please add comments to messages and fields as needed. I would say comments for the messages explaining their purpose is probably the minimum. If the a field comment provides no value, then I'm OK omitting it.
There is inconsistent spacing used throughout. Please normalize to using 2 spaces for indenting. Our internal protobuf style guide is located here.