PyAres 0.2.2__tar.gz → 0.3.0__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.
- {pyares-0.2.2 → pyares-0.3.0}/PKG-INFO +3 -3
- {pyares-0.2.2 → pyares-0.3.0}/PyAres/Analyzing/analysis_service.py +9 -27
- {pyares-0.2.2 → pyares-0.3.0}/PyAres/Models/__init__.py +3 -2
- {pyares-0.2.2 → pyares-0.3.0}/PyAres/Models/ares_data_models.py +15 -3
- pyares-0.3.0/PyAres/Utils/ares_data_schema_utils.py +49 -0
- {pyares-0.2.2 → pyares-0.3.0}/PyAres/Utils/ares_data_type_utils.py +4 -6
- {pyares-0.2.2 → pyares-0.3.0}/PyAres/Utils/ares_struct_utils.py +27 -28
- {pyares-0.2.2 → pyares-0.3.0}/PyAres/Utils/ares_value_utils.py +46 -18
- {pyares-0.2.2 → pyares-0.3.0}/pyproject.toml +2 -2
- {pyares-0.2.2 → pyares-0.3.0}/tests/test_analyzer.py +17 -0
- pyares-0.3.0/tests/test_ares_data_schema_utils.py +77 -0
- pyares-0.3.0/tests/test_ares_data_type_utils.py +18 -0
- pyares-0.3.0/tests/test_ares_struct_utils.py +81 -0
- pyares-0.3.0/tests/test_ares_value_type_conversions.py +75 -0
- pyares-0.2.2/PyAres/Utils/ares_data_schema_utils.py +0 -36
- pyares-0.2.2/poetry.lock +0 -188
- {pyares-0.2.2 → pyares-0.3.0}/.github/dependabot.yml +0 -0
- {pyares-0.2.2 → pyares-0.3.0}/.github/workflows/pypi.yaml +0 -0
- {pyares-0.2.2 → pyares-0.3.0}/.github/workflows/python-tests.yaml +0 -0
- {pyares-0.2.2 → pyares-0.3.0}/.gitignore +0 -0
- {pyares-0.2.2 → pyares-0.3.0}/LICENSE +0 -0
- {pyares-0.2.2 → pyares-0.3.0}/PyAres/Analyzing/__init__.py +0 -0
- {pyares-0.2.2 → pyares-0.3.0}/PyAres/Analyzing/analyzer_models.py +0 -0
- {pyares-0.2.2 → pyares-0.3.0}/PyAres/Demo/analyzer_test.py +0 -0
- {pyares-0.2.2 → pyares-0.3.0}/PyAres/Demo/analyzer_test_tools_demo.py +0 -0
- {pyares-0.2.2 → pyares-0.3.0}/PyAres/Demo/analyzer_wiki.py +0 -0
- {pyares-0.2.2 → pyares-0.3.0}/PyAres/Demo/device_test.py +0 -0
- {pyares-0.2.2 → pyares-0.3.0}/PyAres/Demo/hotplate.py +0 -0
- {pyares-0.2.2 → pyares-0.3.0}/PyAres/Demo/planner_test.py +0 -0
- {pyares-0.2.2 → pyares-0.3.0}/PyAres/Demo/planner_test_tools_demo.py +0 -0
- {pyares-0.2.2 → pyares-0.3.0}/PyAres/Demo/planner_wiki.py +0 -0
- {pyares-0.2.2 → pyares-0.3.0}/PyAres/Demo/rotary_mixer.py +0 -0
- {pyares-0.2.2 → pyares-0.3.0}/PyAres/Device/__init__.py +0 -0
- {pyares-0.2.2 → pyares-0.3.0}/PyAres/Device/device_models.py +0 -0
- {pyares-0.2.2 → pyares-0.3.0}/PyAres/Device/device_service.py +0 -0
- {pyares-0.2.2 → pyares-0.3.0}/PyAres/Device/device_warnings.py +0 -0
- {pyares-0.2.2 → pyares-0.3.0}/PyAres/Planning/__init__.py +0 -0
- {pyares-0.2.2 → pyares-0.3.0}/PyAres/Planning/planner_models.py +0 -0
- {pyares-0.2.2 → pyares-0.3.0}/PyAres/Planning/planning_service.py +0 -0
- {pyares-0.2.2 → pyares-0.3.0}/PyAres/Utils/ares_device_command_utils.py +0 -0
- {pyares-0.2.2 → pyares-0.3.0}/PyAres/Utils/ares_outcome_utils.py +0 -0
- {pyares-0.2.2 → pyares-0.3.0}/PyAres/Utils/param_history_info_utils.py +0 -0
- {pyares-0.2.2 → pyares-0.3.0}/PyAres/Utils/plan_request_utils.py +0 -0
- {pyares-0.2.2 → pyares-0.3.0}/PyAres/Utils/plan_response_utils.py +0 -0
- {pyares-0.2.2 → pyares-0.3.0}/PyAres/Utils/planning_param_utils.py +0 -0
- {pyares-0.2.2 → pyares-0.3.0}/PyAres/__init__.py +0 -0
- {pyares-0.2.2 → pyares-0.3.0}/PyAres/test_tools/__init__.py +0 -0
- {pyares-0.2.2 → pyares-0.3.0}/PyAres/test_tools/analyzer_tester.py +0 -0
- {pyares-0.2.2 → pyares-0.3.0}/PyAres/test_tools/planner_tester.py +0 -0
- {pyares-0.2.2 → pyares-0.3.0}/README.md +0 -0
- {pyares-0.2.2 → pyares-0.3.0}/setup.cfg +0 -0
- {pyares-0.2.2 → pyares-0.3.0}/setup.py +0 -0
- {pyares-0.2.2 → pyares-0.3.0}/tests/__init__.py +0 -0
- {pyares-0.2.2 → pyares-0.3.0}/tests/mock_grpc_context.py +0 -0
- {pyares-0.2.2 → pyares-0.3.0}/tests/test_ares_device.py +0 -0
- {pyares-0.2.2 → pyares-0.3.0}/tests/test_planner.py +0 -0
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: PyAres
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
4
4
|
Summary: The official Python library for ARES.
|
|
5
|
-
Project-URL: Homepage, https://github.com/AFRL-ARES
|
|
5
|
+
Project-URL: Homepage, https://github.com/AFRL-ARES/PyAres
|
|
6
6
|
Author-email: AFRL <AFRL.RX.AREScontact@us.af.mil>
|
|
7
7
|
License: MIT
|
|
8
8
|
License-File: LICENSE
|
|
9
9
|
Classifier: Operating System :: OS Independent
|
|
10
10
|
Classifier: Programming Language :: Python :: 3
|
|
11
11
|
Requires-Python: >=3.10
|
|
12
|
-
Requires-Dist: ares-datamodel>=0.
|
|
12
|
+
Requires-Dist: ares-datamodel>=0.16.0
|
|
13
13
|
Requires-Dist: grpcio-tools>=1.75.1
|
|
14
14
|
Requires-Dist: grpcio<2.0.0,>=1.71.0
|
|
15
15
|
Description-Content-Type: text/markdown
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Standard Imports
|
|
2
2
|
import grpc
|
|
3
3
|
from concurrent import futures
|
|
4
|
-
from typing import Callable, Awaitable, Union, Mapping, Dict
|
|
4
|
+
from typing import Callable, Awaitable, Union, Mapping, Dict, Optional
|
|
5
5
|
|
|
6
6
|
# Import generated protobuf and gRPC stubs
|
|
7
7
|
from ares_datamodel.analyzing.remote import ares_remote_analyzer_service_pb2 as analyzer_service
|
|
@@ -22,6 +22,7 @@ from ..Utils import ares_outcome_utils
|
|
|
22
22
|
|
|
23
23
|
# Import python models
|
|
24
24
|
from ..Models import ares_data_models, RequestMetadata
|
|
25
|
+
from ..Models import AresSchemaEntry
|
|
25
26
|
from .analyzer_models import AnalysisRequest, Analysis, InfoResponse
|
|
26
27
|
|
|
27
28
|
# Type hints for the user's custom logic
|
|
@@ -120,14 +121,7 @@ class AresAnalyzerServiceWrapper(analyzer_service_grpc.AresRemoteAnalyzerService
|
|
|
120
121
|
try:
|
|
121
122
|
for(key, value) in self._settings.items():
|
|
122
123
|
settings_entry = capabilities.settings_schema.fields[key]
|
|
123
|
-
settings_entry.
|
|
124
|
-
settings_entry.optional = value.optional
|
|
125
|
-
|
|
126
|
-
if len(value.string_choices.strings) != 0:
|
|
127
|
-
settings_entry.string_choices.strings.extend(value.string_choices.strings)
|
|
128
|
-
|
|
129
|
-
elif len(value.number_choices.numbers) != 0:
|
|
130
|
-
settings_entry.number_choices.numbers.extend(value.number_choices.numbers)
|
|
124
|
+
settings_entry.CopyFrom(value)
|
|
131
125
|
|
|
132
126
|
return capabilities
|
|
133
127
|
|
|
@@ -143,24 +137,19 @@ class AresAnalyzerServiceWrapper(analyzer_service_grpc.AresRemoteAnalyzerService
|
|
|
143
137
|
print(f"Exception while trying to respond to ARES with connection status! {e}")
|
|
144
138
|
|
|
145
139
|
def ValidateInputs(self, request: analyzer_service.ParameterValidationRequest, context):
|
|
146
|
-
print("Validating Inputs")
|
|
147
140
|
response = analyzer_service.ParameterValidationResult(success=True)
|
|
148
141
|
provided_params: Mapping[str, ares_data_schema_pb2.SchemaEntry] = request.input_schema.fields
|
|
149
142
|
|
|
150
143
|
for stored_key, stored_schema in self._analysis_parameters.items():
|
|
151
|
-
print(f"LOOKING AT {stored_key}")
|
|
152
144
|
if stored_key in provided_params:
|
|
153
145
|
matching_schema = provided_params[stored_key]
|
|
154
146
|
if stored_schema.type != matching_schema.type:
|
|
155
|
-
print(f" THIS IS THE TYPE RIGHT HERE LOOK AT IT: {type(matching_schema)}")
|
|
156
147
|
message = f"Schema Mismatch! {stored_key} was provided with the value type {stored_schema.type}, but the value type {matching_schema} was expected!"
|
|
157
148
|
response.messages.append(message)
|
|
158
|
-
print(message)
|
|
159
149
|
else:
|
|
160
150
|
if not stored_schema.optional:
|
|
161
151
|
message = f"Schema Missing! {stored_key} is marked as a required piece of data for analysis, but no assignment was found in the provided schema!"
|
|
162
152
|
response.messages.append(message)
|
|
163
|
-
print(message)
|
|
164
153
|
|
|
165
154
|
if len(response.messages) != 0:
|
|
166
155
|
response.success = False
|
|
@@ -211,7 +200,7 @@ class AresAnalyzerService:
|
|
|
211
200
|
else:
|
|
212
201
|
self._server.add_insecure_port(f'[::]:{self._port}')
|
|
213
202
|
|
|
214
|
-
def add_setting(self, setting_name: str, setting_type: ares_data_models.AresDataType, optional: bool = True, constraints: Union[list[int], list[str], list[float]] = []):
|
|
203
|
+
def add_setting(self, setting_name: str, setting_type: ares_data_models.AresDataType, optional: bool = True, constraints: Union[list[int], list[str], list[float]] = [], struct_schema: Optional[Dict[str, AresSchemaEntry]] = None):
|
|
215
204
|
"""
|
|
216
205
|
Adds an analyzer setting to be reported to ARES when capabilities are requested.
|
|
217
206
|
While most `PyAres.Models.AresDataType` options are supported, bool arrays and byte arrays
|
|
@@ -222,10 +211,11 @@ class AresAnalyzerService:
|
|
|
222
211
|
setting_type (AresDataType): The type of this settings value.
|
|
223
212
|
optional (bool): Whether the setting is optional.
|
|
224
213
|
constraints: An optional list of values to constrain the available setting choices. Can be integers, strings, or floats.
|
|
214
|
+
struct_schema: An optional dictionary defining the fields of a STRUCT type setting, using AresSchemaEntry objects.
|
|
225
215
|
"""
|
|
226
|
-
self._service_wrapper._settings[setting_name] = ares_data_schema_utils.create_settings_schema_entry(setting_type, optional, constraints)
|
|
216
|
+
self._service_wrapper._settings[setting_name] = ares_data_schema_utils.create_settings_schema_entry(setting_type, optional, constraints, struct_schema)
|
|
227
217
|
|
|
228
|
-
def add_analysis_parameter(self, parameter_name: str, parameter_type: ares_data_models.AresDataType, optional: bool = False):
|
|
218
|
+
def add_analysis_parameter(self, parameter_name: str, parameter_type: ares_data_models.AresDataType, optional: bool = False, struct_schema: Optional[Dict[str, AresSchemaEntry]] = None):
|
|
229
219
|
"""
|
|
230
220
|
Adds an analysis parameter that will be reported to ARES. Analysis parameters are inputs your analyzer accepts from ARES, and will be mapped to command outputs
|
|
231
221
|
in experiment scripts.
|
|
@@ -234,8 +224,9 @@ class AresAnalyzerService:
|
|
|
234
224
|
parameter_name (str): The name of the parameter being created.
|
|
235
225
|
parameter_type (AresDataType): The type associated with the new parameter.
|
|
236
226
|
optional (bool): Defaults to false. Determines whether your analyzer requires this information.
|
|
227
|
+
struct_schema: An optional dictionary defining the fields of a STRUCT type parameter, using AresSchemaEntry objects.
|
|
237
228
|
"""
|
|
238
|
-
self._service_wrapper._analysis_parameters[parameter_name] = ares_data_schema_utils.create_settings_schema_entry(parameter_type, optional, [])
|
|
229
|
+
self._service_wrapper._analysis_parameters[parameter_name] = ares_data_schema_utils.create_settings_schema_entry(parameter_type, optional, [], struct_schema)
|
|
239
230
|
|
|
240
231
|
def set_timeout(self, new_timeout: int):
|
|
241
232
|
"""
|
|
@@ -268,12 +259,3 @@ class AresAnalyzerService:
|
|
|
268
259
|
"""
|
|
269
260
|
print("Stopping Ares Analyzer Service...")
|
|
270
261
|
self._server.stop(0).wait()
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
from .ares_data_models import AresDataType, Outcome, RequestMetadata
|
|
1
|
+
from .ares_data_models import AresDataType, Outcome, RequestMetadata, AresSchemaEntry
|
|
2
2
|
|
|
3
3
|
__all__ = [
|
|
4
4
|
"AresDataType",
|
|
5
5
|
"Outcome",
|
|
6
|
-
"RequestMetadata"
|
|
6
|
+
"RequestMetadata",
|
|
7
|
+
"AresSchemaEntry"
|
|
7
8
|
]
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
from ares_datamodel import request_metadata_pb2
|
|
2
2
|
from enum import Enum
|
|
3
|
+
from dataclasses import dataclass, field
|
|
4
|
+
from typing import Union, List, Optional, Dict
|
|
3
5
|
|
|
4
6
|
class AresDataType(Enum):
|
|
5
7
|
UNKNOWN = 0
|
|
@@ -9,8 +11,9 @@ class AresDataType(Enum):
|
|
|
9
11
|
NUMBER = 4
|
|
10
12
|
STRING_ARRAY = 5
|
|
11
13
|
NUMBER_ARRAY = 6
|
|
12
|
-
|
|
13
|
-
|
|
14
|
+
LIST = 7
|
|
15
|
+
STRUCT = 8
|
|
16
|
+
BYTE_ARRAY = 9
|
|
14
17
|
|
|
15
18
|
class Outcome(Enum):
|
|
16
19
|
UNSPECIFIED_OUTCOME = 0
|
|
@@ -30,4 +33,13 @@ class RequestMetadata():
|
|
|
30
33
|
def from_default_values(cls):
|
|
31
34
|
""" Alternative constructor for creating fake metadata """
|
|
32
35
|
default = request_metadata_pb2.RequestMetadata(system_name="TEST SYSTEM", campaign_name="TEST CAMPAIGN", campaign_id="TEST ID", experiment_id="TEST EXPERIMENT ID")
|
|
33
|
-
return cls(default)
|
|
36
|
+
return cls(default)
|
|
37
|
+
|
|
38
|
+
@dataclass
|
|
39
|
+
class AresSchemaEntry:
|
|
40
|
+
type: AresDataType
|
|
41
|
+
optional: bool = False
|
|
42
|
+
description: str = ""
|
|
43
|
+
unit: str = ""
|
|
44
|
+
choices: Union[List[str], List[int], List[float]] = field(default_factory=list)
|
|
45
|
+
struct_schema: Optional[Dict[str, 'AresSchemaEntry']] = None
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
from typing import Union, Dict, Optional, List
|
|
2
|
+
from ares_datamodel import ares_data_schema_pb2
|
|
3
|
+
from ..Models import ares_data_models
|
|
4
|
+
from ..Models.ares_data_models import AresSchemaEntry
|
|
5
|
+
|
|
6
|
+
def convert_ares_schema_entry_to_proto(entry: AresSchemaEntry) -> ares_data_schema_pb2.SchemaEntry:
|
|
7
|
+
proto_entry = create_settings_schema_entry(entry.type, entry.optional, entry.choices, entry.struct_schema)
|
|
8
|
+
proto_entry.description = entry.description
|
|
9
|
+
proto_entry.unit = entry.unit
|
|
10
|
+
return proto_entry
|
|
11
|
+
|
|
12
|
+
def create_settings_schema_entry(
|
|
13
|
+
setting_type: ares_data_models.AresDataType,
|
|
14
|
+
optional: bool,
|
|
15
|
+
choices: Union[list[str], list[int], list[float]],
|
|
16
|
+
struct_schema: Optional[Dict[str, AresSchemaEntry]] = None) -> ares_data_schema_pb2.SchemaEntry:
|
|
17
|
+
"""
|
|
18
|
+
Creates a protobuf SchemaEntry message from the provided setting details.
|
|
19
|
+
|
|
20
|
+
Args:
|
|
21
|
+
setting_type (AresDataType): The data type of the setting.
|
|
22
|
+
optional (bool): Whether the setting is optional.
|
|
23
|
+
choices (Union[list[str], list[int], list[float]]): A list of valid choices for the setting.
|
|
24
|
+
struct_schema (Optional[Dict[str, AresSchemaEntry]]): Nested schema definition for STRUCT types.
|
|
25
|
+
|
|
26
|
+
Returns:
|
|
27
|
+
(SchemaEntry): A new SchemaEntry message.
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
if(isinstance(choices, list)):
|
|
31
|
+
if(len(choices) == 0):
|
|
32
|
+
schema_entry = ares_data_schema_pb2.SchemaEntry(type=setting_type.value, optional=optional)
|
|
33
|
+
|
|
34
|
+
elif(all(isinstance(item, str) for item in choices)):
|
|
35
|
+
schema_entry = ares_data_schema_pb2.SchemaEntry(type=setting_type.value, optional=optional)
|
|
36
|
+
schema_entry.string_choices.strings.extend(choices)
|
|
37
|
+
|
|
38
|
+
elif(all(isinstance(item, (int, float)) for item in choices)):
|
|
39
|
+
schema_entry = ares_data_schema_pb2.SchemaEntry(type=setting_type.value, optional=optional)
|
|
40
|
+
schema_entry.number_choices.numbers.extend(choices)
|
|
41
|
+
|
|
42
|
+
else:
|
|
43
|
+
schema_entry = ares_data_schema_pb2.SchemaEntry(type=setting_type.value, optional=optional)
|
|
44
|
+
|
|
45
|
+
if struct_schema is not None:
|
|
46
|
+
for key, value in struct_schema.items():
|
|
47
|
+
schema_entry.struct_schema.fields[key].CopyFrom(convert_ares_schema_entry_to_proto(value))
|
|
48
|
+
|
|
49
|
+
return schema_entry
|
|
@@ -17,21 +17,19 @@ def determine_python_ares_data_type(value: Union[int, float, str, bool, list]):
|
|
|
17
17
|
case str():
|
|
18
18
|
return AresDataType.STRING
|
|
19
19
|
case bool():
|
|
20
|
-
# Boolean is a subtype of int, meaning we have to check if it's a bool
|
|
21
|
-
# before we check if it's an int, otherwise every bool would return an int instead.
|
|
22
20
|
return AresDataType.BOOLEAN
|
|
23
21
|
case int():
|
|
24
22
|
return AresDataType.NUMBER
|
|
25
23
|
case float():
|
|
26
24
|
return AresDataType.NUMBER
|
|
27
25
|
case list():
|
|
28
|
-
if(all(isinstance(x,
|
|
26
|
+
if(all(isinstance(x, bool) for x in value)):
|
|
27
|
+
return AresDataType.LIST
|
|
28
|
+
elif(all(isinstance(x, str) for x in value)):
|
|
29
29
|
return AresDataType.STRING_ARRAY
|
|
30
30
|
elif(all(isinstance(x, (int, float)) for x in value)):
|
|
31
31
|
return AresDataType.NUMBER_ARRAY
|
|
32
|
-
elif(all(isinstance(x, bool) for x in value)):
|
|
33
|
-
return AresDataType.BOOL_ARRAY
|
|
34
32
|
else:
|
|
35
|
-
return AresDataType.
|
|
33
|
+
return AresDataType.LIST
|
|
36
34
|
case _:
|
|
37
35
|
return AresDataType.UNKNOWN
|
|
@@ -33,7 +33,8 @@ def create_string_struct(key: str, value: str) -> ares_struct_pb2.AresStruct:
|
|
|
33
33
|
(AresStruct): A new AresStruct containing the provided key and value.
|
|
34
34
|
"""
|
|
35
35
|
new_struct = ares_struct_pb2.AresStruct()
|
|
36
|
-
new_struct.fields[key]
|
|
36
|
+
new_entry = new_struct.fields[key]
|
|
37
|
+
new_entry.CopyFrom(ares_value_utils.create_string(value))
|
|
37
38
|
return new_struct
|
|
38
39
|
|
|
39
40
|
def create_number_struct(key: str, value: Union[int, float]) -> ares_struct_pb2.AresStruct:
|
|
@@ -48,7 +49,8 @@ def create_number_struct(key: str, value: Union[int, float]) -> ares_struct_pb2.
|
|
|
48
49
|
(AresStruct): A new AresStruct containing the provided key and value.
|
|
49
50
|
"""
|
|
50
51
|
new_struct = ares_struct_pb2.AresStruct()
|
|
51
|
-
new_struct.fields[key]
|
|
52
|
+
new_entry = new_struct.fields[key]
|
|
53
|
+
new_entry.CopyFrom(ares_value_utils.create_number(value))
|
|
52
54
|
return new_struct
|
|
53
55
|
|
|
54
56
|
def create_bool_struct(key: str, value: bool) -> ares_struct_pb2.AresStruct:
|
|
@@ -63,7 +65,8 @@ def create_bool_struct(key: str, value: bool) -> ares_struct_pb2.AresStruct:
|
|
|
63
65
|
(AresStruct): A new AresStruct containing the provided key and value.
|
|
64
66
|
"""
|
|
65
67
|
new_struct = ares_struct_pb2.AresStruct()
|
|
66
|
-
new_struct.fields[key]
|
|
68
|
+
new_entry = new_struct.fields[key]
|
|
69
|
+
new_entry.CopyFrom(ares_value_utils.create_bool(value))
|
|
67
70
|
return new_struct
|
|
68
71
|
|
|
69
72
|
def create_null_struct(key: str) -> ares_struct_pb2.AresStruct:
|
|
@@ -77,7 +80,8 @@ def create_null_struct(key: str) -> ares_struct_pb2.AresStruct:
|
|
|
77
80
|
(AresStruct): A new AresStruct containing the provided key and a null value.
|
|
78
81
|
"""
|
|
79
82
|
new_struct = ares_struct_pb2.AresStruct()
|
|
80
|
-
new_struct.fields[key]
|
|
83
|
+
new_entry = new_struct.fields[key]
|
|
84
|
+
new_entry.CopyFrom(ares_value_utils.create_null())
|
|
81
85
|
return new_struct
|
|
82
86
|
|
|
83
87
|
def create_string_array_struct(key: str, value: list[str]) -> ares_struct_pb2.AresStruct:
|
|
@@ -92,7 +96,8 @@ def create_string_array_struct(key: str, value: list[str]) -> ares_struct_pb2.Ar
|
|
|
92
96
|
(AresStruct): A new AresStruct containing the provided key and value
|
|
93
97
|
"""
|
|
94
98
|
new_struct = ares_struct_pb2.AresStruct()
|
|
95
|
-
new_struct.fields[key]
|
|
99
|
+
new_entry = new_struct.fields[key]
|
|
100
|
+
new_entry.CopyFrom(ares_value_utils.create_string_array(value))
|
|
96
101
|
return new_struct
|
|
97
102
|
|
|
98
103
|
def create_number_array_struct(key: str, value: list[Union[int, float]]) -> ares_struct_pb2.AresStruct:
|
|
@@ -107,22 +112,8 @@ def create_number_array_struct(key: str, value: list[Union[int, float]]) -> ares
|
|
|
107
112
|
(AresStruct): A new AresStruct containing the provided key and value
|
|
108
113
|
"""
|
|
109
114
|
new_struct = ares_struct_pb2.AresStruct()
|
|
110
|
-
new_struct.fields[key]
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
def create_bool_array_struct(key: str, value: list[bool]) -> ares_struct_pb2.AresStruct:
|
|
114
|
-
"""
|
|
115
|
-
Creates a new AresStruct with a bool array initialized using the provided key and value.
|
|
116
|
-
|
|
117
|
-
Args:
|
|
118
|
-
key (str): The associated key to be used when storing the given value.
|
|
119
|
-
value (list[bool]): The list of bools to be stored in the new AresStruct.
|
|
120
|
-
|
|
121
|
-
Returns:
|
|
122
|
-
(AresStruct): A new AresStruct containing the provided key and value
|
|
123
|
-
"""
|
|
124
|
-
new_struct = ares_struct_pb2.AresStruct()
|
|
125
|
-
new_struct.fields[key] = ares_value_utils.create_bool_array(value)
|
|
115
|
+
new_entry = new_struct.fields[key]
|
|
116
|
+
new_entry.CopyFrom(ares_value_utils.create_number_array(value))
|
|
126
117
|
return new_struct
|
|
127
118
|
|
|
128
119
|
def create_bytes_array_struct(key: str, value: bytes) -> ares_struct_pb2.AresStruct:
|
|
@@ -137,7 +128,8 @@ def create_bytes_array_struct(key: str, value: bytes) -> ares_struct_pb2.AresStr
|
|
|
137
128
|
(AresStruct): A new AresStruct containing the provided key and value
|
|
138
129
|
"""
|
|
139
130
|
new_struct = ares_struct_pb2.AresStruct()
|
|
140
|
-
new_struct.fields[key]
|
|
131
|
+
new_entry = new_struct.fields[key]
|
|
132
|
+
new_entry.CopyFrom(ares_value_utils.create_bytes(value))
|
|
141
133
|
return new_struct
|
|
142
134
|
|
|
143
135
|
def add_value_to_struct(existing_struct: ares_struct_pb2.AresStruct, key: str, new_value: ares_struct_pb2.AresValue, replace: bool = True) -> ares_struct_pb2.AresStruct:
|
|
@@ -180,7 +172,7 @@ def create_empty_struct() -> ares_struct_pb2.AresStruct:
|
|
|
180
172
|
"""
|
|
181
173
|
return ares_struct_pb2.AresStruct()
|
|
182
174
|
|
|
183
|
-
def create_ares_struct(key: str, value: Any):
|
|
175
|
+
def create_ares_struct(key: str, value: Any) -> ares_struct_pb2.AresStruct:
|
|
184
176
|
"""
|
|
185
177
|
Creates a new AresStruct using the provided key and value.
|
|
186
178
|
|
|
@@ -208,17 +200,24 @@ def create_ares_struct(key: str, value: Any):
|
|
|
208
200
|
if(len(value) == 0):
|
|
209
201
|
return create_null_struct(key)
|
|
210
202
|
|
|
203
|
+
#Specifically placed here to catch bools before ints, as otherwise python with treat them as ints instead
|
|
204
|
+
elif(all(isinstance(item, bool) for item in value)):
|
|
205
|
+
new_struct = ares_struct_pb2.AresStruct()
|
|
206
|
+
new_struct.fields[key].CopyFrom(ares_value_utils.create_array(value))
|
|
207
|
+
return new_struct
|
|
208
|
+
|
|
211
209
|
elif(all(isinstance(item, str) for item in value)):
|
|
212
210
|
return create_string_array_struct(key, value)
|
|
213
211
|
|
|
214
212
|
elif(all(isinstance(item, (float, int)) for item in value)):
|
|
215
213
|
return create_number_array_struct(key, value)
|
|
216
214
|
|
|
217
|
-
|
|
218
|
-
|
|
215
|
+
else:
|
|
216
|
+
new_struct = ares_struct_pb2.AresStruct()
|
|
217
|
+
new_struct.fields[key].CopyFrom(ares_value_utils.create_array(value))
|
|
218
|
+
return new_struct
|
|
219
219
|
|
|
220
|
-
else:
|
|
221
|
-
return create_null_struct(key)
|
|
222
|
-
|
|
223
220
|
|
|
221
|
+
return create_null_struct(key)
|
|
224
222
|
|
|
223
|
+
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from ares_datamodel import ares_struct_pb2
|
|
2
2
|
from ares_datamodel import ares_data_type_pb2
|
|
3
|
-
from typing import Union, Any
|
|
3
|
+
from typing import Union, Any, Dict
|
|
4
4
|
|
|
5
5
|
from . import ares_data_type_utils
|
|
6
6
|
from ..Models import AresDataType
|
|
@@ -37,8 +37,9 @@ def py_to_ares_value(py_value, ares_value: ares_struct_pb2.AresValue):
|
|
|
37
37
|
ares_value.string_array_value.strings.extend(py_value)
|
|
38
38
|
elif(all(isinstance(x, (int, float)) for x in py_value)):
|
|
39
39
|
ares_value.number_array_value.numbers.extend(py_value)
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
else:
|
|
41
|
+
for item in py_value:
|
|
42
|
+
ares_value.list_value.values.append(create_ares_value(item))
|
|
42
43
|
else:
|
|
43
44
|
raise TypeError(f"Unsupported type for AresValue: {type(py_value)}")
|
|
44
45
|
|
|
@@ -125,18 +126,39 @@ def create_bytes(value: bytes) -> ares_struct_pb2.AresValue:
|
|
|
125
126
|
"""
|
|
126
127
|
return ares_struct_pb2.AresValue(bytes_value=value)
|
|
127
128
|
|
|
128
|
-
def
|
|
129
|
+
def create_array(values: list[Any]) -> ares_struct_pb2.AresValue:
|
|
129
130
|
"""
|
|
130
|
-
Creates a new AresValue, initialized to the provided list of
|
|
131
|
+
Creates a new AresValue, initialized to the provided list of AresValues.
|
|
131
132
|
|
|
132
133
|
Args:
|
|
133
|
-
value (list[
|
|
134
|
+
value (list[Any]): The list of values to be stored in the new AresValue.
|
|
134
135
|
|
|
135
136
|
Returns:
|
|
136
|
-
(AresValue): A new AresValue containing the provided list of
|
|
137
|
+
(AresValue): A new AresValue containing the provided list of values.
|
|
137
138
|
"""
|
|
138
139
|
ares_value = ares_struct_pb2.AresValue()
|
|
139
|
-
|
|
140
|
+
for item in values:
|
|
141
|
+
ares_value.list_value.values.append(create_ares_value(item))
|
|
142
|
+
|
|
143
|
+
return ares_value
|
|
144
|
+
|
|
145
|
+
def create_struct(values: Dict) -> ares_struct_pb2.AresValue:
|
|
146
|
+
"""
|
|
147
|
+
Creates a new AresValue, initialized with an AresStruct.
|
|
148
|
+
|
|
149
|
+
Args:
|
|
150
|
+
value (Dict): The dictionary of values to be added to the AresStruct.
|
|
151
|
+
|
|
152
|
+
Returns:
|
|
153
|
+
(AresValue): A new AresValue containing the provided dictionaries values in an AresStruct.
|
|
154
|
+
"""
|
|
155
|
+
ares_value = ares_struct_pb2.AresValue()
|
|
156
|
+
|
|
157
|
+
for key, value in values.items():
|
|
158
|
+
new_entry = ares_value.struct_value.fields[key]
|
|
159
|
+
new_entry.CopyFrom(create_ares_value(value))
|
|
160
|
+
|
|
161
|
+
|
|
140
162
|
return ares_value
|
|
141
163
|
|
|
142
164
|
def create_default(python_datatype: AresDataType) -> ares_struct_pb2.AresValue:
|
|
@@ -169,11 +191,14 @@ def create_default(python_datatype: AresDataType) -> ares_struct_pb2.AresValue:
|
|
|
169
191
|
elif(dataType == ares_data_type_pb2.AresDataType.NUMBER_ARRAY):
|
|
170
192
|
return create_number_array([])
|
|
171
193
|
|
|
172
|
-
elif(dataType == ares_data_type_pb2.AresDataType.
|
|
173
|
-
return
|
|
194
|
+
elif(dataType == ares_data_type_pb2.AresDataType.LIST):
|
|
195
|
+
return create_array([])
|
|
174
196
|
|
|
175
197
|
elif(dataType == ares_data_type_pb2.AresDataType.BYTE_ARRAY):
|
|
176
198
|
return create_bytes(bytes())
|
|
199
|
+
|
|
200
|
+
elif(dataType == ares_data_type_pb2.AresDataType.STRUCT):
|
|
201
|
+
return create_struct({})
|
|
177
202
|
else:
|
|
178
203
|
return create_null()
|
|
179
204
|
|
|
@@ -191,27 +216,30 @@ def create_ares_value(value: Any) -> ares_struct_pb2.AresValue:
|
|
|
191
216
|
if(isinstance(value, str)):
|
|
192
217
|
return create_string(value)
|
|
193
218
|
|
|
194
|
-
elif(isinstance(value, (int, float))):
|
|
195
|
-
return create_number(value)
|
|
196
|
-
|
|
197
219
|
elif(isinstance(value, bool)):
|
|
198
220
|
return create_bool(value)
|
|
221
|
+
|
|
222
|
+
elif(isinstance(value, (int, float))):
|
|
223
|
+
return create_number(value)
|
|
199
224
|
|
|
200
225
|
elif(isinstance(value, bytes)):
|
|
201
226
|
return create_bytes(value)
|
|
202
227
|
|
|
203
228
|
elif(isinstance(value, list)):
|
|
204
|
-
if all(isinstance(x,
|
|
229
|
+
if all(isinstance(x, bool) for x in value):
|
|
230
|
+
return create_array(value)
|
|
231
|
+
|
|
232
|
+
elif all(isinstance(x, (int, float)) for x in value):
|
|
205
233
|
return create_number_array(value)
|
|
206
234
|
|
|
207
235
|
elif all(isinstance(x, str) for x in value):
|
|
208
236
|
return create_string_array(value)
|
|
209
237
|
|
|
210
|
-
elif all(isinstance(x, bool) for x in value):
|
|
211
|
-
return create_bool_array(value)
|
|
212
|
-
|
|
213
238
|
else:
|
|
214
|
-
return
|
|
239
|
+
return create_array(value)
|
|
240
|
+
|
|
241
|
+
elif(isinstance(value, Dict)):
|
|
242
|
+
return create_struct(value)
|
|
215
243
|
|
|
216
244
|
else:
|
|
217
245
|
return create_null()
|
|
@@ -18,11 +18,11 @@ classifiers = [
|
|
|
18
18
|
dependencies = [
|
|
19
19
|
"grpcio-tools >= 1.75.1",
|
|
20
20
|
"grpcio >= 1.71.0, < 2.0.0",
|
|
21
|
-
"ares-datamodel >= 0.
|
|
21
|
+
"ares-datamodel >= 0.16.0",
|
|
22
22
|
]
|
|
23
23
|
|
|
24
24
|
[project.urls]
|
|
25
|
-
Homepage = "https://github.com/AFRL-ARES"
|
|
25
|
+
Homepage = "https://github.com/AFRL-ARES/PyAres"
|
|
26
26
|
|
|
27
27
|
[tool.hatch.version]
|
|
28
28
|
source = "env"
|
|
@@ -71,15 +71,32 @@ class TestAresAnalyzerService(unittest.TestCase):
|
|
|
71
71
|
# Add an Input Parameter (e.g., 'Image')
|
|
72
72
|
self.service.add_analysis_parameter("InputImage", ares_data_models.AresDataType.STRING, optional=False)
|
|
73
73
|
|
|
74
|
+
# Add a Struct Setting
|
|
75
|
+
nested_schema = {
|
|
76
|
+
"SubField": ares_data_models.AresSchemaEntry(
|
|
77
|
+
type=ares_data_models.AresDataType.STRING,
|
|
78
|
+
description="A nested field"
|
|
79
|
+
)
|
|
80
|
+
}
|
|
81
|
+
self.service.add_setting("Complex Setting", ares_data_models.AresDataType.STRUCT, optional=True, struct_schema=nested_schema)
|
|
82
|
+
|
|
74
83
|
# Verify internal storage
|
|
75
84
|
self.assertIn("Threshold", self.service._service_wrapper._settings)
|
|
76
85
|
self.assertIn("InputImage", self.service._service_wrapper._analysis_parameters)
|
|
86
|
+
self.assertIn("Complex Setting", self.service._service_wrapper._settings)
|
|
77
87
|
|
|
78
88
|
# Verify capabilities response
|
|
79
89
|
caps = self.service._service_wrapper.GetAnalyzerCapabilities(None, None)
|
|
80
90
|
self.assertIn("Threshold", caps.settings_schema.fields)
|
|
81
91
|
self.assertEqual(caps.settings_schema.fields["Threshold"].type, ares_data_type_pb2.AresDataType.NUMBER)
|
|
82
92
|
|
|
93
|
+
# Verify Struct in response
|
|
94
|
+
self.assertIn("Complex Setting", caps.settings_schema.fields)
|
|
95
|
+
complex_field = caps.settings_schema.fields["Complex Setting"]
|
|
96
|
+
self.assertEqual(complex_field.type, ares_data_type_pb2.AresDataType.STRUCT)
|
|
97
|
+
self.assertIn("SubField", complex_field.struct_schema.fields)
|
|
98
|
+
self.assertEqual(complex_field.struct_schema.fields["SubField"].type, ares_data_type_pb2.AresDataType.STRING)
|
|
99
|
+
|
|
83
100
|
def test_validation_logic(self):
|
|
84
101
|
"""Test that the service correctly validates incoming input schemas."""
|
|
85
102
|
self.service = AresAnalyzerService(self.analyze_func, self.analyzer_name, self.analyzer_version, port=0)
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import unittest
|
|
2
|
+
from PyAres.Utils import ares_data_schema_utils
|
|
3
|
+
from PyAres.Models import AresDataType, AresSchemaEntry
|
|
4
|
+
from ares_datamodel import ares_data_type_pb2
|
|
5
|
+
|
|
6
|
+
class TestAresDataSchemaUtils(unittest.TestCase):
|
|
7
|
+
def test_create_simple_entry(self):
|
|
8
|
+
entry = ares_data_schema_utils.create_settings_schema_entry(
|
|
9
|
+
AresDataType.STRING,
|
|
10
|
+
optional=True,
|
|
11
|
+
choices=[]
|
|
12
|
+
)
|
|
13
|
+
self.assertEqual(entry.type, ares_data_type_pb2.AresDataType.STRING)
|
|
14
|
+
self.assertTrue(entry.optional)
|
|
15
|
+
|
|
16
|
+
def test_create_entry_with_string_choices(self):
|
|
17
|
+
choices = ["A", "B"]
|
|
18
|
+
entry = ares_data_schema_utils.create_settings_schema_entry(
|
|
19
|
+
AresDataType.STRING,
|
|
20
|
+
optional=False,
|
|
21
|
+
choices=choices
|
|
22
|
+
)
|
|
23
|
+
self.assertEqual(entry.string_choices.strings, choices)
|
|
24
|
+
|
|
25
|
+
def test_create_entry_with_number_choices(self):
|
|
26
|
+
choices = [1, 2.0]
|
|
27
|
+
entry = ares_data_schema_utils.create_settings_schema_entry(
|
|
28
|
+
AresDataType.NUMBER,
|
|
29
|
+
optional=False,
|
|
30
|
+
choices=choices
|
|
31
|
+
)
|
|
32
|
+
self.assertEqual(entry.number_choices.numbers, choices)
|
|
33
|
+
|
|
34
|
+
def test_create_entry_with_mixed_choices(self):
|
|
35
|
+
# Should result in no choices being set if types are mixed
|
|
36
|
+
choices = ["A", 1]
|
|
37
|
+
entry = ares_data_schema_utils.create_settings_schema_entry(
|
|
38
|
+
AresDataType.STRING,
|
|
39
|
+
optional=False,
|
|
40
|
+
choices=choices
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
self.assertEqual(len(entry.string_choices.strings), 0)
|
|
44
|
+
self.assertEqual(len(entry.number_choices.numbers), 0)
|
|
45
|
+
|
|
46
|
+
def test_convert_ares_schema_entry_to_proto(self):
|
|
47
|
+
py_entry = AresSchemaEntry(
|
|
48
|
+
type=AresDataType.NUMBER,
|
|
49
|
+
optional=True,
|
|
50
|
+
description="Test Desc",
|
|
51
|
+
unit="m/s",
|
|
52
|
+
choices=[1.0, 2.0]
|
|
53
|
+
)
|
|
54
|
+
proto = ares_data_schema_utils.convert_ares_schema_entry_to_proto(py_entry)
|
|
55
|
+
self.assertEqual(proto.type, ares_data_type_pb2.AresDataType.NUMBER)
|
|
56
|
+
self.assertTrue(proto.optional)
|
|
57
|
+
self.assertEqual(proto.description, "Test Desc")
|
|
58
|
+
self.assertEqual(proto.unit, "m/s")
|
|
59
|
+
self.assertEqual(proto.number_choices.numbers, [1.0, 2.0])
|
|
60
|
+
|
|
61
|
+
def test_nested_struct_schema(self):
|
|
62
|
+
nested_field = AresSchemaEntry(type=AresDataType.STRING, description="Inner")
|
|
63
|
+
struct_entry = AresSchemaEntry(
|
|
64
|
+
type=AresDataType.STRUCT,
|
|
65
|
+
struct_schema={"inner_key": nested_field}
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
proto = ares_data_schema_utils.convert_ares_schema_entry_to_proto(struct_entry)
|
|
69
|
+
self.assertEqual(proto.type, ares_data_type_pb2.AresDataType.STRUCT)
|
|
70
|
+
self.assertIn("inner_key", proto.struct_schema.fields)
|
|
71
|
+
|
|
72
|
+
inner_proto = proto.struct_schema.fields["inner_key"]
|
|
73
|
+
self.assertEqual(inner_proto.type, ares_data_type_pb2.AresDataType.STRING)
|
|
74
|
+
self.assertEqual(inner_proto.description, "Inner")
|
|
75
|
+
|
|
76
|
+
if __name__ == '__main__':
|
|
77
|
+
unittest.main(verbosity=2)
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import unittest
|
|
2
|
+
from PyAres.Utils import ares_data_type_utils
|
|
3
|
+
from PyAres.Models import AresDataType
|
|
4
|
+
|
|
5
|
+
class TestAresDataTypeUtils(unittest.TestCase):
|
|
6
|
+
def test_determine_python_ares_data_type(self):
|
|
7
|
+
self.assertEqual(ares_data_type_utils.determine_python_ares_data_type("string"), AresDataType.STRING)
|
|
8
|
+
self.assertEqual(ares_data_type_utils.determine_python_ares_data_type(True), AresDataType.BOOLEAN)
|
|
9
|
+
self.assertEqual(ares_data_type_utils.determine_python_ares_data_type(123), AresDataType.NUMBER)
|
|
10
|
+
self.assertEqual(ares_data_type_utils.determine_python_ares_data_type(12.34), AresDataType.NUMBER)
|
|
11
|
+
|
|
12
|
+
self.assertEqual(ares_data_type_utils.determine_python_ares_data_type(["a", "b"]), AresDataType.STRING_ARRAY)
|
|
13
|
+
self.assertEqual(ares_data_type_utils.determine_python_ares_data_type([1, 2.0]), AresDataType.NUMBER_ARRAY)
|
|
14
|
+
self.assertEqual(ares_data_type_utils.determine_python_ares_data_type([True, False]), AresDataType.LIST)
|
|
15
|
+
self.assertEqual(ares_data_type_utils.determine_python_ares_data_type([1, "a"]), AresDataType.LIST)
|
|
16
|
+
|
|
17
|
+
if __name__ == '__main__':
|
|
18
|
+
unittest.main(verbosity=2)
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import unittest
|
|
2
|
+
from PyAres.Utils import ares_struct_utils
|
|
3
|
+
from ares_datamodel import ares_struct_pb2
|
|
4
|
+
|
|
5
|
+
class TestAresStructUtils(unittest.TestCase):
|
|
6
|
+
def test_create_string_struct(self):
|
|
7
|
+
s = ares_struct_utils.create_string_struct("key", "value")
|
|
8
|
+
self.assertEqual(s.fields["key"].string_value, "value")
|
|
9
|
+
|
|
10
|
+
def test_create_number_struct(self):
|
|
11
|
+
s = ares_struct_utils.create_number_struct("key", 123)
|
|
12
|
+
self.assertEqual(s.fields["key"].number_value, 123)
|
|
13
|
+
|
|
14
|
+
def test_create_bool_struct(self):
|
|
15
|
+
s = ares_struct_utils.create_bool_struct("key", True)
|
|
16
|
+
self.assertEqual(s.fields["key"].bool_value, True)
|
|
17
|
+
|
|
18
|
+
def test_create_null_struct(self):
|
|
19
|
+
s = ares_struct_utils.create_null_struct("key")
|
|
20
|
+
self.assertTrue(s.fields["key"].HasField("null_value"))
|
|
21
|
+
|
|
22
|
+
def test_create_string_array_struct(self):
|
|
23
|
+
s = ares_struct_utils.create_string_array_struct("key", ["a", "b"])
|
|
24
|
+
self.assertEqual(s.fields["key"].string_array_value.strings, ["a", "b"])
|
|
25
|
+
|
|
26
|
+
def test_create_number_array_struct(self):
|
|
27
|
+
s = ares_struct_utils.create_number_array_struct("key", [1, 2.0])
|
|
28
|
+
self.assertEqual(s.fields["key"].number_array_value.numbers, [1, 2.0])
|
|
29
|
+
|
|
30
|
+
def test_create_bytes_array_struct(self):
|
|
31
|
+
s = ares_struct_utils.create_bytes_array_struct("key", b"bytes")
|
|
32
|
+
self.assertEqual(s.fields["key"].bytes_value, b"bytes")
|
|
33
|
+
|
|
34
|
+
def test_create_ares_struct_inference(self):
|
|
35
|
+
# Test type inference in create_ares_struct
|
|
36
|
+
s_str = ares_struct_utils.create_ares_struct("k", "v")
|
|
37
|
+
self.assertEqual(s_str.fields["k"].string_value, "v")
|
|
38
|
+
|
|
39
|
+
s_num = ares_struct_utils.create_ares_struct("k", 10)
|
|
40
|
+
self.assertEqual(s_num.fields["k"].number_value, 10)
|
|
41
|
+
|
|
42
|
+
s_bool = ares_struct_utils.create_ares_struct("k", False)
|
|
43
|
+
self.assertEqual(s_bool.fields["k"].bool_value, False)
|
|
44
|
+
|
|
45
|
+
s_bytes = ares_struct_utils.create_ares_struct("k", b"123")
|
|
46
|
+
self.assertEqual(s_bytes.fields["k"].bytes_value, b"123")
|
|
47
|
+
|
|
48
|
+
s_list_str = ares_struct_utils.create_ares_struct("k", ["a", "b"])
|
|
49
|
+
self.assertEqual(s_list_str.fields["k"].string_array_value.strings, ["a", "b"])
|
|
50
|
+
|
|
51
|
+
s_list_num = ares_struct_utils.create_ares_struct("k", [1, 2])
|
|
52
|
+
self.assertEqual(s_list_num.fields["k"].number_array_value.numbers, [1, 2])
|
|
53
|
+
|
|
54
|
+
s_list_bool = ares_struct_utils.create_ares_struct("k", [True, False])
|
|
55
|
+
self.assertEqual(s_list_bool.fields["k"].list_value.values[0].bool_value, True)
|
|
56
|
+
|
|
57
|
+
s_empty = ares_struct_utils.create_ares_struct("k", [])
|
|
58
|
+
self.assertTrue(s_empty.fields["k"].HasField("null_value"))
|
|
59
|
+
|
|
60
|
+
def test_dict_conversions(self):
|
|
61
|
+
py_dict = {
|
|
62
|
+
"str": "val",
|
|
63
|
+
"num": 1.0,
|
|
64
|
+
"bool": True,
|
|
65
|
+
"list": [1, 2]
|
|
66
|
+
}
|
|
67
|
+
struct_pb = ares_struct_pb2.AresStruct()
|
|
68
|
+
ares_struct_utils.dict_to_ares_struct(py_dict, struct_pb)
|
|
69
|
+
|
|
70
|
+
self.assertEqual(struct_pb.fields["str"].string_value, "val")
|
|
71
|
+
self.assertEqual(struct_pb.fields["num"].number_value, 1.0)
|
|
72
|
+
|
|
73
|
+
# Round trip
|
|
74
|
+
new_dict = ares_struct_utils.ares_struct_to_dict(struct_pb)
|
|
75
|
+
self.assertEqual(new_dict["str"], "val")
|
|
76
|
+
self.assertEqual(new_dict["num"], 1.0)
|
|
77
|
+
self.assertEqual(new_dict["bool"], True)
|
|
78
|
+
self.assertEqual(new_dict["list"], [1, 2])
|
|
79
|
+
|
|
80
|
+
if __name__ == '__main__':
|
|
81
|
+
unittest.main(verbosity=2)
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import unittest
|
|
2
|
+
from PyAres.Utils import ares_value_utils
|
|
3
|
+
|
|
4
|
+
class TestAresValueTypeConversions(unittest.TestCase):
|
|
5
|
+
def test_float_ares_value(self):
|
|
6
|
+
original_float = 0.0
|
|
7
|
+
float_value = ares_value_utils.create_ares_value(original_float)
|
|
8
|
+
self.assertEqual(float_value.number_value, original_float)
|
|
9
|
+
|
|
10
|
+
def test_int_ares_value(self):
|
|
11
|
+
original_int = 0
|
|
12
|
+
int_value = ares_value_utils.create_ares_value(original_int)
|
|
13
|
+
self.assertEqual(int_value.number_value, original_int)
|
|
14
|
+
|
|
15
|
+
def test_negative_ares_value(self):
|
|
16
|
+
original_num = -1.0
|
|
17
|
+
negative_value = ares_value_utils.create_ares_value(original_num)
|
|
18
|
+
self.assertEqual(negative_value.number_value, original_num)
|
|
19
|
+
|
|
20
|
+
def test_string_ares_value(self):
|
|
21
|
+
original_str = "STRING"
|
|
22
|
+
str_value = ares_value_utils.create_ares_value(original_str)
|
|
23
|
+
self.assertEqual(str_value.string_value, original_str)
|
|
24
|
+
|
|
25
|
+
def test_bool_ares_value(self):
|
|
26
|
+
original_bool = True
|
|
27
|
+
bool_value = ares_value_utils.create_ares_value(original_bool)
|
|
28
|
+
self.assertEqual(bool_value.bool_value, original_bool)
|
|
29
|
+
|
|
30
|
+
def test_bytes_ares_value(self):
|
|
31
|
+
original_bytes = b"BYTES"
|
|
32
|
+
bytes_value = ares_value_utils.create_ares_value(original_bytes)
|
|
33
|
+
self.assertEqual(bytes_value.bytes_value, original_bytes)
|
|
34
|
+
|
|
35
|
+
def test_number_array_ares_value(self):
|
|
36
|
+
original_list = [1.0, 2.0, 3.0]
|
|
37
|
+
list_value = ares_value_utils.create_ares_value(original_list)
|
|
38
|
+
self.assertEqual(list_value.number_array_value.numbers, original_list)
|
|
39
|
+
|
|
40
|
+
def test_string_array_ares_value(self):
|
|
41
|
+
original_list = ["one", "two", "three"]
|
|
42
|
+
list_value = ares_value_utils.create_ares_value(original_list)
|
|
43
|
+
self.assertEqual(list_value.string_array_value.strings, original_list)
|
|
44
|
+
|
|
45
|
+
def test_bool_array_ares_value(self):
|
|
46
|
+
original_list = [True, False, True]
|
|
47
|
+
list_value = ares_value_utils.create_ares_value(original_list)
|
|
48
|
+
self.assertEqual(list_value.WhichOneof("kind"), "list_value")
|
|
49
|
+
self.assertEqual(len(list_value.list_value.values), 3)
|
|
50
|
+
self.assertEqual(list_value.list_value.values[0].bool_value, True)
|
|
51
|
+
|
|
52
|
+
def test_mixed_list_ares_value(self):
|
|
53
|
+
mixed_list = [1, "two"]
|
|
54
|
+
list_value = ares_value_utils.create_ares_value(mixed_list)
|
|
55
|
+
self.assertEqual(list_value.WhichOneof("kind"), "list_value")
|
|
56
|
+
self.assertEqual(len(list_value.list_value.values), 2)
|
|
57
|
+
self.assertEqual(list_value.list_value.values[0].number_value, 1)
|
|
58
|
+
self.assertEqual(list_value.list_value.values[1].string_value, "two")
|
|
59
|
+
|
|
60
|
+
# Unsupported type should return null value
|
|
61
|
+
class Unsupported:
|
|
62
|
+
pass
|
|
63
|
+
unsupported = Unsupported()
|
|
64
|
+
null_value = ares_value_utils.create_ares_value(unsupported)
|
|
65
|
+
self.assertEqual(null_value.WhichOneof("kind"), "null_value")
|
|
66
|
+
|
|
67
|
+
def test_struct_ares_value(self):
|
|
68
|
+
original_dict = {"key": "value", "nested": {"inner": 123.0}}
|
|
69
|
+
struct_value = ares_value_utils.create_ares_value(original_dict)
|
|
70
|
+
self.assertEqual(struct_value.WhichOneof("kind"), "struct_value")
|
|
71
|
+
self.assertEqual(struct_value.struct_value.fields["key"].string_value, "value")
|
|
72
|
+
self.assertEqual(struct_value.struct_value.fields["nested"].struct_value.fields["inner"].number_value, 123.0)
|
|
73
|
+
|
|
74
|
+
if __name__ == '__main__':
|
|
75
|
+
unittest.main(verbosity=2)
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
from typing import Union
|
|
2
|
-
from ares_datamodel import ares_data_schema_pb2
|
|
3
|
-
from ..Models import ares_data_models
|
|
4
|
-
|
|
5
|
-
def create_settings_schema_entry(
|
|
6
|
-
setting_type: ares_data_models.AresDataType,
|
|
7
|
-
optional: bool,
|
|
8
|
-
choices: Union[list[str], list[int], list[float]]) -> ares_data_schema_pb2.SchemaEntry:
|
|
9
|
-
"""
|
|
10
|
-
Takes in an AresSetting object and converts it into the protobuf SchemaEntry message.
|
|
11
|
-
|
|
12
|
-
Args:
|
|
13
|
-
new_setting: The AresSetting object that provides all the details around the setting implementation.
|
|
14
|
-
|
|
15
|
-
Returns:
|
|
16
|
-
(SchemaEntry): A new SchemaEntry message.
|
|
17
|
-
"""
|
|
18
|
-
|
|
19
|
-
if(isinstance(choices, list)):
|
|
20
|
-
if(len(choices) == 0):
|
|
21
|
-
schema_entry = ares_data_schema_pb2.SchemaEntry(type=setting_type.value, optional=optional)
|
|
22
|
-
|
|
23
|
-
elif(all(isinstance(item, str) for item in choices)):
|
|
24
|
-
schema_entry = ares_data_schema_pb2.SchemaEntry(type=setting_type.value, optional=optional)
|
|
25
|
-
schema_entry.string_choices.strings.extend(choices)
|
|
26
|
-
|
|
27
|
-
elif(all(isinstance(item, (int, float)) for item in choices)):
|
|
28
|
-
schema_entry = ares_data_schema_pb2.SchemaEntry(type=setting_type.value, optional=optional)
|
|
29
|
-
schema_entry.number_choices.numbers.extend(choices)
|
|
30
|
-
|
|
31
|
-
else:
|
|
32
|
-
schema_entry = ares_data_schema_pb2.SchemaEntry(type=setting_type.value, optional=optional)
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
return schema_entry
|
|
36
|
-
|
pyares-0.2.2/poetry.lock
DELETED
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
# This file is automatically @generated by Poetry 2.1.4 and should not be changed by hand.
|
|
2
|
-
|
|
3
|
-
[[package]]
|
|
4
|
-
name = "ares-datamodel"
|
|
5
|
-
version = "0.7.0b5"
|
|
6
|
-
description = "Datamodel/messaging for ARES communications"
|
|
7
|
-
optional = false
|
|
8
|
-
python-versions = ">=3.9"
|
|
9
|
-
groups = ["main"]
|
|
10
|
-
files = [
|
|
11
|
-
{file = "ares_datamodel-0.7.0b5-py3-none-any.whl", hash = "sha256:42c02a60a9803ecb6f3e13650b530df20c2ad0155d3a6d2507e4817470de9557"},
|
|
12
|
-
{file = "ares_datamodel-0.7.0b5.tar.gz", hash = "sha256:758ac520bd1119558dc31059b7b4d23685c00b83a9867b6a9de3a791f6198cf0"},
|
|
13
|
-
]
|
|
14
|
-
|
|
15
|
-
[[package]]
|
|
16
|
-
name = "grpcio"
|
|
17
|
-
version = "1.72.0rc1"
|
|
18
|
-
description = "HTTP/2-based RPC framework"
|
|
19
|
-
optional = false
|
|
20
|
-
python-versions = ">=3.9"
|
|
21
|
-
groups = ["main"]
|
|
22
|
-
files = [
|
|
23
|
-
{file = "grpcio-1.72.0rc1-cp310-cp310-linux_armv7l.whl", hash = "sha256:db7db4b246a7fb21aeb70e7220be480948aa9c535eaa777ea0c840416ed8cac9"},
|
|
24
|
-
{file = "grpcio-1.72.0rc1-cp310-cp310-macosx_12_0_universal2.whl", hash = "sha256:baf028e61662fd320c18fb50070b6e330fa24b2b3a4d113f4d57b41e0f5b5873"},
|
|
25
|
-
{file = "grpcio-1.72.0rc1-cp310-cp310-manylinux_2_17_aarch64.whl", hash = "sha256:bf84cf17dfbf49ebe11b081b7a3c83b23625a80c979741e2e98b0ddb41080397"},
|
|
26
|
-
{file = "grpcio-1.72.0rc1-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3fd6f8700d34754b32d13af234da2e413f408c8b741c8039f11beb06d53c3f6a"},
|
|
27
|
-
{file = "grpcio-1.72.0rc1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f05d243b8d814dd1c6fca19e4e0c5986fc70e2c3aa29e2c7c67e877e4c03ede6"},
|
|
28
|
-
{file = "grpcio-1.72.0rc1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:390a70394e2c315d7c480496db259ec16c00baeebf759c8967247269f0fee981"},
|
|
29
|
-
{file = "grpcio-1.72.0rc1-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:b08973c62eda11343e7131d78635d50ae0c138a8f39eb817ca83cca842527d04"},
|
|
30
|
-
{file = "grpcio-1.72.0rc1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:ce539397a258af1dee26118c40327004d023617bc99493baaf8e7938491f7361"},
|
|
31
|
-
{file = "grpcio-1.72.0rc1-cp310-cp310-win32.whl", hash = "sha256:4f97f628095bbdf6d4c2c15c1bc18f0514f90781528bc6082bb697ccc71d4f42"},
|
|
32
|
-
{file = "grpcio-1.72.0rc1-cp310-cp310-win_amd64.whl", hash = "sha256:dbcdf7a5463b61fca1586b54f7ea3c9dfd159f535224f457ae307f52d8d4a839"},
|
|
33
|
-
{file = "grpcio-1.72.0rc1-cp311-cp311-linux_armv7l.whl", hash = "sha256:23ebb3947783f10fec3e1d0b29b94db8e72f721900d1dd9c1d6db5876da69066"},
|
|
34
|
-
{file = "grpcio-1.72.0rc1-cp311-cp311-macosx_11_0_universal2.whl", hash = "sha256:fd96b20846907ed4cd95bf1d628f16732f450114bde897eedb323fc3bc1eddb3"},
|
|
35
|
-
{file = "grpcio-1.72.0rc1-cp311-cp311-manylinux_2_17_aarch64.whl", hash = "sha256:6df1ba4a5f5793ae210699e1b1745f77a4ac17f73510fc36ee12c215f02523b4"},
|
|
36
|
-
{file = "grpcio-1.72.0rc1-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a3398957c611f0af7cee4fdd34268b6664be8689eae0327440efb794e544908b"},
|
|
37
|
-
{file = "grpcio-1.72.0rc1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9ef66029da9cbe94ba3047c1b04653e1d5096ca8d036eb6e24092f0e847d2c4f"},
|
|
38
|
-
{file = "grpcio-1.72.0rc1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:6566e3e3458805381f8714492e8f559f082f8955ccd1c98d71f8afc0612dc841"},
|
|
39
|
-
{file = "grpcio-1.72.0rc1-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:3c799bfa92450e95d3f1f9cc4b7d8cbefc8bd4356d3f6573d2fb5e698353192a"},
|
|
40
|
-
{file = "grpcio-1.72.0rc1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:a251992531f3b16be3c013ec45a9caa69ecfe9b45335652d5681659f6d117233"},
|
|
41
|
-
{file = "grpcio-1.72.0rc1-cp311-cp311-win32.whl", hash = "sha256:c9e5f2c628dedf0886b774eee17e003a043941024e68ee2ebe76be6981a7baab"},
|
|
42
|
-
{file = "grpcio-1.72.0rc1-cp311-cp311-win_amd64.whl", hash = "sha256:8b9c0a84ff584da3f5c0cb04ee3d87c0bc70d41ab5a21d3b943963a94c622892"},
|
|
43
|
-
{file = "grpcio-1.72.0rc1-cp312-cp312-linux_armv7l.whl", hash = "sha256:188ac9d8cb05c250e212ba946a65a8541419bdfd803373d6b7fb8b10fe5ff991"},
|
|
44
|
-
{file = "grpcio-1.72.0rc1-cp312-cp312-macosx_11_0_universal2.whl", hash = "sha256:8bd956711dc21235bc78a70bf04a28b3f747c6576b9bb79362803707fec9f705"},
|
|
45
|
-
{file = "grpcio-1.72.0rc1-cp312-cp312-manylinux_2_17_aarch64.whl", hash = "sha256:b032b9cbb325e28ff847b6aae1df5a090aa49b682dc80c926b24a96de43c01aa"},
|
|
46
|
-
{file = "grpcio-1.72.0rc1-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1ca12a4388a40eb0411264af291184e2cca38176996b591ac047844abd81d40b"},
|
|
47
|
-
{file = "grpcio-1.72.0rc1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e7cefd52f392f4d6747b401f825901c48176737f7b03b17be0a0a638da194749"},
|
|
48
|
-
{file = "grpcio-1.72.0rc1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:1a24408fb051b70efa440b95f7e1acbb1c3067609934aa53a953d8d2cfc4d824"},
|
|
49
|
-
{file = "grpcio-1.72.0rc1-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:c7b37608d14792d3dacb9aba55b96a17a074e139c4567b0ac5c1926302add910"},
|
|
50
|
-
{file = "grpcio-1.72.0rc1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:81ca42a96299ca617f3bc7b60660f15cabb98de6fce440ecd4d0640a5554345f"},
|
|
51
|
-
{file = "grpcio-1.72.0rc1-cp312-cp312-win32.whl", hash = "sha256:9ff2ef2a553d4edc8c620df3735b15a1e7dc05a60262e8c28445f2676fb09189"},
|
|
52
|
-
{file = "grpcio-1.72.0rc1-cp312-cp312-win_amd64.whl", hash = "sha256:3c9a6613662591c198d9e4e499f3336bc5c1c0e3fe3f0922cf48e74b37b3dcd1"},
|
|
53
|
-
{file = "grpcio-1.72.0rc1-cp313-cp313-linux_armv7l.whl", hash = "sha256:995e3e5c43cab6d0f1922b43b3c01a2624a4497ce91c3124e807497654301c59"},
|
|
54
|
-
{file = "grpcio-1.72.0rc1-cp313-cp313-macosx_11_0_universal2.whl", hash = "sha256:8dfb0ff2ddd708dbecdffa37245b79aef707e789ffb0fc6a8be01608d982afcd"},
|
|
55
|
-
{file = "grpcio-1.72.0rc1-cp313-cp313-manylinux_2_17_aarch64.whl", hash = "sha256:7e08eb53d6123995da63df90ce50e5b834de0a8ebfb1a3ac0890a2e246d2771c"},
|
|
56
|
-
{file = "grpcio-1.72.0rc1-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:71cb52c0956fe7868692b490fda341a52d8187fab94e1136f5bd253c8e3560ac"},
|
|
57
|
-
{file = "grpcio-1.72.0rc1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dcf76ce8d4a6829f112ad88c4e6d528dbef922e01834d4a5cc3718bf599f7e84"},
|
|
58
|
-
{file = "grpcio-1.72.0rc1-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:8852b6234a52b6b694a5f9a5a687d59127b3e71c8e345eebd6d483abbc412217"},
|
|
59
|
-
{file = "grpcio-1.72.0rc1-cp313-cp313-musllinux_1_1_i686.whl", hash = "sha256:d1a0fee8420d9e453dc8cba1c7c067ca2d3054487cb6616ab8dad41f15e57465"},
|
|
60
|
-
{file = "grpcio-1.72.0rc1-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:a13149f4fd3904093fa2dba484744dd7205f536650a533ab24dd95cca393c14c"},
|
|
61
|
-
{file = "grpcio-1.72.0rc1-cp313-cp313-win32.whl", hash = "sha256:cebe148511a1965363fc6aafd60a488fe9dc5d74dd92a59a8ecba66ddd53c573"},
|
|
62
|
-
{file = "grpcio-1.72.0rc1-cp313-cp313-win_amd64.whl", hash = "sha256:843352c352970a1df5bbf7da68d2770781f4bff2c85a4a0d20cc6eaaadf26e59"},
|
|
63
|
-
{file = "grpcio-1.72.0rc1-cp39-cp39-linux_armv7l.whl", hash = "sha256:2083c0cdff47ff7d4b093d05d703baeeef8db3b2c1f43c9f9d4288a99e444cdd"},
|
|
64
|
-
{file = "grpcio-1.72.0rc1-cp39-cp39-macosx_11_0_universal2.whl", hash = "sha256:42df7e0f9d66f5c9b246d8e1da74605bce27b10dec20b6fc204edd6e7178da2d"},
|
|
65
|
-
{file = "grpcio-1.72.0rc1-cp39-cp39-manylinux_2_17_aarch64.whl", hash = "sha256:1190c2e4f221b5bd0e6eba3e44d6758ef48eeb2216dcb9734c158e8a5d8ce6a3"},
|
|
66
|
-
{file = "grpcio-1.72.0rc1-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6d6c8d2ea63e1cdaaa81271e5c867fcd9732050324df372ff9d3163968be68c8"},
|
|
67
|
-
{file = "grpcio-1.72.0rc1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8f6ee161b9d112232e5d6be437bf56383dca2334bd17e8b7a4a3f97f33722bdd"},
|
|
68
|
-
{file = "grpcio-1.72.0rc1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:9abbdf945e3b151603d642f2bc7a637b87af2e3480ed047689bad9eb4fa9c712"},
|
|
69
|
-
{file = "grpcio-1.72.0rc1-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:2edab5d26319a1fed695ec658efe3846b75e0c7f3a6202b042099c9b11dc10fd"},
|
|
70
|
-
{file = "grpcio-1.72.0rc1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:03b46e0041bee18a786ccef978bc29a26e4bd1b73a6ca0b21252387167843ff1"},
|
|
71
|
-
{file = "grpcio-1.72.0rc1-cp39-cp39-win32.whl", hash = "sha256:9b861cbfb63433e02b52f9971644095bec4a5fcd1e4d3f94e18cfad38f649d53"},
|
|
72
|
-
{file = "grpcio-1.72.0rc1-cp39-cp39-win_amd64.whl", hash = "sha256:2416792a567cba9f92bffc1a55ce0f2c8106956a2e32bfe8a22a8094a56b7108"},
|
|
73
|
-
{file = "grpcio-1.72.0rc1.tar.gz", hash = "sha256:221793dccd3332060f426975a041d319d6d57323d857d4afc25257ec4a5a67f3"},
|
|
74
|
-
]
|
|
75
|
-
|
|
76
|
-
[package.extras]
|
|
77
|
-
protobuf = ["grpcio-tools (>=1.72.0rc1)"]
|
|
78
|
-
|
|
79
|
-
[[package]]
|
|
80
|
-
name = "grpcio-tools"
|
|
81
|
-
version = "1.72.0rc1"
|
|
82
|
-
description = "Protobuf code generator for gRPC"
|
|
83
|
-
optional = false
|
|
84
|
-
python-versions = ">=3.9"
|
|
85
|
-
groups = ["main"]
|
|
86
|
-
files = [
|
|
87
|
-
{file = "grpcio_tools-1.72.0rc1-cp310-cp310-linux_armv7l.whl", hash = "sha256:e52e94faa43461e74969204b4ec59d1254aa6c7e800e3c25bdf2b5d54b84909c"},
|
|
88
|
-
{file = "grpcio_tools-1.72.0rc1-cp310-cp310-macosx_12_0_universal2.whl", hash = "sha256:586ecf02e78377b3c0422ab056328b135cd67e4a0f7339d3dca0016329524f92"},
|
|
89
|
-
{file = "grpcio_tools-1.72.0rc1-cp310-cp310-manylinux_2_17_aarch64.whl", hash = "sha256:126a01bdf963138d07df41ffe9962ccd2c31f87d00b59cb7474a8caccd273e5b"},
|
|
90
|
-
{file = "grpcio_tools-1.72.0rc1-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ca628b68e2641fb185723bb82c151350dcb718ac8c710ec444fe51c750172f9d"},
|
|
91
|
-
{file = "grpcio_tools-1.72.0rc1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9f97522654a2f46b6e2a3efd859cc9a87970402dba61c29d721b388149d0df3f"},
|
|
92
|
-
{file = "grpcio_tools-1.72.0rc1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:d22850ebe6ef42ff7332f6ff241c0414023218e294ec6df31b2f857afb9ffa4b"},
|
|
93
|
-
{file = "grpcio_tools-1.72.0rc1-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:0c2bed940f7bfe7f493a47496fb1eb93cc8c38cdcf0acda268f6127d94e4c8a9"},
|
|
94
|
-
{file = "grpcio_tools-1.72.0rc1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:2d933a40c11e26822c1f49bf18b0fe2f69470f39b5e623974829e982e9f892b0"},
|
|
95
|
-
{file = "grpcio_tools-1.72.0rc1-cp310-cp310-win32.whl", hash = "sha256:c0964c6b48e092b2d78ee0b623162c374d7ed608d8e11d2276b12f9216c69eea"},
|
|
96
|
-
{file = "grpcio_tools-1.72.0rc1-cp310-cp310-win_amd64.whl", hash = "sha256:ea2c75c55bd78fa8829bdfc6aa20ce99b9a96c2d7493baa3bacf4021e03e2e48"},
|
|
97
|
-
{file = "grpcio_tools-1.72.0rc1-cp311-cp311-linux_armv7l.whl", hash = "sha256:c1e604edb61e465e2aceb0dd3d380f3157a3dc9194389161fc55e4eefa712336"},
|
|
98
|
-
{file = "grpcio_tools-1.72.0rc1-cp311-cp311-macosx_11_0_universal2.whl", hash = "sha256:858083b368e52d291cd7e178fa16fc477f86af1e7d42fd722d04b3758f3bf91d"},
|
|
99
|
-
{file = "grpcio_tools-1.72.0rc1-cp311-cp311-manylinux_2_17_aarch64.whl", hash = "sha256:b1b456d3a72e5330a75e31cad454e7d966fa7a91de09506c6081d543163ad3be"},
|
|
100
|
-
{file = "grpcio_tools-1.72.0rc1-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c350ab4bea63422cb9a945823c51fdb90fac81716e0cd1ea104af7a16de8a2ae"},
|
|
101
|
-
{file = "grpcio_tools-1.72.0rc1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:65fe8bc37f74c49376d589aaea3c00f6652f870d58c087b63cd8ece890de2300"},
|
|
102
|
-
{file = "grpcio_tools-1.72.0rc1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:7848a82c1dce3ac5f140a5d71081a9650c0dac1b9ceaef73e49353ce9df67ca8"},
|
|
103
|
-
{file = "grpcio_tools-1.72.0rc1-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:3b24790f9c58ecc4574b2ac91d5cb36a3776b06afafb4eca92780fe3b3476bef"},
|
|
104
|
-
{file = "grpcio_tools-1.72.0rc1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:775d0acf3934a1d8dbab6253065c2a1b5279ea06f3448b020d0045947a14b15a"},
|
|
105
|
-
{file = "grpcio_tools-1.72.0rc1-cp311-cp311-win32.whl", hash = "sha256:acdf6b7183deac8d6225e49c94bae03cd9e0afc593c3ba8783174e7820ef886d"},
|
|
106
|
-
{file = "grpcio_tools-1.72.0rc1-cp311-cp311-win_amd64.whl", hash = "sha256:437d41f2b9046ece5dabc37911d0a3f753bd9522c41f8d10cddc87706926e1e2"},
|
|
107
|
-
{file = "grpcio_tools-1.72.0rc1-cp312-cp312-linux_armv7l.whl", hash = "sha256:fa064454883b6f3eead90d47f1857ba5a604166d6cd2f5188af4203d195f8a2e"},
|
|
108
|
-
{file = "grpcio_tools-1.72.0rc1-cp312-cp312-macosx_11_0_universal2.whl", hash = "sha256:1a39f725d1a29758cbd67e8e0b3ab4e39ad6add3b1876cf782056bdcb01c6e0d"},
|
|
109
|
-
{file = "grpcio_tools-1.72.0rc1-cp312-cp312-manylinux_2_17_aarch64.whl", hash = "sha256:0660cea4503408b9cfea96eb52e5b18c9bf2066d7217985a0fcc4f28b0e55495"},
|
|
110
|
-
{file = "grpcio_tools-1.72.0rc1-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a9d76785c43d7919b44fbf7b1cfd6b485c2c6b6dedc3a2174145da25752154e4"},
|
|
111
|
-
{file = "grpcio_tools-1.72.0rc1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5ba91a442526fc44e0b9228f0e32b06d34019aacf0e367f1a89cfbeb15bbf0c1"},
|
|
112
|
-
{file = "grpcio_tools-1.72.0rc1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:c545042d8e9d1a36da72e38c7445fb285427a28319e4a47b67b729d0bdf822e1"},
|
|
113
|
-
{file = "grpcio_tools-1.72.0rc1-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:701690d370b5722285f150ccd73069dc1ce5deed7feffa9b58278957d20301da"},
|
|
114
|
-
{file = "grpcio_tools-1.72.0rc1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:9ffaf6b6255244a1bff601f1046dd763d4652f8cffb16c09831c91afc7e2a648"},
|
|
115
|
-
{file = "grpcio_tools-1.72.0rc1-cp312-cp312-win32.whl", hash = "sha256:397e251114e4cc3f9ffd948ce7438aa419611f90b64cd6d49cb048ac100fd72c"},
|
|
116
|
-
{file = "grpcio_tools-1.72.0rc1-cp312-cp312-win_amd64.whl", hash = "sha256:e41186388cf8e615c7caf0dd756efffee59d3b590fe06c4d44a3a2149efb9e03"},
|
|
117
|
-
{file = "grpcio_tools-1.72.0rc1-cp313-cp313-linux_armv7l.whl", hash = "sha256:2444addb5762446ef9035d0dd8de207b80f6c2693b479034fbe79b5b647de795"},
|
|
118
|
-
{file = "grpcio_tools-1.72.0rc1-cp313-cp313-macosx_11_0_universal2.whl", hash = "sha256:339df6909033612560eb3a8665443fea7826289818c69af502bffcde4c23a224"},
|
|
119
|
-
{file = "grpcio_tools-1.72.0rc1-cp313-cp313-manylinux_2_17_aarch64.whl", hash = "sha256:b7ce79173fe9e1064b40dd1f1a3ab3ba263085751806285cb4f1e47fcb9a3043"},
|
|
120
|
-
{file = "grpcio_tools-1.72.0rc1-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b7974b72c4b543ef574657f535f4c593e40f2f5ab43210d1bce8553597ba95e5"},
|
|
121
|
-
{file = "grpcio_tools-1.72.0rc1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4884f08bfaee04c5d2221c0a99283220b01a9196d29a97f76a1a945b1e54656b"},
|
|
122
|
-
{file = "grpcio_tools-1.72.0rc1-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:14c647acf2a27bff0051c77b3284969753f94a78c7c7b025ac216bcb651a5ea9"},
|
|
123
|
-
{file = "grpcio_tools-1.72.0rc1-cp313-cp313-musllinux_1_1_i686.whl", hash = "sha256:1f1f2da48e460a642d01fa1fd9e32daf17b49ae443c878be5ec5a5fa0ce6acae"},
|
|
124
|
-
{file = "grpcio_tools-1.72.0rc1-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:bfeebd25f1f1d0d2e14f18c88088e86ee5ca67b7261bf8a35ca9ff6cf65311b0"},
|
|
125
|
-
{file = "grpcio_tools-1.72.0rc1-cp313-cp313-win32.whl", hash = "sha256:57df96d9ebfe0f77bec7ecf43dc6c3b922b40f2a41543c17ee3bee9e1e3946b1"},
|
|
126
|
-
{file = "grpcio_tools-1.72.0rc1-cp313-cp313-win_amd64.whl", hash = "sha256:f9ae32f9037cab9f135bd551936eeb4f92e2a0b9ff6511cc570f5188ab8631dc"},
|
|
127
|
-
{file = "grpcio_tools-1.72.0rc1-cp39-cp39-linux_armv7l.whl", hash = "sha256:73911e370d0a2b389ef3969ac398ec49dd12416aa60c789efe13bf7de5df7671"},
|
|
128
|
-
{file = "grpcio_tools-1.72.0rc1-cp39-cp39-macosx_11_0_universal2.whl", hash = "sha256:1b6fbf6c5132bf4770960575e7198de3883bdacffa15714f23c480980c1e2800"},
|
|
129
|
-
{file = "grpcio_tools-1.72.0rc1-cp39-cp39-manylinux_2_17_aarch64.whl", hash = "sha256:d5abfbf37042aee8058cd9554c10e2fafcfc4905daea1947879f26846d8ee673"},
|
|
130
|
-
{file = "grpcio_tools-1.72.0rc1-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6b4feb97c6ee521f80fec48708405e2b202618a582f650e7dc999d3e44342351"},
|
|
131
|
-
{file = "grpcio_tools-1.72.0rc1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f6e3a18ff852c02b9673b7a2fa8a85f147dcb564dff7bad7990304963941650d"},
|
|
132
|
-
{file = "grpcio_tools-1.72.0rc1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:a0aa493aa4f98d3e7fed9593a6c7fbcae157338d496669007ceddca4fcf06dfb"},
|
|
133
|
-
{file = "grpcio_tools-1.72.0rc1-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:12f68f42c0e7e72f2e93c6c962d9c7f8b74528b7afb8920f7243df49ea6de6f6"},
|
|
134
|
-
{file = "grpcio_tools-1.72.0rc1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:b056427fcc230447ee033b561dd6f60015634529738764cd22ad6e4351d51bad"},
|
|
135
|
-
{file = "grpcio_tools-1.72.0rc1-cp39-cp39-win32.whl", hash = "sha256:0a460a77761bceeaeac3a9c34ec15eca3302e94d83aa031d2a0fb8539fd347f2"},
|
|
136
|
-
{file = "grpcio_tools-1.72.0rc1-cp39-cp39-win_amd64.whl", hash = "sha256:f165c4829c2d7da787e2c693cb73b75c92586e668e1dcbf8e1a90814d7af37e8"},
|
|
137
|
-
{file = "grpcio_tools-1.72.0rc1.tar.gz", hash = "sha256:d073367bcec01f8cc89bcc37bb918174ea8384fcde83645c2506f4cc36a12ba4"},
|
|
138
|
-
]
|
|
139
|
-
|
|
140
|
-
[package.dependencies]
|
|
141
|
-
grpcio = ">=1.72.0rc1"
|
|
142
|
-
protobuf = ">=6.30.0,<7.0dev"
|
|
143
|
-
setuptools = "*"
|
|
144
|
-
|
|
145
|
-
[[package]]
|
|
146
|
-
name = "protobuf"
|
|
147
|
-
version = "6.30.2"
|
|
148
|
-
description = ""
|
|
149
|
-
optional = false
|
|
150
|
-
python-versions = ">=3.9"
|
|
151
|
-
groups = ["main"]
|
|
152
|
-
files = [
|
|
153
|
-
{file = "protobuf-6.30.2-cp310-abi3-win32.whl", hash = "sha256:b12ef7df7b9329886e66404bef5e9ce6a26b54069d7f7436a0853ccdeb91c103"},
|
|
154
|
-
{file = "protobuf-6.30.2-cp310-abi3-win_amd64.whl", hash = "sha256:7653c99774f73fe6b9301b87da52af0e69783a2e371e8b599b3e9cb4da4b12b9"},
|
|
155
|
-
{file = "protobuf-6.30.2-cp39-abi3-macosx_10_9_universal2.whl", hash = "sha256:0eb523c550a66a09a0c20f86dd554afbf4d32b02af34ae53d93268c1f73bc65b"},
|
|
156
|
-
{file = "protobuf-6.30.2-cp39-abi3-manylinux2014_aarch64.whl", hash = "sha256:50f32cc9fd9cb09c783ebc275611b4f19dfdfb68d1ee55d2f0c7fa040df96815"},
|
|
157
|
-
{file = "protobuf-6.30.2-cp39-abi3-manylinux2014_x86_64.whl", hash = "sha256:4f6c687ae8efae6cf6093389a596548214467778146b7245e886f35e1485315d"},
|
|
158
|
-
{file = "protobuf-6.30.2-cp39-cp39-win32.whl", hash = "sha256:524afedc03b31b15586ca7f64d877a98b184f007180ce25183d1a5cb230ee72b"},
|
|
159
|
-
{file = "protobuf-6.30.2-cp39-cp39-win_amd64.whl", hash = "sha256:acec579c39c88bd8fbbacab1b8052c793efe83a0a5bd99db4a31423a25c0a0e2"},
|
|
160
|
-
{file = "protobuf-6.30.2-py3-none-any.whl", hash = "sha256:ae86b030e69a98e08c77beab574cbcb9fff6d031d57209f574a5aea1445f4b51"},
|
|
161
|
-
{file = "protobuf-6.30.2.tar.gz", hash = "sha256:35c859ae076d8c56054c25b59e5e59638d86545ed6e2b6efac6be0b6ea3ba048"},
|
|
162
|
-
]
|
|
163
|
-
|
|
164
|
-
[[package]]
|
|
165
|
-
name = "setuptools"
|
|
166
|
-
version = "80.1.0"
|
|
167
|
-
description = "Easily download, build, install, upgrade, and uninstall Python packages"
|
|
168
|
-
optional = false
|
|
169
|
-
python-versions = ">=3.9"
|
|
170
|
-
groups = ["main"]
|
|
171
|
-
files = [
|
|
172
|
-
{file = "setuptools-80.1.0-py3-none-any.whl", hash = "sha256:ea0e7655c05b74819f82e76e11a85b31779fee7c4969e82f72bab0664e8317e4"},
|
|
173
|
-
{file = "setuptools-80.1.0.tar.gz", hash = "sha256:2e308396e1d83de287ada2c2fd6e64286008fe6aca5008e0b6a8cb0e2c86eedd"},
|
|
174
|
-
]
|
|
175
|
-
|
|
176
|
-
[package.extras]
|
|
177
|
-
check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1) ; sys_platform != \"cygwin\"", "ruff (>=0.8.0) ; sys_platform != \"cygwin\""]
|
|
178
|
-
core = ["importlib_metadata (>=6) ; python_version < \"3.10\"", "jaraco.functools (>=4)", "jaraco.text (>=3.7)", "more_itertools", "more_itertools (>=8.8)", "packaging (>=24.2)", "platformdirs (>=4.2.2)", "tomli (>=2.0.1) ; python_version < \"3.11\"", "wheel (>=0.43.0)"]
|
|
179
|
-
cover = ["pytest-cov"]
|
|
180
|
-
doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "pyproject-hooks (!=1.1)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier", "towncrier (<24.7)"]
|
|
181
|
-
enabler = ["pytest-enabler (>=2.2)"]
|
|
182
|
-
test = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "ini2toml[lite] (>=0.14)", "jaraco.develop (>=7.21) ; python_version >= \"3.9\" and sys_platform != \"cygwin\"", "jaraco.envs (>=2.2)", "jaraco.path (>=3.7.2)", "jaraco.test (>=5.5)", "packaging (>=24.2)", "pip (>=19.1)", "pyproject-hooks (!=1.1)", "pytest (>=6,!=8.1.*)", "pytest-home (>=0.5)", "pytest-perf ; sys_platform != \"cygwin\"", "pytest-subprocess", "pytest-timeout", "pytest-xdist (>=3)", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel (>=0.44.0)"]
|
|
183
|
-
type = ["importlib_metadata (>=7.0.2) ; python_version < \"3.10\"", "jaraco.develop (>=7.21) ; sys_platform != \"cygwin\"", "mypy (==1.14.*)", "pytest-mypy"]
|
|
184
|
-
|
|
185
|
-
[metadata]
|
|
186
|
-
lock-version = "2.1"
|
|
187
|
-
python-versions = ">= 3.9"
|
|
188
|
-
content-hash = "01e6ac2d2a5f6b5e0bda939c88ab4dd01b0d2c9f9041ebcdf6483df7c07c06bf"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|