diff --git a/src/libecalc/expression/expression.py b/src/libecalc/expression/expression.py index 51289e7c22..54ea684461 100644 --- a/src/libecalc/expression/expression.py +++ b/src/libecalc/expression/expression.py @@ -114,7 +114,7 @@ def __modify_schema__(cls, field_schema): {"type": "number"}, { "type": "string", - "pattern": r"^[\w * ^ . : ; () {} = > < + \- /]+$", + "pattern": r"^[\w * ^ . : ; () {} = > < + \- /$]+$", }, ], examples=["SIM1;OIL_PROD {+} 1000", 5], diff --git a/src/libecalc/input/validation/json_schemas/models-compressor-chart.json b/src/libecalc/input/validation/json_schemas/models-compressor-chart.json index a78a845cb9..47eb8b34de 100644 --- a/src/libecalc/input/validation/json_schemas/models-compressor-chart.json +++ b/src/libecalc/input/validation/json_schemas/models-compressor-chart.json @@ -207,13 +207,14 @@ }, { "type": "object", - "properties": { - "SPEED": { "type": "number" }, - "RATE": { "type": "array", "items": { "type": "number" } }, - "HEAD": { "type": "array", "items": { "type": "number" } }, - "EFFICIENCY": { "type": "array", "items": { "type": "number" } } + "properties": { + "SPEED": { "type": "number" }, + "RATE": { "type": "array", "items": { "type": "number" } }, + "HEAD": { "type": "array", "items": { "type": "number" } }, + "EFFICIENCY": { "type": "array", "items": { "type": "number" } } + }, + "additionalProperties": false } - } ] }, "DESIGN_RATE": { diff --git a/src/libecalc/input/validation/json_schemas/models-single-speed-compressor-train.json b/src/libecalc/input/validation/json_schemas/models-single-speed-compressor-train.json index 66bd54f5ce..986537ca15 100644 --- a/src/libecalc/input/validation/json_schemas/models-single-speed-compressor-train.json +++ b/src/libecalc/input/validation/json_schemas/models-single-speed-compressor-train.json @@ -101,8 +101,7 @@ "NAME", "TYPE", "FLUID_MODEL", - "COMPRESSOR_TRAIN", - "PRESSURE_CONTROL" + "COMPRESSOR_TRAIN" ] }, "INLET_TEMPERATURE": { diff --git a/src/libecalc/input/yaml_types/components/yaml_generator_set.py b/src/libecalc/input/yaml_types/components/yaml_generator_set.py index 1112844e55..f01380d55a 100644 --- a/src/libecalc/input/yaml_types/components/yaml_generator_set.py +++ b/src/libecalc/input/yaml_types/components/yaml_generator_set.py @@ -35,7 +35,7 @@ def schema_extra(schema: Dict[str, Any], model: Type["YamlGeneratorSet"]) -> Non title="NAME", description="Name of the generator set.\n\n$ECALC_DOCS_KEYWORDS_URL/NAME", ) - category: ConsumerUserDefinedCategoryType = CategoryField(...) + category: YamlTemporalModel[ConsumerUserDefinedCategoryType] = CategoryField(...) fuel: YamlTemporalModel[str] = Field( None, title="FUEL", diff --git a/src/tests/libecalc/input/validation/snapshots/test_validation_json_schemas/test_json_schema_changed/schemas.json b/src/tests/libecalc/input/validation/snapshots/test_validation_json_schemas/test_json_schema_changed/schemas.json index faf0a8b465..1466c3471c 100644 --- a/src/tests/libecalc/input/validation/snapshots/test_validation_json_schemas/test_json_schema_changed/schemas.json +++ b/src/tests/libecalc/input/validation/snapshots/test_validation_json_schemas/test_json_schema_changed/schemas.json @@ -652,9 +652,15 @@ "additionalProperties": false, "properties": { "CATEGORY": { - "allOf": [ + "anyOf": [ { "$ref": "#/definitions/ConsumerUserDefinedCategoryType" + }, + { + "additionalProperties": { + "$ref": "#/definitions/ConsumerUserDefinedCategoryType" + }, + "type": "object" } ], "description": "Output category/tag.\n\nhttps://test.ecalc.equinor.com/docs/docs/modelling/keywords/CATEGORY", @@ -834,7 +840,7 @@ "type": "number" }, { - "pattern": "^[\\w * ^ . : ; () {} = > < + \\- /]+$", + "pattern": "^[\\w * ^ . : ; () {} = > < + \\- /$]+$", "type": "string" } ], @@ -854,7 +860,7 @@ "type": "number" }, { - "pattern": "^[\\w * ^ . : ; () {} = > < + \\- /]+$", + "pattern": "^[\\w * ^ . : ; () {} = > < + \\- /$]+$", "type": "string" } ], @@ -886,7 +892,7 @@ "type": "number" }, { - "pattern": "^[\\w * ^ . : ; () {} = > < + \\- /]+$", + "pattern": "^[\\w * ^ . : ; () {} = > < + \\- /$]+$", "type": "string" } ], @@ -906,7 +912,7 @@ "type": "number" }, { - "pattern": "^[\\w * ^ . : ; () {} = > < + \\- /]+$", + "pattern": "^[\\w * ^ . : ; () {} = > < + \\- /$]+$", "type": "string" } ], @@ -1370,7 +1376,7 @@ "type": "number" }, { - "pattern": "^[\\w * ^ . : ; () {} = > < + \\- /]+$", + "pattern": "^[\\w * ^ . : ; () {} = > < + \\- /$]+$", "type": "string" } ], @@ -2816,6 +2822,7 @@ "type": "object" }, { + "additionalProperties": false, "properties": { "EFFICIENCY": { "items": { @@ -3477,8 +3484,7 @@ "NAME", "TYPE", "FLUID_MODEL", - "COMPRESSOR_TRAIN", - "PRESSURE_CONTROL" + "COMPRESSOR_TRAIN" ], "then": { "unevaluatedProperties": {