合并 agent-mvp 到 master #1
@@ -29,6 +29,10 @@ def _scheme_type_option(scheme_type: str | None) -> str:
|
||||
return scheme_type or "simulation"
|
||||
|
||||
|
||||
def _backend_element_type(element_type: ElementType) -> str:
|
||||
return "link" if element_type == ElementType.PIPE else "node"
|
||||
|
||||
|
||||
def _validate_element_property(element_type: ElementType, property_name: str, *, option_name: str) -> str:
|
||||
valid_fields = timeseries_fields_for_element_type(element_type)
|
||||
if property_name not in valid_fields:
|
||||
@@ -117,7 +121,7 @@ def data_realtime_simulation_by_id_time(
|
||||
path="/timeseries/realtime/simulation-results",
|
||||
params={
|
||||
"id": id,
|
||||
"type": type.value,
|
||||
"type": _backend_element_type(type),
|
||||
"query_time": parse_time_with_timezone(time, option_name="--time").isoformat(),
|
||||
},
|
||||
require_auth=True,
|
||||
@@ -139,7 +143,7 @@ def data_realtime_simulation_by_time_property(
|
||||
method="GET",
|
||||
path="/timeseries/realtime/records",
|
||||
params={
|
||||
"type": type.value,
|
||||
"type": _backend_element_type(type),
|
||||
"query_time": parse_time_with_timezone(time, option_name="--time").isoformat(),
|
||||
"property": property,
|
||||
},
|
||||
@@ -218,7 +222,7 @@ def data_scheme_simulation(
|
||||
"scheme_name": resolve_scheme(runtime, scheme, required=True),
|
||||
"scheme_type": _scheme_type_option(scheme_type),
|
||||
"query_time": parse_time_with_timezone(time, option_name="--time").isoformat(),
|
||||
"type": type.value,
|
||||
"type": _backend_element_type(type),
|
||||
}
|
||||
if query == SimulationQuery.BY_ID_TIME:
|
||||
if not id:
|
||||
|
||||
Reference in New Issue
Block a user