diff --git a/antarest/study/business/areas/properties_management.py b/antarest/study/business/areas/properties_management.py index 1c18ca2b45..5b1a88546b 100644 --- a/antarest/study/business/areas/properties_management.py +++ b/antarest/study/business/areas/properties_management.py @@ -20,21 +20,6 @@ # Keep the order FILTER_OPTIONS = ["hourly", "daily", "weekly", "monthly", "annual"] DEFAULT_FILTER_VALUE = FILTER_OPTIONS -DEFAULT_UI = { - "color_r": 230, - "color_g": 108, - "color_b": 44, -} - - -def encode_color(ui: Dict[str, Any]) -> str: - data = {**DEFAULT_UI, **ui} - return f"{data['color_r']},{data['color_g']},{data['color_b']}" - - -def decode_color(encoded_color: str, current_ui: Optional[Dict[str, int]]) -> Dict[str, Any]: - r, g, b = map(int, encoded_color.split(",")) - return {**(current_ui or {}), "color_r": r, "color_g": g, "color_b": b} def sort_filter_options(options: Iterable[str]) -> List[str]: @@ -60,9 +45,6 @@ class AdequacyPatchMode(EnumIgnoreCase): class PropertiesFormFields(FormFieldsBaseModel): - color: Optional[str] = Field(regex="^\s*\d{1,3}\s*,\s*\d{1,3}\s*,\s*\d{1,3}\s*$") - pos_x: Optional[float] - pos_y: Optional[float] energy_cost_unsupplied: Optional[float] energy_cost_spilled: Optional[float] non_dispatch_power: Optional[bool] @@ -89,21 +71,6 @@ def validation(cls, values: Dict[str, Any]) -> Dict[str, Any]: FIELDS_INFO: Dict[str, FieldInfo] = { - # `color` must be before `pos_x` and `pos_y`, because they are include in the `decode_color`'s return dict value - "color": { - "path": UI_PATH, - "encode": encode_color, - "decode": decode_color, - "default_value": encode_color(DEFAULT_UI), - }, - "pos_x": { - "path": f"{UI_PATH}/x", - "default_value": 0.0, - }, - "pos_y": { - "path": f"{UI_PATH}/y", - "default_value": 0.0, - }, "energy_cost_unsupplied": { "path": THERMAL_PATH.format(field="unserverdenergycost"), "default_value": 0.0, diff --git a/tests/integration/test_integration.py b/tests/integration/test_integration.py index ffa4d4a91d..1dc1b385ae 100644 --- a/tests/integration/test_integration.py +++ b/tests/integration/test_integration.py @@ -1095,9 +1095,6 @@ def test_area_management(client: TestClient, admin_access_token: str, study_id: res_properties_config_json["filterSynthesis"] = set(res_properties_config_json["filterSynthesis"]) res_properties_config_json["filterByYear"] = set(res_properties_config_json["filterByYear"]) assert res_properties_config_json == { - "color": "230,108,44", - "posX": 0.0, - "posY": 0.0, "energyCostUnsupplied": 0.0, "energyCostSpilled": 0.0, "nonDispatchPower": True, @@ -1112,9 +1109,6 @@ def test_area_management(client: TestClient, admin_access_token: str, study_id: f"/v1/studies/{study_id}/areas/area 1/properties/form", headers=admin_headers, json={ - "color": "123,108,96", - "posX": 3.4, - "posY": 9.0, "energyCostUnsupplied": 2.0, "energyCostSpilled": 4.0, "nonDispatchPower": False, @@ -1130,9 +1124,6 @@ def test_area_management(client: TestClient, admin_access_token: str, study_id: res_properties_config_json["filterSynthesis"] = set(res_properties_config_json["filterSynthesis"]) res_properties_config_json["filterByYear"] = set(res_properties_config_json["filterByYear"]) assert res_properties_config_json == { - "color": "123,108,96", - "posX": 3.4, - "posY": 9.0, "energyCostUnsupplied": 2.0, "energyCostSpilled": 4.0, "nonDispatchPower": False,