ni.datastore 0.1.0.dev3__tar.gz → 0.1.0.dev4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. {ni_datastore-0.1.0.dev3 → ni_datastore-0.1.0.dev4}/PKG-INFO +3 -3
  2. {ni_datastore-0.1.0.dev3 → ni_datastore-0.1.0.dev4}/pyproject.toml +3 -3
  3. {ni_datastore-0.1.0.dev3 → ni_datastore-0.1.0.dev4}/src/ni/datastore/data/_data_store_client.py +9 -0
  4. {ni_datastore-0.1.0.dev3 → ni_datastore-0.1.0.dev4}/src/ni/datastore/data/_types/_published_condition.py +6 -6
  5. {ni_datastore-0.1.0.dev3 → ni_datastore-0.1.0.dev4}/src/ni/datastore/data/_types/_published_measurement.py +6 -6
  6. {ni_datastore-0.1.0.dev3 → ni_datastore-0.1.0.dev4}/src/ni/datastore/data/_types/_step.py +6 -6
  7. {ni_datastore-0.1.0.dev3 → ni_datastore-0.1.0.dev4}/src/ni/datastore/data/_types/_test_result.py +6 -6
  8. {ni_datastore-0.1.0.dev3 → ni_datastore-0.1.0.dev4}/src/ni/datastore/metadata/_types/_hardware_item.py +11 -1
  9. {ni_datastore-0.1.0.dev3 → ni_datastore-0.1.0.dev4}/src/ni/datastore/metadata/_types/_operator.py +11 -1
  10. {ni_datastore-0.1.0.dev3 → ni_datastore-0.1.0.dev4}/src/ni/datastore/metadata/_types/_software_item.py +11 -1
  11. {ni_datastore-0.1.0.dev3 → ni_datastore-0.1.0.dev4}/src/ni/datastore/metadata/_types/_test.py +11 -1
  12. {ni_datastore-0.1.0.dev3 → ni_datastore-0.1.0.dev4}/src/ni/datastore/metadata/_types/_test_adapter.py +16 -6
  13. {ni_datastore-0.1.0.dev3 → ni_datastore-0.1.0.dev4}/src/ni/datastore/metadata/_types/_test_description.py +11 -1
  14. {ni_datastore-0.1.0.dev3 → ni_datastore-0.1.0.dev4}/src/ni/datastore/metadata/_types/_test_station.py +11 -1
  15. {ni_datastore-0.1.0.dev3 → ni_datastore-0.1.0.dev4}/src/ni/datastore/metadata/_types/_uut.py +11 -1
  16. {ni_datastore-0.1.0.dev3 → ni_datastore-0.1.0.dev4}/src/ni/datastore/metadata/_types/_uut_instance.py +11 -1
  17. {ni_datastore-0.1.0.dev3 → ni_datastore-0.1.0.dev4}/LICENSE +0 -0
  18. {ni_datastore-0.1.0.dev3 → ni_datastore-0.1.0.dev4}/README.md +0 -0
  19. {ni_datastore-0.1.0.dev3 → ni_datastore-0.1.0.dev4}/src/ni/datastore/__init__.py +0 -0
  20. {ni_datastore-0.1.0.dev3 → ni_datastore-0.1.0.dev4}/src/ni/datastore/data/__init__.py +0 -0
  21. {ni_datastore-0.1.0.dev3 → ni_datastore-0.1.0.dev4}/src/ni/datastore/data/_grpc_conversion.py +0 -0
  22. {ni_datastore-0.1.0.dev3 → ni_datastore-0.1.0.dev4}/src/ni/datastore/data/_types/__init__.py +0 -0
  23. {ni_datastore-0.1.0.dev3 → ni_datastore-0.1.0.dev4}/src/ni/datastore/data/_types/py.typed +0 -0
  24. {ni_datastore-0.1.0.dev3 → ni_datastore-0.1.0.dev4}/src/ni/datastore/data/py.typed +0 -0
  25. {ni_datastore-0.1.0.dev3 → ni_datastore-0.1.0.dev4}/src/ni/datastore/metadata/__init__.py +0 -0
  26. {ni_datastore-0.1.0.dev3 → ni_datastore-0.1.0.dev4}/src/ni/datastore/metadata/_grpc_conversion.py +0 -0
  27. {ni_datastore-0.1.0.dev3 → ni_datastore-0.1.0.dev4}/src/ni/datastore/metadata/_metadata_store_client.py +0 -0
  28. {ni_datastore-0.1.0.dev3 → ni_datastore-0.1.0.dev4}/src/ni/datastore/metadata/_types/__init__.py +0 -0
  29. {ni_datastore-0.1.0.dev3 → ni_datastore-0.1.0.dev4}/src/ni/datastore/metadata/_types/_alias.py +0 -0
  30. {ni_datastore-0.1.0.dev3 → ni_datastore-0.1.0.dev4}/src/ni/datastore/metadata/_types/_extension_schema.py +0 -0
  31. {ni_datastore-0.1.0.dev3 → ni_datastore-0.1.0.dev4}/src/ni/datastore/metadata/_types/py.typed +0 -0
  32. {ni_datastore-0.1.0.dev3 → ni_datastore-0.1.0.dev4}/src/ni/datastore/metadata/py.typed +0 -0
  33. {ni_datastore-0.1.0.dev3 → ni_datastore-0.1.0.dev4}/src/ni/datastore/py.typed +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: ni.datastore
