Skip to content

Commit 491b82a

Browse files
committed
Update NWN general and optimizer schemas to support DataTableProfile as a profile reference type and handling of pipe and joint related reference validation
1 parent 8d51e11 commit 491b82a

File tree

2 files changed

+54
-25
lines changed

2 files changed

+54
-25
lines changed

testdata/schemas/schema_NWN_general.json

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -179,30 +179,6 @@
179179
}
180180
}
181181
},
182-
{
183-
"name": "supply_return_combination",
184-
"description": "Pipes, joints and heat commodities must have a name with +_ret for return network",
185-
"type": "error",
186-
"message": "Pipe, Joint, or HeatCommodity must have a paired entity. (A combination of supply and return parts, and with a suffix of _ret on the return entity name)",
187-
"selects": [{
188-
"function": "get",
189-
"alias": "pipes_joints",
190-
"args": {
191-
"type": ["Pipe", "Joint", "HeatCommodity"],
192-
"property": ["name"]
193-
}
194-
}
195-
],
196-
"check": {
197-
"function": "has_pair",
198-
"dataset": "pipes_joints",
199-
"args": {
200-
"property": "name",
201-
"keyword": "_ret",
202-
"resultMsgJSON": true
203-
}
204-
}
205-
},
206182
{
207183
"name": "heatpump_required_attributes_are_set",
208184
"description": "Report errors if the required attributes of HeatPump are not set.",

testdata/schemas/schema_NWN_optimizer.json

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,59 @@
33
"description": "Schema to validate optimizer requirements",
44
"pre_validation_schemas": ["NWN general validation schema"],
55
"validations": [
6+
{
7+
"name": "supply_return_combination",
8+
"description": "Heat commodities must have a name with '_ret' for the return part",
9+
"type": "error",
10+
"message": "HeatCommodity must have a paired entity. (A combination of supply and return parts, and with a suffix of _ret on the return entity name)",
11+
"selects": [{
12+
"function": "get",
13+
"alias": "heat_commodities",
14+
"args": {
15+
"type": ["HeatCommodity"],
16+
"property": ["name"]
17+
}
18+
}
19+
],
20+
"check": {
21+
"function": "has_pair",
22+
"dataset": "heat_commodities",
23+
"args": {
24+
"property": "name",
25+
"keyword": "_ret",
26+
"resultMsgJSON": true
27+
}
28+
}
29+
},
30+
{
31+
"name": "pipe_or_joint_supply_return_combination",
32+
"description": "Report a warning if a pipe or joint does not have a (e.g., supply and return) related part specified",
33+
"type": "warning",
34+
"message": "The pipe or joint is missing a related supply or return entity.",
35+
"selects": [
36+
{
37+
"function": "get",
38+
"alias": "assets",
39+
"args": {
40+
"type": ["Pipe", "Joint"]
41+
}
42+
}
43+
],
44+
"check": {
45+
"function": "attributes_validation",
46+
"dataset": "assets",
47+
"args": {
48+
"null_checks": [
49+
{
50+
"attribute": "related",
51+
"count_as_null": [""]
52+
}
53+
],
54+
"valid_checks": [],
55+
"resultMsgJSON": true
56+
}
57+
}
58+
},
659
{
760
"name": "ATES_required_attributes_for_optimizer_use_are_set",
861
"description": "Report errors if the required attributes of ATES assets for optimizer use are not set.",
@@ -660,7 +713,7 @@
660713
"ref": {
661714
"path": "profile",
662715
"ref_list_filter": {
663-
"is_type": "InfluxDBProfile"
716+
"is_type": ["InfluxDBProfile", "DataTableProfile"]
664717
}
665718
},
666719
"null_checks": [

0 commit comments

Comments
 (0)