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

Fixed missing proto issue for smart buildings dataset. As discussed with @weide the fix is to: #5675

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@
import pandas as pd
from tensorflow_datasets.datasets.smart_buildings import constants
from tensorflow_datasets.datasets.smart_buildings import reader_lib
from tensorflow_datasets.datasets.smart_buildings import smart_control_building_pb2
from tensorflow_datasets.datasets.smart_buildings import smart_control_normalization_pb2
from tensorflow_datasets.datasets.smart_buildings import smart_control_reward_pb2

from tensorflow_datasets.proto import smart_control_building_generated_pb2 as smart_control_building_pb2
from tensorflow_datasets.proto import smart_control_normalization_generated_pb2 as smart_control_normalization_pb2
from tensorflow_datasets.proto import smart_control_reward_generated_pb2 as smart_control_reward_pb2

T = TypeVar('T')

Expand Down
6 changes: 3 additions & 3 deletions tensorflow_datasets/datasets/smart_buildings/reader_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@

from absl import logging
import pandas as pd
from tensorflow_datasets.datasets.smart_buildings import smart_control_building_pb2
from tensorflow_datasets.datasets.smart_buildings import smart_control_normalization_pb2
from tensorflow_datasets.datasets.smart_buildings import smart_control_reward_pb2
from tensorflow_datasets.proto import smart_control_building_generated_pb2 as smart_control_building_pb2
from tensorflow_datasets.proto import smart_control_normalization_generated_pb2 as smart_control_normalization_pb2
from tensorflow_datasets.proto import smart_control_reward_generated_pb2 as smart_control_reward_pb2

VariableId = NewType('VariableId', str)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@

"""smart_buildings_dataset dataset."""

# from tensorflow_datasets.datasets.smart_buildings
# import smart_buildingsdataset_builder
# import tensorflow_datasets.public_api as tfds
from tensorflow_datasets.datasets.smart_buildings import smart_buildings_dataset_builder
import tensorflow_datasets.public_api as tfds


# class SmartBuildingsDatasetTest(tfds.testing.DatasetBuilderTestCase):
# """Tests for smart_buildings_dataset dataset."""
class SmartBuildingsDatasetTest(tfds.testing.DatasetBuilderTestCase):
"""Tests for smart_buildings_dataset dataset."""

DATASET_CLASS = smart_buildings_dataset_builder.Builder
SPLITS = {
'sb1_23': 12, # Number of fake train example
'sb1_24': 12, # Number of fake train example
}

# DATASET_CLASS = smart_buildings_dataset_dataset_builder.Builder
# SPLITS = {
# 'sb1_23': 12, # Number of fake train example
# 'sb1_24': 12, # Number of fake train example
# }

# If you are calling `download/download_and_extract` with a dict, like:
# dl_manager.download({'some_key': 'http://a.org/out.txt', ...})
Expand All @@ -37,4 +37,4 @@


if __name__ == '__main__':
pass # tfds.testing.test_main()
tfds.testing.test_main()
129 changes: 129 additions & 0 deletions tensorflow_datasets/proto/smart_control_building_generated_pb2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
# coding=utf-8
# Copyright 2024 The TensorFlow Datasets Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# pylint: skip-file

# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: smart_control_building.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import symbol_database as _symbol_database
from google.protobuf.internal import builder as _builder
# @@protoc_insertion_point(imports)

_sym_db = _symbol_database.Default()


from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2


DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(
b'\n\x1csmart_control_building.proto\x12#smart_buildings.smart_control.proto\x1a\x1fgoogle/protobuf/timestamp.proto"\xfe\x01\n\x08ZoneInfo\x12\x0f\n\x07zone_id\x18\x01'
b' \x01(\t\x12\x13\n\x0b\x62uilding_id\x18\x02'
b' \x01(\t\x12\x18\n\x10zone_description\x18\x03'
b' \x01(\t\x12\x0c\n\x04\x61rea\x18\x04'
b' \x01(\x02\x12\x0f\n\x07\x64\x65vices\x18\x05'
b' \x03(\t\x12I\n\tzone_type\x18\x06'
b' \x01(\x0e\x32\x36.smart_buildings.smart_control.proto.ZoneInfo.ZoneType\x12\r\n\x05\x66loor\x18\x07'
b' \x01(\x05"9\n\x08ZoneType\x12\r\n\tUNDEFINED\x10\x00\x12\x08\n\x04ROOM\x10\x01\x12\t\n\x05\x46LOOR\x10\x02\x12\t\n\x05OTHER\x10\n"\xa5\x07\n\nDeviceInfo\x12\x11\n\tdevice_id\x18\x01'
b' \x01(\t\x12\x11\n\tnamespace\x18\x02'
b' \x01(\t\x12\x0c\n\x04\x63ode\x18\x03'
b' \x01(\t\x12\x0f\n\x07zone_id\x18\x04'
b' \x01(\t\x12O\n\x0b\x64\x65vice_type\x18\x05'
b' \x01(\x0e\x32:.smart_buildings.smart_control.proto.DeviceInfo.DeviceType\x12`\n\x11observable_fields\x18\x06'
b' \x03(\x0b\x32\x45.smart_buildings.smart_control.proto.DeviceInfo.ObservableFieldsEntry\x12X\n\raction_fields\x18\x07'
b' \x03(\x0b\x32\x41.smart_buildings.smart_control.proto.DeviceInfo.ActionFieldsEntry\x1ar\n\x15ObservableFieldsEntry\x12\x0b\n\x03key\x18\x01'
b' \x01(\t\x12H\n\x05value\x18\x02'
b' \x01(\x0e\x32\x39.smart_buildings.smart_control.proto.DeviceInfo.ValueType:\x02\x38\x01\x1an\n\x11\x41\x63tionFieldsEntry\x12\x0b\n\x03key\x18\x01'
b' \x01(\t\x12H\n\x05value\x18\x02'
b' \x01(\x0e\x32\x39.smart_buildings.smart_control.proto.DeviceInfo.ValueType:\x02\x38\x01"\xe7\x01\n\nDeviceType\x12\r\n\tUNDEFINED\x10\x00\x12\x07\n\x03\x46\x41N\x10\x01\x12\x07\n\x03PMP\x10\x02\x12\x07\n\x03\x46\x43U\x10\x03\x12\x07\n\x03VAV\x10\x04\x12\x06\n\x02\x44H\x10\x05\x12\x07\n\x03\x41HU\x10\x06\x12\x07\n\x03\x42LR\x10\x07\x12\x08\n\x04\x43\x44WS\x10\x08\x12\x06\n\x02\x43H\x10\t\x12\x08\n\x04\x43HWS\x10\n\x12\x06\n\x02\x43T\x10\x0b\x12\x06\n\x02\x44\x43\x10\x0c\x12\x07\n\x03\x44\x46R\x10\r\x12\x07\n\x03\x44MP\x10\x0e\x12\x07\n\x03HWS\x10\x0f\x12\x06\n\x02HX\x10\x10\x12\x07\n\x03MAU\x10\x11\x12\x07\n\x03SDC\x10\x12\x12\x06\n\x02UH\x10\x13\x12\x07\n\x03PWR\x10\x14\x12\x07\n\x03GAS\x10\x15\x12\x06\n\x02\x41\x43\x10\x16\x12\t\n\x05OTHER\x10\x17"w\n\tValueType\x12\x18\n\x14VALUE_TYPE_UNDEFINED\x10\x00\x12\x14\n\x10VALUE_CONTINUOUS\x10\x01\x12\x11\n\rVALUE_INTEGER\x10\x02\x12\x15\n\x11VALUE_CATEGORICAL\x10\x03\x12\x10\n\x0cVALUE_BINARY\x10\x04"G\n\x18SingleObservationRequest\x12\x11\n\tdevice_id\x18\x01'
b' \x01(\t\x12\x18\n\x10measurement_name\x18\x02'
b' \x01(\t"\xdf\x02\n\x19SingleObservationResponse\x12-\n\ttimestamp\x18\x01'
b' \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x61\n\x1asingle_observation_request\x18\x02'
b' \x01(\x0b\x32=.smart_buildings.smart_control.proto.SingleObservationRequest\x12\x19\n\x11observation_valid\x18\x03'
b' \x01(\x08\x12\x1a\n\x10\x63ontinuous_value\x18\x04'
b' \x01(\x02H\x00\x12\x17\n\rinteger_value\x18\x05'
b' \x01(\x05H\x00\x12\x1b\n\x11\x63\x61tegorical_value\x18\x06'
b' \x01(\tH\x00\x12\x16\n\x0c\x62inary_value\x18\x07'
b' \x01(\x08H\x00\x12\x16\n\x0cstring_value\x18\x08'
b' \x01(\tH\x00\x42\x13\n\x11observation_value"\xa7\x01\n\x12ObservationRequest\x12-\n\ttimestamp\x18\x01'
b' \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x62\n\x1bsingle_observation_requests\x18\x02'
b' \x03(\x0b\x32=.smart_buildings.smart_control.proto.SingleObservationRequest"\xf4\x01\n\x13ObservationResponse\x12-\n\ttimestamp\x18\x01'
b' \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12H\n\x07request\x18\x02'
b' \x01(\x0b\x32\x37.smart_buildings.smart_control.proto.ObservationRequest\x12\x64\n\x1csingle_observation_responses\x18\x03'
b' \x03(\x0b\x32>.smart_buildings.smart_control.proto.SingleObservationResponse"\xd3\x01\n\x13SingleActionRequest\x12\x11\n\tdevice_id\x18\x01'
b' \x01(\t\x12\x15\n\rsetpoint_name\x18\x02'
b' \x01(\t\x12\x1a\n\x10\x63ontinuous_value\x18\x03'
b' \x01(\x02H\x00\x12\x17\n\rinteger_value\x18\x04'
b' \x01(\x05H\x00\x12\x1b\n\x11\x63\x61tegorical_value\x18\x05'
b' \x01(\tH\x00\x12\x16\n\x0c\x62inary_value\x18\x06'
b' \x01(\x08H\x00\x12\x16\n\x0cstring_value\x18\x07'
b' \x01(\tH\x00\x42\x10\n\x0esetpoint_value"\xdd\x03\n\x14SingleActionResponse\x12I\n\x07request\x18\x01'
b' \x01(\x0b\x32\x38.smart_buildings.smart_control.proto.SingleActionRequest\x12\x63\n\rresponse_type\x18\x02'
b' \x01(\x0e\x32L.smart_buildings.smart_control.proto.SingleActionResponse.ActionResponseType\x12\x17\n\x0f\x61\x64\x64itional_info\x18\x03'
b' \x01(\t"\xfb\x01\n\x12\x41\x63tionResponseType\x12\r\n\tUNDEFINED\x10\x00\x12\x0c\n\x08\x41\x43\x43\x45PTED\x10\x01\x12\x0b\n\x07PENDING\x10\x02\x12\r\n\tTIMED_OUT\x10\x03\x12\x1c\n\x18REJECTED_INVALID_SETTING\x10\x04\x12%\n!REJECTED_NOT_ENABLED_OR_AVAILABLE\x10\x05\x12\x15\n\x11REJECTED_OVERRIDE\x10\x06\x12\x1b\n\x17REJECTED_INVALID_DEVICE\x10\x07\x12\x1b\n\x17REJECTED_DEVICE_OFFLINE\x10\x08\x12\x0b\n\x07UNKNOWN\x10\t\x12\t\n\x05OTHER\x10\n"\x98\x01\n\rActionRequest\x12-\n\ttimestamp\x18\x01'
b' \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12X\n\x16single_action_requests\x18\x02'
b' \x03(\x0b\x32\x38.smart_buildings.smart_control.proto.SingleActionRequest"\xe0\x01\n\x0e\x41\x63tionResponse\x12-\n\ttimestamp\x18\x01'
b' \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x43\n\x07request\x18\x02'
b' \x01(\x0b\x32\x32.smart_buildings.smart_control.proto.ActionRequest\x12Z\n\x17single_action_responses\x18\x03'
b' \x03(\x0b\x32\x39.smart_buildings.smart_control.proto.SingleActionResponseb\x06proto3'
)

