diff --git a/power-curve-schema/examples/generic-117-3.json b/power-curve-schema/examples/generic-117-3.json index 36b3111..1e33fdd 100644 --- a/power-curve-schema/examples/generic-117-3.json +++ b/power-curve-schema/examples/generic-117-3.json @@ -32,7 +32,7 @@ "drive_type": "geared", "regulation_type": "pitch", "grid_frequencies": [50, 60], - "thermal_shutdown": { + "thermal_regulation": { "derating": [ { "$comment": "Linear ramp down in low temperatures, altitude 2500", diff --git a/power-curve-schema/examples/generic-274-20.json b/power-curve-schema/examples/generic-274-20.json index db5cf3b..d750b59 100644 --- a/power-curve-schema/examples/generic-274-20.json +++ b/power-curve-schema/examples/generic-274-20.json @@ -32,7 +32,7 @@ "drive_type": "geared", "regulation_type": "pitch", "grid_frequencies": [50, 60], - "thermal_shutdown": { + "thermal_regulation": { "derating": [ { "$comment": "Linear ramp down in low temperatures, air density 1.3", diff --git a/power-curve-schema/schema.json b/power-curve-schema/schema.json index 9d83fb4..59a155c 100644 --- a/power-curve-schema/schema.json +++ b/power-curve-schema/schema.json @@ -118,9 +118,9 @@ }, "examples": [[50], [50, 60]] }, - "thermal_shutdown": { - "title": "Thermal Shutdown and Deratings", - "description": "Define thermal shutdown characteristic", + "thermal_regulation": { + "title": "Thermal Regulation", + "description": "Define thermal shutdowns and derating characteristics", "type": "object", "properties": { "cold": { @@ -375,7 +375,7 @@ "uniqueItems": true } }, - "required": ["document", "turbine", "design_bases", "power_curves"], + "required": ["document", "turbine", "power_curves"], "properties": { "document": { "type": "object", @@ -442,7 +442,7 @@ "drive_type", "regulation_type", "grid_frequencies", - "thermal_shutdown" + "thermal_regulation" ], "properties": { "manufacturer_name": { @@ -527,8 +527,8 @@ "rated_power": { "$ref": "#/$defs/rated_power" }, - "thermal_shutdown": { - "$ref": "#/$defs/thermal_shutdown" + "thermal_regulation": { + "$ref": "#/$defs/thermal_regulation" }, "cut_in_rpm": { "$ref": "#/$defs/cut_in_rpm" @@ -1049,7 +1049,6 @@ "label", "name", "description", - "design_bases", "cuts", "parameters", "power_is_coefficient", @@ -1076,7 +1075,7 @@ }, "design_bases": { "type": "array", - "description": "A list of the design basis labels relevant to this power curve", + "description": "A list of the design basis labels relevant to this mode. The 'design_bases' array is not required, so this field is also not required. However, if the 'design_bases' array is provided, this field should be populated in order to determine the applicable base(s).", "items": { "type": "string" }, diff --git a/test/test_design_basis.py b/test/test_design_basis.py index 2db105a..6d708a3 100644 --- a/test/test_design_basis.py +++ b/test/test_design_basis.py @@ -1,9 +1,10 @@ # Turn off pylint warnings unavoidable with pytest # pylint: disable=redefined-outer-name, line-too-long, redefined-builtin, missing-module-docstring +import pytest from jsonschema import validate from jsonschema.exceptions import ValidationError -import pytest + from .helpers import get_subschema @@ -19,7 +20,5 @@ def test_generic_11_3_design_basis_1(subschema, generic_117_3): def test_missing_design_basis(subschema): - """Validation should fail if there is no design basis section""" - with pytest.raises(ValidationError) as e: - validate(instance={}, schema=subschema) - assert "'design_bases' is a required property" in str(e) + """Validation should pass if there is no design basis section""" + validate(instance={}, schema=subschema)