3
- Version: 0.1.0.dev3
3
+ Version: 0.1.0.dev4
4
4
  Summary: APIs for publishing and retrieving data from the NI Measurement Data Store
5
5
  License: MIT
6
6
  Keywords: datastore
@@ -25,8 +25,8 @@ Classifier: Programming Language :: Python :: 3.13
25
25
  Classifier: Programming Language :: Python :: Implementation :: CPython
26
26
  Requires-Dist: hightime (>=0.3.0.dev0)
27
27
  Requires-Dist: ni-datamonikers-v1-client (>=0.1.0.dev1)
28
- Requires-Dist: ni-measurements-data-v1-client (>=0.1.0.dev1)
29
- Requires-Dist: ni-measurements-metadata-v1-client (>=0.1.0.dev1)
28
+ Requires-Dist: ni-measurements-data-v1-client (>=0.1.0.dev2)
29
+ Requires-Dist: ni-measurements-metadata-v1-client (>=0.1.0.dev2)
30
30
  Requires-Dist: ni-protobuf-types (>=1.0.1.dev0)
31
31
  Requires-Dist: protobuf (>=4.21)
32
32
  Description-Content-Type: text/markdown
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "ni.datastore"
3
- version = "0.1.0-dev3"
3
+ version = "0.1.0.dev4"
4
4
  license = "MIT"
5
5
  description = "APIs for publishing and retrieving data from the NI Measurement Data Store"
6
6
  authors = [{name = "NI", email = "opensource@ni.com"}]
@@ -38,8 +38,8 @@ requires-poetry = '>=2.1,<3.0'
38
38
  python = "^3.9"
39
39
  protobuf = {version=">=4.21"}
40
40
  ni-datamonikers-v1-client = { version = ">=0.1.0.dev1", allow-prereleases = true }
41
- ni-measurements-data-v1-client = { version = ">=0.1.0.dev1", allow-prereleases = true }
42
- ni-measurements-metadata-v1-client = { version = ">=0.1.0.dev1", allow-prereleases = true }
41
+ ni-measurements-data-v1-client = { version = ">=0.1.0.dev2", allow-prereleases = true }
42
+ ni-measurements-metadata-v1-client = { version = ">=0.1.0.dev2", allow-prereleases = true }
43
43
  ni-protobuf-types = { version = ">=1.0.1.dev0", allow-prereleases = true }
44
44
  hightime = { version = ">=0.3.0.dev0", allow-prereleases = true }
45
45
 
@@ -44,6 +44,7 @@ from ni.measurements.data.v1.data_store_service_pb2 import (
44
44
  QueryConditionsRequest,
45
45
  QueryMeasurementsRequest,
46
46
  QueryStepsRequest,
47
+ QueryTestResultsRequest,
47
48
  )
48
49
  from ni.protobuf.types.precision_timestamp_conversion import (
49
50
  hightime_datetime_to_protobuf,
@@ -312,6 +313,14 @@ class DataStoreClient:
312
313
  for published_measurement in query_response.published_measurements
313
314
  ]
314
315
 
316
+ def query_test_results(self, odata_query: str = "") -> Sequence[TestResult]:
317
+ """Query test results from the data store."""
318
+ query_request = QueryTestResultsRequest(odata_query=odata_query)
319
+ query_response = self._get_data_store_client().query_test_results(query_request)
320
+ return [
321
+ TestResult.from_protobuf(test_result) for test_result in query_response.test_results
322
+ ]
323
+
315
324
  def query_steps(self, odata_query: str = "") -> Sequence[Step]:
316
325
  """Query steps from the data store."""
317
326
  query_request = QueryStepsRequest(odata_query=odata_query)
@@ -13,7 +13,7 @@ class PublishedCondition:
13
13
 