_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
_builder.BuildTopDescriptorsAndMessages(
DESCRIPTOR, 'smart_control_building_pb2', globals()
)
if _descriptor._USE_C_DESCRIPTORS == False:

DESCRIPTOR._options = None
_DEVICEINFO_OBSERVABLEFIELDSENTRY._options = None
_DEVICEINFO_OBSERVABLEFIELDSENTRY._serialized_options = b'8\001'
_DEVICEINFO_ACTIONFIELDSENTRY._options = None
_DEVICEINFO_ACTIONFIELDSENTRY._serialized_options = b'8\001'
_ZONEINFO._serialized_start = 103
_ZONEINFO._serialized_end = 357
_ZONEINFO_ZONETYPE._serialized_start = 300
_ZONEINFO_ZONETYPE._serialized_end = 357
_DEVICEINFO._serialized_start = 360
_DEVICEINFO._serialized_end = 1293
_DEVICEINFO_OBSERVABLEFIELDSENTRY._serialized_start = 712
_DEVICEINFO_OBSERVABLEFIELDSENTRY._serialized_end = 826
_DEVICEINFO_ACTIONFIELDSENTRY._serialized_start = 828
_DEVICEINFO_ACTIONFIELDSENTRY._serialized_end = 938
_DEVICEINFO_DEVICETYPE._serialized_start = 941
_DEVICEINFO_DEVICETYPE._serialized_end = 1172
_DEVICEINFO_VALUETYPE._serialized_start = 1174
_DEVICEINFO_VALUETYPE._serialized_end = 1293
_SINGLEOBSERVATIONREQUEST._serialized_start = 1295
_SINGLEOBSERVATIONREQUEST._serialized_end = 1366
_SINGLEOBSERVATIONRESPONSE._serialized_start = 1369
_SINGLEOBSERVATIONRESPONSE._serialized_end = 1720
_OBSERVATIONREQUEST._serialized_start = 1723
_OBSERVATIONREQUEST._serialized_end = 1890
_OBSERVATIONRESPONSE._serialized_start = 1893
_OBSERVATIONRESPONSE._serialized_end = 2137
_SINGLEACTIONREQUEST._serialized_start = 2140
_SINGLEACTIONREQUEST._serialized_end = 2351
_SINGLEACTIONRESPONSE._serialized_start = 2354
_SINGLEACTIONRESPONSE._serialized_end = 2831
_SINGLEACTIONRESPONSE_ACTIONRESPONSETYPE._serialized_start = 2580
_SINGLEACTIONRESPONSE_ACTIONRESPONSETYPE._serialized_end = 2831
_ACTIONREQUEST._serialized_start = 2834
_ACTIONREQUEST._serialized_end = 2986
_ACTIONRESPONSE._serialized_start = 2989
_ACTIONRESPONSE._serialized_end = 3213
# @@protoc_insertion_point(module_scope)
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# coding=utf-8
# Copyright 2024 The TensorFlow Datasets Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# pylint: skip-file

# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: smart_control_normalization.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import symbol_database as _symbol_database
from google.protobuf.internal import builder as _builder
# @@protoc_insertion_point(imports)

_sym_db = _symbol_database.Default()


from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2


DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(
b'\n!smart_control_normalization.proto\x12#smart_buildings.smart_control.proto\x1a\x1fgoogle/protobuf/timestamp.proto"\x90\x02\n\x16\x43ontinuousVariableInfo\x12\n\n\x02id\x18\x01'
b' \x01(\t\x12\x30\n\x0csample_start\x18\x02'
b' \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12.\n\nsample_end\x18\x03'
b' \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x13\n\x0bsample_size\x18\x04'
b' \x01(\x05\x12\x17\n\x0fsample_variance\x18\x05'
b' \x01(\x02\x12\x13\n\x0bsample_mean\x18\x06'
b' \x01(\x02\x12\x15\n\rsample_median\x18\x07'
b' \x01(\x02\x12\x16\n\x0esample_maximum\x18\x08'
b' \x01(\x02\x12\x16\n\x0esample_minimum\x18\t \x01(\x02\x62\x06proto3'
)

_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
_builder.BuildTopDescriptorsAndMessages(
DESCRIPTOR, 'smart_control_normalization_pb2', globals()
)
if _descriptor._USE_C_DESCRIPTORS == False:

DESCRIPTOR._options = None
_CONTINUOUSVARIABLEINFO._serialized_start = 108
_CONTINUOUSVARIABLEINFO._serialized_end = 380
# @@protoc_insertion_point(module_scope)
Loading
Loading