Skip to content

[2] Design basis not required #88

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion power-curve-schema/examples/generic-117-3.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion power-curve-schema/examples/generic-274-20.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
17 changes: 8 additions & 9 deletions power-curve-schema/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -375,7 +375,7 @@
"uniqueItems": true
}
},
"required": ["document", "turbine", "design_bases", "power_curves"],
"required": ["document", "turbine", "power_curves"],
"properties": {
"document": {
"type": "object",
Expand Down Expand Up @@ -442,7 +442,7 @@
"drive_type",
"regulation_type",
"grid_frequencies",
"thermal_shutdown"
"thermal_regulation"
],
"properties": {
"manufacturer_name": {
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -1049,7 +1049,6 @@
"label",
"name",
"description",
"design_bases",
"cuts",
"parameters",
"power_is_coefficient",
Expand All @@ -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"
},
Expand Down
9 changes: 4 additions & 5 deletions test/test_design_basis.py
Original file line number Diff line number Diff line change
@@ -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


Expand All @@ -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)