14
14
  __slots__ = (
15
15
  "moniker",
16
- "published_condition_id",
16
+ "id",
17
17
  "condition_name",
18
18
  "condition_type",
19
19
  "step_id",
@@ -24,7 +24,7 @@ class PublishedCondition:
24
24
  self,
25
25
  *,
26
26
  moniker: Moniker | None = None,
27
- published_condition_id: str = "",
27
+ id: str = "",
28
28
  condition_name: str = "",
29
29
  condition_type: str = "",
30
30
  step_id: str = "",
@@ -32,7 +32,7 @@ class PublishedCondition:
32
32
  ) -> None:
33
33
  """Initialize a PublishedCondition instance."""
34
34
  self.moniker = moniker
35
- self.published_condition_id = published_condition_id
35
+ self.id = id
36
36
  self.condition_name = condition_name
37
37
  self.condition_type = condition_type
38
38
  self.step_id = step_id
@@ -47,7 +47,7 @@ class PublishedCondition:
47
47
  if published_condition_proto.HasField("moniker")
48
48
  else None
49
49
  ),
50
- published_condition_id=published_condition_proto.published_condition_id,
50
+ id=published_condition_proto.id,
51
51
  condition_name=published_condition_proto.condition_name,
52
52
  condition_type=published_condition_proto.condition_type,
53
53
  step_id=published_condition_proto.step_id,
@@ -58,7 +58,7 @@ class PublishedCondition:
58
58
  """Convert this PublishedCondition instance to a protobuf PublishedCondition message."""
