Skip to content

Commit

Permalink
feat: add generic protobuf (#2634)
Browse files Browse the repository at this point in the history
* Added generic proto file with basic Value message

* Added basic Array message to represent arrays

* Added Tuple message to represent tuples

* Added timestamp and duration datatypes

* Added concise todo comments

* Changed field names, message name `NumpyNdarray`

* Applied changed message name, moved todo comment

* Added trailing newline

* Fixed sint32 and sint64 field names

Co-authored-by: Sadab Hafiz <sadabhafizny@gmail.com>
  • Loading branch information
Proto007 and Proto007 committed Jun 28, 2022
1 parent 8a337c0 commit fd808ad
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions protos/io_descriptors.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
syntax = "proto3";

import "google/protobuf/timestamp.proto";
import "google/protobuf/duration.proto";

/* Value represents a single instance of the supported datatypes. */
// TODO: int32, int64, fixed32, fixed64, sfixed32, sfixed64
message Value{
oneof dtype{
float float_=1;
double double_=2;
uint32 uint32_=3;
uint64 uint64_=4;
sint32 sint32_=5;
sint64 sint64_=6;
google.protobuf.Timestamp timestamp_=7;
google.protobuf.Duration duration_=8;
bool bool_=9;
string string_=10;
bytes bytes_=11;
Value value_=12;
NumpyNdarray array_=13;
Tuple tuple_=14;
}
}

/* Tuple represents a repeated field containing data with same or different datatypes */
message Tuple{
repeated Value value_=1;
}

// TODO: message complex types

/* NumpyNdarray contains a dtype which identifies the type of the array.
* The repeated field for the identified dtype contains the array. */
// TODO: int32, int64, fixed32, fixed64, sfixed32, sfixed64
message NumpyNdarray {
string dtype=1;
repeated float float_=2;
repeated double double_=3;
repeated uint32 uint32_=4;
repeated uint64 uint64_=5;
repeated sint32 sint32_=6;
repeated sint64 sint64_=7;
repeated google.protobuf.Timestamp timestamp_=8;
repeated google.protobuf.Duration duration_=9;
repeated bool bool_=10;
repeated string string_=11;
repeated bytes bytes_=12;
repeated NumpyNdarray array_=13;
repeated Tuple tuple_=14;
}

0 comments on commit fd808ad

Please sign in to comment.