Skip to content

Commit 42b9230

Browse files
committed
Update NWN general and optimzer schemas with validation rules for GasHeater and ElectricBoiler
1 parent 676a482 commit 42b9230

2 files changed

Lines changed: 94 additions & 8 deletions

File tree

testdata/schemas/schema_NWN_general.json

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
"args": {
2323
"types": [
2424
"HeatPump",
25+
"GasHeater",
26+
"ElectricBoiler",
2527
"HeatProducer",
2628
"GeothermalSource",
2729
"ResidualHeatSource",
@@ -238,6 +240,47 @@
238240
}
239241
}
240242
},
243+
{
244+
"name": "gasheater_or_eboiler_required_attributes_are_set",
245+
"description": "Report errors if the required attributes of GasHeater or ElectricBoiler are not set.",
246+
"type": "error",
247+
"message": "Required attribute not set",
248+
"selects": [
249+
{
250+
"function": "get",
251+
"alias": "assets",
252+
"args": {
253+
"type": ["GasHeater", "ElectricBoiler"]
254+
}
255+
}
256+
],
257+
"check": {
258+
"function": "attributes_validation",
259+
"dataset": "assets",
260+
"args": {
261+
"null_checks": [
262+
{
263+
"attribute": "name",
264+
"count_as_null": [""]
265+
},
266+
{
267+
"attribute": "power",
268+
"count_as_null": [0.0]
269+
}
270+
],
271+
"valid_checks": [
272+
{
273+
"attribute": "efficiency",
274+
"in_range": {
275+
"min": 0.0,
276+
"max": 1.0
277+
}
278+
}
279+
],
280+
"resultMsgJSON": true
281+
}
282+
}
283+
},
241284
{
242285
"name": "producers_required_attributes_are_set",
243286
"description": "Report errors if the required attributes of heat producer assets are not set. HeatProducer also includes GeothermalSource and ResidualHeatSource",
@@ -389,7 +432,7 @@
389432
"function": "get",
390433
"alias": "assets",
391434
"args": {
392-
"type": ["HeatProducer"],
435+
"type": ["HeatProducer", "GasHeater", "ElectricBoiler"],
393436
"exclude_type": ["SolarCollector"]
394437
}
395438
}

testdata/schemas/schema_NWN_optimizer.json

Lines changed: 50 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
"function": "get",
8383
"alias": "assets",
8484
"args": {
85-
"type": ["HeatPump", "HeatProducer", "ATES", "HeatExchange"]
85+
"type": ["HeatPump", "GasHeater", "ElectricBoiler", "HeatProducer", "ATES", "HeatExchange"]
8686
}
8787
}
8888
],
@@ -250,15 +250,58 @@
250250
}
251251
},
252252
{
253-
"name": "variableOperationalCosts_EUR_MWh_are_set",
253+
"name": "required_variableOperationalCosts_EUR_m3_are_set",
254+
"description": "Report errors if costInformation.variableOperationalCosts [EUR/m3] are not set or incorrectly set for the defined assets.",
255+
"type": "error",
256+
"message": "Variable Operational Costs [EUR/m3] is incomplete or incorrect",
257+
"selects": [{
258+
"function": "get",
259+
"alias": "assets",
260+
"args": {
261+
"type": ["GasHeater"]
262+
}
263+
}
264+
],
265+
"check": {
266+
"function": "attributes_validation",
267+
"dataset": "assets",
268+
"args": {
269+
"null_checks": [
270+
{ "attribute": "costInformation.variableOperationalCosts.value", "count_as_null": [0.0] }
271+
],
272+
"valid_checks": [],
273+
"resultMsgJSON": true
274+
},
275+
"and": [
276+
{
277+
"function": "attributes_validation",
278+
"args": {
279+
"ref": {
280+
"path": "costInformation.variableOperationalCosts.profileQuantityAndUnit"
281+
},
282+
"null_checks": [],
283+
"valid_checks": [
284+
{ "attribute": "unit", "count_as_valid": "EURO" },
285+
{ "attribute": "perUnit", "count_as_valid": "CUBIC_METRE" },
286+
{ "attribute": "perMultiplier", "count_as_valid": "Unset" },
287+
{ "attribute": "perTimeUnit", "count_as_valid": "Unset" }
288+
],
289+
"resultMsgJSON": true
290+
}
291+
}
292+
]
293+
}
294+
},
295+
{
296+
"name": "required_variableOperationalCosts_EUR_MWh_are_set",
254297
"description": "Report errors if costInformation.variableOperationalCosts [EUR/MWh] are not set or incorrectly set for the defined assets.",
255298
"type": "error",
256299
"message": "Variable Operational Costs [EUR/MWh] is incomplete or incorrect",
257300
"selects": [{
258301
"function": "get",
259302
"alias": "assets",
260303
"args": {
261-
"type": ["HeatPump", "HeatProducer"]
304+
"type": ["HeatPump", "ElectricBoiler", "HeatProducer"]
262305
}
263306
}
264307
],
@@ -301,7 +344,7 @@
301344
"function": "get",
302345
"alias": "assets",
303346
"args": {
304-
"type": ["HeatPump", "HeatProducer", "HeatStorage", "HeatExchange"]
347+
"type": ["HeatPump", "GasHeater", "ElectricBoiler", "HeatProducer", "HeatStorage", "HeatExchange"]
305348
}
306349
}
307350
],
@@ -430,7 +473,7 @@
430473
"function": "get",
431474
"alias": "assets",
432475
"args": {
433-
"type": ["HeatPump", "HeatProducer"]
476+
"type": ["HeatPump", "GasHeater", "ElectricBoiler", "HeatProducer"]
434477
}
435478
}
436479
],
@@ -510,14 +553,14 @@
510553
},
511554
{
512555
"name": "optional_fixedMaintenanceCosts_are_set",
513-
"description": "Report warnings if costInformation.fixedMaintenanceCosts [EUR/MW/yr] or [[EUR/kW/yr] are not set or incorrectly set for the defined assets.",
556+
"description": "Report warnings if costInformation.fixedMaintenanceCosts [EUR/MW/yr] or [EUR/kW/yr] are not set or incorrectly set for the defined assets.",
514557
"type": "warning",
515558
"message": "Fixed Maintenance Costs [EUR/MW/yr] or [EUR/kW/yr] is incomplete or incorrect",
516559
"selects": [{
517560
"function": "get",
518561
"alias": "assets",
519562
"args": {
520-
"type": ["HeatPump", "HeatProducer", "HeatingDemand", "ATES", "HeatExchange"]
563+
"type": ["HeatPump", "GasHeater", "ElectricBoiler", "HeatProducer", "HeatingDemand", "ATES", "HeatExchange"]
521564
}
522565
}
523566
],

0 commit comments

Comments
 (0)