59
59
  return PublishedConditionProto(
60
60
  moniker=self.moniker,
61
- published_condition_id=self.published_condition_id,
61
+ id=self.id,
62
62
  condition_name=self.condition_name,
63
63
  condition_type=self.condition_type,
64
64
  step_id=self.step_id,
@@ -71,7 +71,7 @@ class PublishedCondition:
71
71
  return NotImplemented
72
72
  return (
73
73
  self.moniker == other.moniker
74
- and self.published_condition_id == other.published_condition_id
74
+ and self.id == other.id
75
75
  and self.condition_name == other.condition_name
76
76
  and self.condition_type == other.condition_type
77
77
  and self.step_id == other.step_id
@@ -24,7 +24,7 @@ class PublishedMeasurement:
24
24
  __slots__ = (
25
25
  "moniker",
26
26
  "_published_conditions",
27
- "published_measurement_id",
27
+ "id",
28
28
  "test_result_id",
29
29
  "step_id",
30
30
  "_software_item_ids",
@@ -65,7 +65,7 @@ class PublishedMeasurement:
65
65
  *,
66
66
  moniker: Moniker | None = None,
67
67
  published_conditions: Iterable[PublishedCondition] | None = None,
68
- published_measurement_id: str = "",
68
+ id: str = "",
69
69
  test_result_id: str = "",
70
70
  step_id: str = "",
71
71
  software_item_ids: Iterable[str] | None = None,
@@ -85,7 +85,7 @@ class PublishedMeasurement:
85
85
  self._published_conditions: MutableSequence[PublishedCondition] = (
86
86
  list(published_conditions) if published_conditions is not None else []
87
87
  )
88
- self.published_measurement_id = published_measurement_id
88
+ self.id = id
89
89
  self.test_result_id = test_result_id
90
90
  self.step_id = step_id
91
91
  self._software_item_ids: MutableSequence[str] = (
@@ -121,7 +121,7 @@ class PublishedMeasurement:
121
121
  PublishedCondition.from_protobuf(cond)
122
122
  for cond in published_measurement_proto.published_conditions
123
123
  ],
124
- published_measurement_id=published_measurement_proto.published_measurement_id,
124
+ id=published_measurement_proto.id,
125
125
  test_result_id=published_measurement_proto.test_result_id,
126
126
  step_id=published_measurement_proto.step_id,
127
127
  software_item_ids=published_measurement_proto.software_item_ids,
@@ -156,7 +156,7 @@ class PublishedMeasurement:
156
156
  published_conditions=[
157
157
  condition.to_protobuf() for condition in self.published_conditions
158
158
  ],
159
- published_measurement_id=self.published_measurement_id,
159
+ id=self.id,
160
160
  test_result_id=self.test_result_id,
161
161
  step_id=self.step_id,
162
162
  software_item_ids=self.software_item_ids,
@@ -187,7 +187,7 @@ class PublishedMeasurement:
187
187
  return (
188
188
  self.moniker == other.moniker
189
189
  and self.published_conditions == other.published_conditions
190
- and self.published_measurement_id == other.published_measurement_id
190
+ and self.id == other.id
191
191
  and self.test_result_id == other.test_result_id
192
192
  and self.step_id == other.step_id
193
193
  and self.software_item_ids == other.software_item_ids
@@ -22,7 +22,7 @@ class Step:
22
22
  """Information about a step into which measurements and conditions are published."""
23
23
 
24
24
  __slots__ = (
25
- "step_id",
25
+ "id",
26
26
  "parent_step_id",
27
27
  "test_result_id",
28
28
  "test_id",
@@ -54,7 +54,7 @@ class Step:
54
54
  def __init__(
55
55
  self,
56
56
  *,
57
- step_id: str = "",
57
+ id: str = "",
58
58
  parent_step_id: str = "",
59
59
  test_result_id: str = "",
60
60
  test_id: str = "",
@@ -66,7 +66,7 @@ class Step:
66
66
  schema_id: str = "",
67
67
  ) -> None:
68
68
  """Initialize a Step instance."""
69
- self.step_id = step_id
69
+ self.id = id
70
70
  self.parent_step_id = parent_step_id
71
71
  self.test_result_id = test_result_id
72
72
  self.test_id = test_id
@@ -86,7 +86,7 @@ class Step:
86
86
  def from_protobuf(step_proto: StepProto) -> "Step":
87
87
  """Create a Step instance from a protobuf Step message."""
88
88
  step = Step(
89
- step_id=step_proto.step_id,
89
+ id=step_proto.id,
90
90
  parent_step_id=step_proto.parent_step_id,
91
91
  test_result_id=step_proto.test_result_id,
92
92
  test_id=step_proto.test_id,
@@ -112,7 +112,7 @@ class Step:
112
112
  def to_protobuf(self) -> StepProto:
113
113
  """Convert this Step to a protobuf Step message."""
114
114
  step_proto = StepProto(
115
- step_id=self.step_id,
115
+ id=self.id,
116
116
  parent_step_id=self.parent_step_id,
117
117
  test_result_id=self.test_result_id,
118
118
  test_id=self.test_id,
@@ -138,7 +138,7 @@ class Step:
138
138
  if not isinstance(other, Step):
139
139
  return NotImplemented
140
140
  return (
141
- self.step_id == other.step_id
141
+ self.id == other.id
142
142
  and self.parent_step_id == other.parent_step_id
143
143
  and self.test_result_id == other.test_result_id
144
144
  and self.test_id == other.test_id
@@ -23,7 +23,7 @@ class TestResult:
23
23
  """Information about a test result."""
24
24
 
25
25
  __slots__ = (
26
- "test_result_id",
26
+ "id",
27
27
  "uut_instance_id",
28
28
  "operator_id",
29
29
  "test_station_id",
@@ -78,7 +78,7 @@ class TestResult:
78
78
  def __init__(
79
79
  self,
80
80
  *,
81
- test_result_id: str = "",
81
+ id: str = "",
82
82
  uut_instance_id: str = "",
83
83
  operator_id: str = "",
84
84
  test_station_id: str = "",
@@ -92,7 +92,7 @@ class TestResult:
92
92
  schema_id: str = "",
93
93
  ) -> None:
94
94
  """Initialize a TestResult instance."""
95
- self.test_result_id = test_result_id
95
+ self.id = id
96
96
  self.uut_instance_id = uut_instance_id
97
97
  self.operator_id = operator_id
98
98
  self.test_station_id = test_station_id
@@ -121,7 +121,7 @@ class TestResult:
121
121
  def from_protobuf(test_result_proto: TestResultProto) -> "TestResult":
122
122
  """Create a TestResult instance from a protobuf TestResult message."""
123
123
  test_result = TestResult(
124
- test_result_id=test_result_proto.test_result_id,
124
+ id=test_result_proto.id,
125
125
  uut_instance_id=test_result_proto.uut_instance_id,
126
126
  operator_id=test_result_proto.operator_id,
127
127
  test_station_id=test_result_proto.test_station_id,
@@ -152,7 +152,7 @@ class TestResult:
152
152
  def to_protobuf(self) -> TestResultProto:
153
153
  """Convert this TestResult to a protobuf TestResult message."""
154
154
  test_result_proto = TestResultProto(
155
- test_result_id=self.test_result_id,
155
+ id=self.id,
156
156
  uut_instance_id=self.uut_instance_id,
157
157
  operator_id=self.operator_id,
158
158
  test_station_id=self.test_station_id,
@@ -181,7 +181,7 @@ class TestResult:
181
181
  if not isinstance(other, TestResult):
182
182
  return NotImplemented
183
183
  return (
184
- self.test_result_id == other.test_result_id
184
+ self.id == other.id
185
185
  and self.uut_instance_id == other.uut_instance_id
186
186
  and self.operator_id == other.operator_id
187
187
  and self.test_station_id == other.test_station_id
@@ -17,6 +17,7 @@ class HardwareItem:
17
17
  """Information about a hardware item."""
18
18
 
19
19
  __slots__ = (
20
+ "_id",
20
21
  "manufacturer",
21
22
  "model",
22
23
  "serial_number",
@@ -33,6 +34,11 @@ class HardwareItem:
33
34
  """The extensions of the hardware item."""
34
35
  return self._extensions
35
36
 
37
+ @property
38
+ def id(self) -> str:
39
+ """The string id of the hardware item."""
40
+ return self._id
41
+
36
42
  def __init__(
37
43
  self,
38
44
  *,
@@ -47,6 +53,7 @@ class HardwareItem:
47
53
  schema_id: str = "",
48
54
  ) -> None:
49
55
  """Initialize a HardwareItem instance."""
56
+ self._id = ""
50
57
  self.manufacturer = manufacturer
51
58
  self.model = model
52
59
  self.serial_number = serial_number
@@ -75,11 +82,13 @@ class HardwareItem:
75
82
  populate_from_extension_value_message_map(
76
83
  hardware_item.extensions, hardware_item_proto.extensions
77
84
  )
85
+ hardware_item._id = hardware_item_proto.id
78
86
  return hardware_item
79
87
 
80
88
  def to_protobuf(self) -> HardwareItemProto:
81
89
  """Convert this HardwareItem to a protobuf HardwareItem message."""
82
90
  hardware_item_proto = HardwareItemProto(
91
+ id=self.id,
83
92
  manufacturer=self.manufacturer,
84
93
  model=self.model,
85
94
  serial_number=self.serial_number,
@@ -97,7 +106,8 @@ class HardwareItem:
97
106
  if not isinstance(other, HardwareItem):
98
107
  return NotImplemented
99
108
  return (
100
- self.manufacturer == other.manufacturer
109
+ self.id == other.id
110
+ and self.manufacturer == other.manufacturer
101
111
  and self.model == other.model
102
112
  and self.serial_number == other.serial_number
103
113
  and self.part_number == other.part_number
@@ -17,6 +17,7 @@ class Operator:
17
17
  """Information about an operator."""
18
18
 
19
19
  __slots__ = (
20
+ "_id",
20
21
  "operator_name",
21
22
  "role",
22
23
  "link",
@@ -29,6 +30,11 @@ class Operator:
29
30
  """The extensions of the operator."""
30
31
  return self._extensions
31
32
 
33
+ @property
34
+ def id(self) -> str:
35
+ """The string id of the operator."""
36
+ return self._id
37
+
32
38
  def __init__(
33
39
  self,
34
40
  *,
@@ -39,6 +45,7 @@ class Operator:
39
45
  schema_id: str = "",
40
46
  ) -> None:
41
47
  """Initialize an Operator instance."""
48
+ self._id = ""
42
49
  self.operator_name = operator_name
43
50
  self.role = role
44
51
  self.link = link
@@ -57,11 +64,13 @@ class Operator:
57
64
  schema_id=operator_proto.schema_id,
58
65
  )
59
66
  populate_from_extension_value_message_map(operator.extensions, operator_proto.extensions)
67
+ operator._id = operator_proto.id
60
68
  return operator
61
69
 
62
70
  def to_protobuf(self) -> OperatorProto:
63
71
  """Convert this Operator to a protobuf Operator message."""
64
72
  operator_proto = OperatorProto(
73
+ id=self.id,
65
74
  operator_name=self.operator_name,
66
75
  role=self.role,
67
76
  link=self.link,
@@ -75,7 +84,8 @@ class Operator:
75
84
  if not isinstance(other, Operator):
76
85
  return NotImplemented
77
86
  return (
78
- self.operator_name == other.operator_name
87
+ self.id == other.id
88
+ and self.operator_name == other.operator_name
79
89
  and self.role == other.role
80
90
  and self.link == other.link
81
91
  and self.extensions == other.extensions
@@ -17,6 +17,7 @@ class SoftwareItem:
17
17
  """Information about a software item."""
18
18
 
19
19
  __slots__ = (
20
+ "_id",
20
21
  "product",
21
22
  "version",
22
23
  "link",
@@ -29,6 +30,11 @@ class SoftwareItem:
29
30
  """The extensions of the software item."""
30
31
  return self._extensions
31
32
 
33
+ @property
34
+ def id(self) -> str:
35
+ """The string id of the software item."""
36
+ return self._id
37
+
32
38
  def __init__(
33
39
  self,
34
40
  *,
@@ -39,6 +45,7 @@ class SoftwareItem:
39
45
  schema_id: str = "",
40
46
  ) -> None:
41
47
  """Initialize a SoftwareItem instance."""
48
+ self._id = ""
42
49
  self.product = product
43
50
  self.version = version
44
51
  self.link = link
@@ -59,11 +66,13 @@ class SoftwareItem:
59
66
  populate_from_extension_value_message_map(
60
67
  software_item.extensions, software_item_proto.extensions
61
68
  )
69
+ software_item._id = software_item_proto.id
62
70
  return software_item
63
71
 
64
72
  def to_protobuf(self) -> SoftwareItemProto:
65
73
  """Convert this SoftwareItem to a protobuf SoftwareItem message."""
66
74
  software_item_proto = SoftwareItemProto(
75
+ id=self.id,
67
76
  product=self.product,
68
77
  version=self.version,
69
78
  link=self.link,
@@ -77,7 +86,8 @@ class SoftwareItem:
77
86
  if not isinstance(other, SoftwareItem):
78
87
  return NotImplemented
79
88
  return (
80
- self.product == other.product
89
+ self.id == other.id
90
+ and self.product == other.product
81
91
  and self.version == other.version
82
92
  and self.link == other.link
83
93
  and self.extensions == other.extensions
@@ -17,6 +17,7 @@ class Test:
17
17
  """Information about a test."""
18
18
 
19
19
  __slots__ = (
20
+ "_id",
20
21
  "test_name",
21
22
  "description",
22
23
  "link",
@@ -29,6 +30,11 @@ class Test:
29
30
  """The extensions of the test."""
30
31
  return self._extensions
31
32
 
33
+ @property
34
+ def id(self) -> str:
35
+ """The string id of the test."""
36
+ return self._id
37
+
32
38
  def __init__(
33
39
  self,
34
40
  *,
@@ -39,6 +45,7 @@ class Test:
39
45
  schema_id: str = "",
40
46
  ) -> None:
41
47
  """Initialize a Test instance."""
48
+ self._id = ""
42
49
  self.test_name = test_name
43
50
  self.description = description
44
51
  self.link = link
@@ -57,11 +64,13 @@ class Test:
57
64
  schema_id=test_proto.schema_id,
58
65
  )
59
66
  populate_from_extension_value_message_map(test.extensions, test_proto.extensions)
67
+ test._id = test_proto.id
60
68
  return test
61
69
 
62
70
  def to_protobuf(self) -> TestProto:
63
71
  """Convert this Test to a protobuf Test message."""
64
72
  test_proto = TestProto(
73
+ id=self.id,
65
74
  test_name=self.test_name,
66
75
  description=self.description,
67
76
  link=self.link,
@@ -75,7 +84,8 @@ class Test:
75
84
  if not isinstance(other, Test):
76
85
  return NotImplemented
77
86
  return (
78
- self.test_name == other.test_name
87
+ self.id == other.id
88
+ and self.test_name == other.test_name
79
89
  and self.description == other.description
80
90
  and self.link == other.link
81
91
  and self.extensions == other.extensions
@@ -17,7 +17,8 @@ class TestAdapter:
17
17
  """Information about a test adapter."""
18
18
 
19
19
  __slots__ = (
20
- "test_adapter_name",
20
+ "_id",
21
+ "name",
21
22
  "manufacturer",
22
23
  "model",
23
24
  "serial_number",
@@ -34,10 +35,15 @@ class TestAdapter:
34
35
  """The extensions of the test adapter."""
35
36
  return self._extensions
36
37
 
38
+ @property
39
+ def id(self) -> str:
40
+ """The string id of the test adapter."""
41
+ return self._id
42
+
37
43
  def __init__(
38
44
  self,
39
45
  *,
40
- test_adapter_name: str = "",
46
+ name: str = "",
41
47
  manufacturer: str = "",
42
48
  model: str = "",
43
49
  serial_number: str = "",
@@ -49,7 +55,8 @@ class TestAdapter:
49
55
  schema_id: str = "",
50
56
  ) -> None:
51
57
  """Initialize a TestAdapter instance."""
52
- self.test_adapter_name = test_adapter_name
58
+ self._id = ""
59
+ self.name = name
53
60
  self.manufacturer = manufacturer
54
61
  self.model = model
55
62
  self.serial_number = serial_number
@@ -66,7 +73,7 @@ class TestAdapter:
66
73
  def from_protobuf(test_adapter_proto: TestAdapterProto) -> "TestAdapter":
67
74
  """Create a TestAdapter instance from a protobuf TestAdapter message."""
68
75
  test_adapter = TestAdapter(
69
- test_adapter_name=test_adapter_proto.test_adapter_name,
76
+ name=test_adapter_proto.name,
70
77
  manufacturer=test_adapter_proto.manufacturer,
71
78
  model=test_adapter_proto.model,
72
79
  serial_number=test_adapter_proto.serial_number,
@@ -79,12 +86,14 @@ class TestAdapter:
79
86
  populate_from_extension_value_message_map(
80
87
  test_adapter.extensions, test_adapter_proto.extensions
81
88
  )
89
+ test_adapter._id = test_adapter_proto.id
82
90
  return test_adapter
83
91
 
84
92
  def to_protobuf(self) -> TestAdapterProto:
85
93
  """Convert this TestAdapter to a protobuf TestAdapter message."""
86
94
  test_adapter_proto = TestAdapterProto(
87
- test_adapter_name=self.test_adapter_name,
95
+ id=self.id,
96
+ name=self.name,
88
97
  manufacturer=self.manufacturer,
89
98
  model=self.model,
90
99
  serial_number=self.serial_number,
@@ -102,7 +111,8 @@ class TestAdapter:
102
111
  if not isinstance(other, TestAdapter):
103
112
  return NotImplemented
104
113
  return (
105
- self.test_adapter_name == other.test_adapter_name
114
+ self.id == other.id
115
+ and self.name == other.name
106
116
  and self.manufacturer == other.manufacturer
107
117
  and self.model == other.model
108
118
  and self.serial_number == other.serial_number
@@ -17,6 +17,7 @@ class TestDescription:
17
17
  """Information about a test description."""
18
18
 
19
19
  __slots__ = (
20
+ "_id",
20
21
  "uut_id",
21
22
  "test_description_name",
22
23
  "link",
@@ -29,6 +30,11 @@ class TestDescription:
29
30
  """The extensions of the test description."""
30
31
  return self._extensions
31
32
 
33
+ @property
34
+ def id(self) -> str:
35
+ """The string id of the test description."""
36
+ return self._id
37
+
32
38
  def __init__(
33
39
  self,
34
40
  *,
@@ -39,6 +45,7 @@ class TestDescription:
39
45
  schema_id: str = "",
40
46
  ) -> None:
41
47
  """Initialize a TestDescription instance."""
48
+ self._id = ""
42
49
  self.uut_id = uut_id
43
50
  self.test_description_name = test_description_name
44
51
  self.link = link
@@ -59,11 +66,13 @@ class TestDescription:
59
66
  populate_from_extension_value_message_map(
60
67
  test_description.extensions, test_description_proto.extensions
61
68
  )
69
+ test_description._id = test_description_proto.id
62
70
  return test_description
63
71
 
64
72
  def to_protobuf(self) -> TestDescriptionProto:
65
73
  """Convert this TestDescription to a protobuf TestDescription message."""
66
74
  test_description_proto = TestDescriptionProto(
75
+ id=self.id,
67
76
  uut_id=self.uut_id,
68
77
  test_description_name=self.test_description_name,
69
78
  link=self.link,
@@ -77,7 +86,8 @@ class TestDescription:
77
86
  if not isinstance(other, TestDescription):
78
87
  return NotImplemented
79
88
  return (
80
- self.uut_id == other.uut_id
89
+ self.id == other.id
90
+ and self.uut_id == other.uut_id
81
91
  and self.test_description_name == other.test_description_name
82
92
  and self.link == other.link
83
93
  and self.extensions == other.extensions
@@ -17,6 +17,7 @@ class TestStation:
17
17
  """Information about a test station."""
18
18
 
19
19
  __slots__ = (
20
+ "_id",
20
21
  "test_station_name",
21
22
  "asset_identifier",
22
23
  "link",
@@ -29,6 +30,11 @@ class TestStation:
29
30
  """The extensions of the test station."""
30
31
  return self._extensions
31
32
 
33
+ @property
34
+ def id(self) -> str:
35
+ """The string id of the test station."""
36
+ return self._id
37
+
32
38
  def __init__(
33
39
  self,
34
40
  *,
@@ -39,6 +45,7 @@ class TestStation:
39
45
  schema_id: str = "",
40
46
  ) -> None:
41
47
  """Initialize a TestStation instance."""
48
+ self._id = ""
42
49
  self.test_station_name = test_station_name
43
50
  self.asset_identifier = asset_identifier
44
51
  self.link = link
@@ -59,11 +66,13 @@ class TestStation:
59
66
  populate_from_extension_value_message_map(
60
67
  test_station.extensions, test_station_proto.extensions
61
68
  )
69
+ test_station._id = test_station_proto.id
62
70
  return test_station
63
71
 
64
72
  def to_protobuf(self) -> TestStationProto:
65
73
  """Convert this TestStation to a protobuf TestStation message."""
66
74
  test_station_proto = TestStationProto(
75
+ id=self.id,
67
76
  test_station_name=self.test_station_name,
68
77
  asset_identifier=self.asset_identifier,
69
78
  link=self.link,
@@ -77,7 +86,8 @@ class TestStation:
77
86
  if not isinstance(other, TestStation):
78
87
  return NotImplemented
79
88
  return (
80
- self.test_station_name == other.test_station_name
89
+ self.id == other.id
90
+ and self.test_station_name == other.test_station_name
81
91
  and self.asset_identifier == other.asset_identifier
82
92
  and self.link == other.link
83
93
  and self.extensions == other.extensions
@@ -17,6 +17,7 @@ class Uut:
17
17
  """Information about a Unit Under Test (UUT)."""
18
18
 
19
19
  __slots__ = (
20
+ "_id",
20
21
  "model_name",
21
22
  "family",
22
23
  "_manufacturers",
@@ -36,6 +37,11 @@ class Uut:
36
37
  """The extensions of the UUT."""
37
38
  return self._extensions
38
39
 
40
+ @property
41
+ def id(self) -> str:
42
+ """The string id of the uut."""
43
+ return self._id
44
+
39
45
  def __init__(
40
46
  self,
41
47
  *,
@@ -48,6 +54,7 @@ class Uut:
48
54
  schema_id: str = "",
49
55
  ) -> None:
50
56
  """Initialize a Uut instance."""
57
+ self._id = ""
51
58
  self.model_name = model_name
52
59
  self.family = family
53
60
  self._manufacturers: MutableSequence[str] = (
@@ -72,11 +79,13 @@ class Uut:
72
79
  schema_id=uut_proto.schema_id,
73
80
  )
74
81
  populate_from_extension_value_message_map(uut.extensions, uut_proto.extensions)
82
+ uut._id = uut_proto.id
75
83
  return uut
76
84
 
77
85
  def to_protobuf(self) -> UutProto:
78
86
  """Convert this Uut to a protobuf Uut message."""
79
87
  uut_proto = UutProto(
88
+ id=self.id,
80
89
  model_name=self.model_name,
81
90
  family=self.family,
82
91
  manufacturers=self.manufacturers,
@@ -92,7 +101,8 @@ class Uut:
92
101
  if not isinstance(other, Uut):
93
102
  return NotImplemented
94
103
  return (
95
- self.model_name == other.model_name
104
+ self.id == other.id
105
+ and self.model_name == other.model_name
96
106
  and self.family == other.family
97
107
  and self.manufacturers == other.manufacturers
98
108
  and self.part_number == other.part_number
@@ -17,6 +17,7 @@ class UutInstance:
17
17
  """Information about a Unit Under Test (UUT) instance."""
18
18
 
19
19
  __slots__ = (
20
+ "_id",
20
21
  "uut_id",
21
22
  "serial_number",
22
23
  "manufacture_date",
@@ -32,6 +33,11 @@ class UutInstance:
32
33
  """The extensions of the UUT instance."""
33
34
  return self._extensions
34
35
 
36
+ @property
37
+ def id(self) -> str:
38
+ """The string id of the uut instance."""
39
+ return self._id
40
+
35
41
  def __init__(
36
42
  self,
37
43
  *,
@@ -45,6 +51,7 @@ class UutInstance:
45
51
  schema_id: str = "",
46
52
  ) -> None:
47
53
  """Initialize a UutInstance instance."""
54
+ self._id = ""
48
55
  self.uut_id = uut_id
49
56
  self.serial_number = serial_number
50
57
  self.manufacture_date = manufacture_date
@@ -71,11 +78,13 @@ class UutInstance:
71
78
  populate_from_extension_value_message_map(
72
79
  uut_instance.extensions, uut_instance_proto.extensions
73
80
  )
81
+ uut_instance._id = uut_instance_proto.id
74
82
  return uut_instance
75
83
 
76
84
  def to_protobuf(self) -> UutInstanceProto:
77
85
  """Convert this UutInstance to a protobuf UutInstance message."""
78
86
  uut_instance_proto = UutInstanceProto(
87
+ id=self.id,
79
88
  uut_id=self.uut_id,
80
89
  serial_number=self.serial_number,
81
90
  manufacture_date=self.manufacture_date,
@@ -92,7 +101,8 @@ class UutInstance:
92
101
  if not isinstance(other, UutInstance):
93
102
  return NotImplemented
94
103
  return (
95
- self.uut_id == other.uut_id
104
+ self.id == other.id
105
+ and self.uut_id == other.uut_id
96
106
  and self.serial_number == other.serial_number
97
107
  and self.manufacture_date == other.manufacture_date
98
108
  and self.firmware_version == other.firmware_version