Skip to content
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

L200 up to 6.2.1.6 #37

Merged
merged 81 commits into from
Oct 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
20ec678
feat(L200): add envelope roof tests
macintoshpie Sep 14, 2020
c2cfa4e
feat(L200): add envelope wall tests
macintoshpie Sep 14, 2020
b98ee18
feat(L200): add envelope fenestration tests
macintoshpie Sep 15, 2020
ec6509d
feat(L200): add foundation system tests
macintoshpie Sep 15, 2020
64210c4
feat(L200): add tightness tests
macintoshpie Sep 15, 2020
355272e
fix(exemplary): fix MMBtu units for NG ResourceUse
macintoshpie Sep 17, 2020
583e82e
feat(L200): test HVAC systems year installed
macintoshpie Sep 17, 2020
0cb1a35
feat(L200): add capacity and condition tests
macintoshpie Sep 18, 2020
11b5f74
feat(L200): add central plant tests
macintoshpie Sep 18, 2020
8a07c2e
feat(L200): add air distribution tests
macintoshpie Sep 22, 2020
fcb1d48
feat(L200): add outdoor air delivery tests
macintoshpie Sep 22, 2020
8bc4759
feat(L200): add duct condition tests
macintoshpie Sep 22, 2020
7f3f6e2
feat(L200): add plant pump tests
macintoshpie Sep 23, 2020
90456bc
feat(L200): add hvac controls tests
macintoshpie Sep 23, 2020
ae07352
feat(L200): add hvac zone controls test
macintoshpie Sep 23, 2020
89821b3
feat(L200): add BAS tests
macintoshpie Sep 23, 2020
dd42891
feat(L200): tie up remaining HVAC loose ends
macintoshpie Sep 23, 2020
705fe6c
feat(L200): break out EnvelopeSystems test
corymosiman12 Sep 24, 2020
2d791ae
feat(L200): EnvelopeSystems - add test to check Whole Building sectio…
corymosiman12 Sep 24, 2020
ab7af1e
feat(L200): EnvelopeSystems - add test to check a Roof exists as part…
corymosiman12 Sep 24, 2020
a3031f4
feat(L200): EnvelopeSystem - ensure warning fired for each auc:Side n…
corymosiman12 Sep 24, 2020
144bafc
feat(L200): EnvelopeSystem - add assertion if auc:Side has no auc:Wall
corymosiman12 Sep 24, 2020
9d181f2
feat(L200): EnvelopeSystem - ensure foundation exists under section w…
corymosiman12 Sep 24, 2020
daeaf8f
refactor(L200): add predicate for selecting external doors
macintoshpie Sep 24, 2020
20423b9
feat(L200): add excluded section id tests
macintoshpie Sep 24, 2020
3ca7b50
feat(L200): add utility billpayer test
macintoshpie Sep 24, 2020
2f3b068
feat(L200): add occupancy schedule test
macintoshpie Sep 24, 2020
63723ad
feat(L200): add HVAC schedule tests
macintoshpie Sep 24, 2020
5cdcd9b
feat(L200): test overall door to wall ratio
macintoshpie Sep 24, 2020
75f250b
feat(L200): DHW system type
macintoshpie Sep 25, 2020
84091df
feat(L200): add operating conditions and general condition tests
macintoshpie Sep 25, 2020
b4b0914
feat(L200): add lighting tests
macintoshpie Sep 25, 2020
c720a9d
feat(L200): add load and conveyance tests
macintoshpie Sep 25, 2020
6bfcc84
feat(L200): copy L100 historical monthly energy use
macintoshpie Sep 25, 2020
4861065
feat(L200): add peak type test
macintoshpie Sep 25, 2020
bb18b4d
feat(L200): add elec load factor test
macintoshpie Sep 25, 2020
fda4b78
feat(L200): add submetering test
macintoshpie Sep 25, 2020
5460a9e
feat(L200): add initial EEM tests
macintoshpie Sep 25, 2020
fe8eecb
feat(L200): Update IntervalDuration to match dates; Update LoadFactor…
corymosiman12 Sep 28, 2020
f3f4b96
chore: address pr comments on example bsync files
macintoshpie Sep 30, 2020
7b064b5
refactor(L200): don't require Central fan to be linked to duct system
macintoshpie Sep 30, 2020
ba273fc
feat(L200): finish Measure requirements
macintoshpie Sep 30, 2020
20f3e2f
feat(L200): finish EEM tests
macintoshpie Sep 30, 2020
94e2a78
feat(L200): test heating and cooling sources
macintoshpie Sep 30, 2020
484ea72
feat(L200): add checks for heating and cooling source tests
macintoshpie Oct 1, 2020
d5c3ec7
fix(L200): if AirSideEconomizer=None must include EconomizerControl
macintoshpie Oct 2, 2020
a5279af
fix(L200): require Central fan to be linked to Duct
macintoshpie Oct 8, 2020
95ae962
feat(L200): add Section linked System requirements
macintoshpie Oct 8, 2020
91f6824
feat(L200): add submeter requirements
macintoshpie Oct 8, 2020
296b1d6
refactor(L200): add more submeter examples
macintoshpie Oct 8, 2020
6d72a05
Merge branch 'develop' into feat/L200-6.2.1.6
macintoshpie Oct 9, 2020
f8621eb
feat(L200): add capacity requirements for condenser plants
macintoshpie Oct 9, 2020
6d3a4d9
refactor(L200): change plant requirement from output capacity to capa…
macintoshpie Oct 9, 2020
0a83394
feat(L200): require lighting systems to be linked to schedule
macintoshpie Oct 9, 2020
c9f0959
feat(L200): require scenarios linked to building
macintoshpie Oct 13, 2020
ab6c31b
feat: add clean_all arg to CLI tool; enable consistent xml file forma…
corymosiman12 Oct 15, 2020
a4e1cc4
style: run cleanup
corymosiman12 Oct 15, 2020
af97fac
fix: add back content to deleted file, tests passing
corymosiman12 Oct 15, 2020
5197247
fix: doctype declaration in generate_sch function
corymosiman12 Oct 15, 2020
0033e68
refactor(tools): add clean_file to pre-commit
macintoshpie Oct 15, 2020
3ae85f7
chore: delete empty example xml file
macintoshpie Oct 15, 2020
f8dcab0
refactor: add pre-commit to tox
macintoshpie Oct 15, 2020
7159c48
style: fix for pre-commit
macintoshpie Oct 15, 2020
f71903c
Merge pull request #49 from BuildingSync/feat/xml-file-clean
corymosiman12 Oct 15, 2020
66d147c
Merge branch 'develop' into feat/L200-6.2.1.6
corymosiman12 Oct 19, 2020
803b643
Merge branch 'develop' into feat/L200-6.2.1.6
corymosiman12 Oct 19, 2020
1339ae2
style: run clean_all
corymosiman12 Oct 19, 2020
0da60a8
fix: update XSD to v2.2.0 in L200 file
corymosiman12 Oct 19, 2020
af8c8dd
feat(eems): update L200 file measures
corymosiman12 Oct 19, 2020
69e1c2f
fix: remove requirement that every window and door must be linked to …
corymosiman12 Oct 19, 2020
3c5ab04
text(fix): envelope tests passing
corymosiman12 Oct 19, 2020
2b65b4a
Merge pull request #51 from BuildingSync/feat/eems
macintoshpie Oct 20, 2020
a99187d
feat(L200): add AnnualHeatingEfficiency reqs
macintoshpie Oct 21, 2020
ffa31a1
refactor(L200): dont require Capacity for Delivery
macintoshpie Oct 21, 2020
b0bb041
refactor(L200)!: generalize linked delivery for all CentralAirDistrib…
macintoshpie Oct 21, 2020
2cbc6ac
refactor(L200)!: require AnnualFuelUse for submeters
macintoshpie Oct 21, 2020
baedd9e
refactor(L200): change Delivery requirement to XOR
macintoshpie Oct 21, 2020
06c85b5
fix(L200): fix section type in exemplary file
macintoshpie Oct 23, 2020
ca9a4ca
refactor(L200): update fan and pump requirements
macintoshpie Oct 23, 2020
6e234e8
refactor(L200): update section system requirements
macintoshpie Oct 23, 2020
4fb1834
fix(L200): fix exemplary file DHW
macintoshpie Oct 23, 2020
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
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,10 @@ repos:
hooks:
- id: flake8
args: ['--ignore=E501,E402,W503,W504,E731,F401']
- repo: local
hooks:
- id: format-xml
name: format xml and sch files
language: system
entry: python buildingsch.py clean
files: ^.*.(xml|sch)$
45 changes: 45 additions & 0 deletions buildingsch.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

from tools.validate_sch import validate_schematron, print_failure
from tools.generate_sch import generate_sch
from tools.clean_xml import clean_files


def validate_schematrons(args):
Expand Down Expand Up @@ -58,6 +59,35 @@ def generate_all_schematron(args):
sys.exit(0)


def _clean_files(args):
for filename in args.filenames:
clean_files(filename)


def clean_all_files(args):
"""
Cleans all *.sch and *.xml files in the schematron directory. Cleaning consists of:
- Removing blank lines
- Two space indentation
- Serializing with doctype = '<?xml version="1.0" encoding="UTF-8"?>
"""
base_dir = 'schematron/'
updated_files = []
for root, _, files in os.walk(base_dir):
for name in files:
if not name.endswith('.xml') and not name.endswith('.sch'):
continue
filename = os.path.join(root, name)
updated = clean_files(filename)
if updated:
updated_files.append(filename)

for file_ in updated_files:
print(file_)

sys.exit(0)


# Construct Parsers
parser = argparse.ArgumentParser(description='Tool for validating and generating Schematron documents')
subparsers = parser.add_subparsers()
Expand Down Expand Up @@ -145,6 +175,21 @@ def generate_all_schematron(args):
)
parser_generate.set_defaults(func=generate_all_schematron)

# Clean command
parser_clean_files = subparsers.add_parser('clean', description='Command for formatting one ore more *.xml or *.sch files')
parser_clean_files.add_argument(
'filenames',
metavar='filenames',
type=str,
help='File(s) to clean',
nargs='+'
)
parser_clean_files.set_defaults(func=_clean_files)

# Clean all command
parser_clean_all_files = subparsers.add_parser('clean_all', description='Command for formatting all *.xml and *.sch files')
parser_clean_all_files.set_defaults(func=clean_all_files)

# command with no sub-commands should just print help
parser.set_defaults(func=lambda _: parser.print_help())

Expand Down
2 changes: 1 addition & 1 deletion schematron/lib/buildingElements.sch
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
<assert test="auc:Address/auc:StreetAddressDetail/auc:Simplified/auc:StreetAddress" role="ERROR">element 'auc:StreetAddress' within element 'auc:Address/auc:StreetAddressDetail/auc:Simplified' is REQUIRED EXACTLY ONCE for: '<name/>'</assert>
</rule>
</pattern>
<!-- Check for Lat and Long at the building level-->
<!-- Check for Lat and Long at the building level-->
<pattern id="be.latLong">
<rule context="auc:Buildings/auc:Building">
<assert test="auc:Latitude" role="ERROR">element 'auc:Latitude' within element 'auc:Address' is REQUIRED EXACTLY ONCE for: '<name/>'</assert>
Expand Down
9 changes: 6 additions & 3 deletions schematron/lib/contactElements.sch
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,12 @@
<let name="numContacts" value="count(auc:Contact)"/>
<let name="numAuditors" value="count(auc:Contact/auc:ContactRoles/auc:ContactRole[text()='Energy Auditor'])"/>
<let name="numOwners" value="count(auc:Contact/auc:ContactRoles/auc:ContactRole[text()='Owner'])"/>
<assert test="$numContacts &gt;= 2" role="ERROR">element 'auc:Contact' is REQUIRED AT LEAST TWICE for: '<name/>’. Current number of occurrences: <value-of select="$numContacts"/></assert>
<assert test="$numAuditors &gt;= 1" role="ERROR">element 'auc:Contact' with child element 'auc:ContactRoles/auc:ContactRole' with value 'Energy Auditor' is REQUIRED AT LEAST ONCE for: '<name/>’. Current number of occurrences: <value-of select="$numAuditors"/></assert>
<assert test="$numOwners &gt;= 1" role="ERROR">element 'auc:Contact' with child element 'auc:ContactRoles/auc:ContactRole' with value 'Owner' is REQUIRED AT LEAST ONCE for: '<name/>’. Current number of occurrences: <value-of select="$numOwners"/></assert>
<assert test="$numContacts &gt;= 2" role="ERROR">element 'auc:Contact' is REQUIRED AT LEAST TWICE for: '<name/>&#8217;. Current number of occurrences: <value-of select="$numContacts"/>
</assert>
<assert test="$numAuditors &gt;= 1" role="ERROR">element 'auc:Contact' with child element 'auc:ContactRoles/auc:ContactRole' with value 'Energy Auditor' is REQUIRED AT LEAST ONCE for: '<name/>&#8217;. Current number of occurrences: <value-of select="$numAuditors"/>
</assert>
<assert test="$numOwners &gt;= 1" role="ERROR">element 'auc:Contact' with child element 'auc:ContactRoles/auc:ContactRole' with value 'Owner' is REQUIRED AT LEAST ONCE for: '<name/>&#8217;. Current number of occurrences: <value-of select="$numOwners"/>
</assert>
</rule>
</pattern>
<!--
Expand Down
30 changes: 20 additions & 10 deletions schematron/lib/floorElements.sch
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@
-->
<pattern abstract="true" id="fa.oneOfType">
<rule context="$parent">
<assert test="count(auc:FloorArea[auc:FloorAreaType = $floorAreaType]) = 1" role="ERROR">element 'auc:FloorAreaType' with value '<value-of select="$floorAreaType"/>' is REQUIRED EXACTLY ONCE within element 'auc:FloorArea' for '<name/>'. Currently occurs: <value-of select="count(auc:FloorArea[auc:FloorAreaType = $floorAreaType])"/></assert>
<assert test="count(auc:FloorArea[auc:FloorAreaType = $floorAreaType]) = 1" role="ERROR">element 'auc:FloorAreaType' with value '<value-of select="$floorAreaType"/>' is REQUIRED EXACTLY ONCE within element 'auc:FloorArea' for '<name/>'. Currently occurs: <value-of select="count(auc:FloorArea[auc:FloorAreaType = $floorAreaType])"/>
</assert>
</rule>
</pattern>
<!--
Expand Down Expand Up @@ -130,13 +131,20 @@
<let name="unconditionedArea" value="number(concat(substring($unconditionedAreaValueComputed, 1, $endTextPosition1UCA), substring($unconditionedAreaValue, 1, $endTextPosition2UCA)))"/>
<assert test="$conditionedArea &gt;= $cooledOnlyArea + $heatedOnlyArea + $heatedCooledArea + $ventilatedArea" role="ERROR">Conditioned Floor Area (<value-of select="$conditionedArea"/>) must be greater than or equal to: Heated and Cooled (<value-of select="$heatedCooledArea"/>) + Heated only (<value-of select="$heatedOnlyArea"/>) + Cooled only (<value-of select="$cooledOnlyArea"/>) + Ventilated (<value-of select="$ventilatedArea"/>)</assert>
<assert test="$grossArea &gt;= $conditionedArea + $unconditionedArea and $unconditionedArea &gt;= 0" role="ERROR">Gross Floor Area (<value-of select="$grossArea"/>) must be greater than or equal to: Conditioned (<value-of select="$conditionedArea"/>) + Unconditioned (<value-of select="$unconditionedArea"/>) AND Unconditioned Floor Area must be &gt; 0</assert>
<assert test="false()" role="INFO">'Gross' Floor Area: <value-of select="$grossArea"/></assert>
<assert test="false()" role="INFO">'Cooled only' Floor Area: <value-of select="$cooledOnlyArea"/></assert>
<assert test="false()" role="INFO">'Heated only' Floor Area: <value-of select="$heatedOnlyArea"/></assert>
<assert test="false()" role="INFO">'Heated and Cooled' Floor Area: <value-of select="$heatedCooledArea"/></assert>
<assert test="false()" role="INFO">'Ventilated' Floor Area: <value-of select="$ventilatedArea"/></assert>
<assert test="false()" role="INFO">'Conditioned' Floor Area: <value-of select="$conditionedArea"/></assert>
<assert test="false()" role="INFO">'Unconditioned' Floor Area: <value-of select="$unconditionedArea"/></assert>
<assert test="false()" role="INFO">'Gross' Floor Area: <value-of select="$grossArea"/>
</assert>
<assert test="false()" role="INFO">'Cooled only' Floor Area: <value-of select="$cooledOnlyArea"/>
</assert>
<assert test="false()" role="INFO">'Heated only' Floor Area: <value-of select="$heatedOnlyArea"/>
</assert>
<assert test="false()" role="INFO">'Heated and Cooled' Floor Area: <value-of select="$heatedCooledArea"/>
</assert>
<assert test="false()" role="INFO">'Ventilated' Floor Area: <value-of select="$ventilatedArea"/>
</assert>
<assert test="false()" role="INFO">'Conditioned' Floor Area: <value-of select="$conditionedArea"/>
</assert>
<assert test="false()" role="INFO">'Unconditioned' Floor Area: <value-of select="$unconditionedArea"/>
</assert>
</rule>
</pattern>
<!--
Expand Down Expand Up @@ -175,8 +183,10 @@
<let name="buildingGrossArea" value="number(auc:FloorAreas/auc:FloorArea[auc:FloorAreaType='Gross']/auc:FloorAreaValue)"/>
<let name="allSpaceFunctionSectionsGrossArea" value="number(sum(//auc:Section[auc:SectionType/text()='Space function']/auc:FloorAreas/auc:FloorArea[auc:FloorAreaType='Gross']/auc:FloorAreaValue))"/>
<assert test="$buildingGrossArea &gt;= $allSpaceFunctionSectionsGrossArea" role="ERROR">auc:Building Gross Floor (<value-of select="$buildingGrossArea"/>) Area MUST BE GREATER THAN OR EQUAL TO the sum of all Gross Floor areas from elements auc:Section[auc:SectionType='Space function'] (<value-of select="$allSpaceFunctionSectionsGrossArea"/>)</assert>
<assert test="false()" role="INFO">Building Gross Floor Area: <value-of select="$buildingGrossArea"/></assert>
<assert test="false()" role="INFO">Sum of all auc:Section[auc:SectionType='Space function'] Gross Floor Area: <value-of select="$allSpaceFunctionSectionsGrossArea"/></assert>
<assert test="false()" role="INFO">Building Gross Floor Area: <value-of select="$buildingGrossArea"/>
</assert>
<assert test="false()" role="INFO">Sum of all auc:Section[auc:SectionType='Space function'] Gross Floor Area: <value-of select="$allSpaceFunctionSectionsGrossArea"/>
</assert>
</rule>
</pattern>
<!-- Check that either a auc:FloorAreaValue or auc:FloorAreaPercentage is specifed, but not both
Expand Down
12 changes: 6 additions & 6 deletions schematron/lib/id.sch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://purl.oclc.org/dsdl/schematron">
<ns prefix="auc" uri="http://buildingsync.net/schemas/bedes-auc/2019"/>
<!-- Require every element of the following type to have and ID:
<!-- Require every element of the following type to have and ID:
Premises:
- Facility - T
- Site - T
Expand Down Expand Up @@ -47,7 +47,7 @@
- Tenant

-->
<!-- Premises -->
<!-- Premises -->
<!--
Facility has ID
<severity> error
Expand Down Expand Up @@ -92,7 +92,7 @@
</assert>
</rule>
</pattern>
<!-- Systems -->
<!-- Systems -->
<!--
HVACSystem has ID
<severity> error
Expand Down Expand Up @@ -357,7 +357,7 @@
</assert>
</rule>
</pattern>
<!-- Schedules & Measures -->
<!-- Schedules & Measures -->
<!--
Schedule has ID
<severity> error
Expand All @@ -380,7 +380,7 @@
</assert>
</rule>
</pattern>
<!-- Reports-->
<!-- Reports-->
<!--
Report has ID
<severity> error
Expand Down Expand Up @@ -437,7 +437,7 @@
</assert>
</rule>
</pattern>
<!-- Contacts -->
<!-- Contacts -->
<!--
Contact has ID
<severity> error
Expand Down
2 changes: 1 addition & 1 deletion schematron/lib/measureElements.sch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron">
<sch:ns prefix="auc" uri="http://buildingsync.net/schemas/bedes-auc/2019"/>
<!--
<!--
Define measure elements required for successful roundtrip of scenarios through ATT -->
<sch:pattern id="ms.seedATT.reqs">
<sch:rule context="/auc:BuildingSync/auc:Facilities/auc:Facility/auc:Measures/auc:Measure">
Expand Down
17 changes: 8 additions & 9 deletions schematron/lib/scenarioElements.sch
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,18 @@
-->
<pattern id="sc.benchmarkType.mainDetails.L000">
<rule context="auc:Scenario[auc:ScenarioType/auc:Benchmark]/auc:ScenarioType/auc:Benchmark">
<!-- <assert test="auc:BenchmarkType/*">-->
<assert test="count(auc:BenchmarkType/*) > 0" role="ERROR">
child element for 'auc:BenchmarkType' is REQUIRED AT LEAST ONCE for '<name/>
<!-- <assert test="auc:BenchmarkType/*">-->
<assert test="count(auc:BenchmarkType/*) &gt; 0" role="ERROR">
child element for 'auc:BenchmarkType' is REQUIRED AT LEAST ONCE for '<name/>&#8217;
</assert>
<assert test="auc:BenchmarkTool" role="ERROR">
element 'auc:BenchmarkTool' is REQUIRED EXACTLY ONCE for '<name/>
element 'auc:BenchmarkTool' is REQUIRED EXACTLY ONCE for '<name/>&#8217;
</assert>
<assert test="auc:BenchmarkYear" role="ERROR">
element 'auc:BenchmarkYear' is REQUIRED EXACTLY ONCE for '<name/>
element 'auc:BenchmarkYear' is REQUIRED EXACTLY ONCE for '<name/>&#8217;
</assert>
<assert test="../../auc:LinkedPremises/auc:Building/auc:LinkedBuildingID" role="ERROR">
elements 'auc:LinkedPremises/auc:Building/auc:LinkedBuildingID' is REQUIRED EXACTLY ONCE for '<name/>
elements 'auc:LinkedPremises/auc:Building/auc:LinkedBuildingID' is REQUIRED EXACTLY ONCE for '<name/>&#8217;
</assert>
</rule>
</pattern>
Expand Down Expand Up @@ -87,17 +87,16 @@
<assert test="count(auc:ResourceUses) = 1" role="ERROR">
'<name/>' ID = '<value-of select="@ID"/>' MUST HAVE EXACTLY ONE 'auc:ResourceUses' child element
</assert>
<assert test="count(auc:ResourceUses/auc:ResourceUse/auc:EnergyResource) >= 1" role="ERROR">
<assert test="count(auc:ResourceUses/auc:ResourceUse/auc:EnergyResource) &gt;= 1" role="ERROR">
'<name/>' ID = '<value-of select="@ID"/>' MUST HAVE AT LEAST ONE 'auc:ResourceUses/auc:ResourceUse/auc:EnergyResource'
</assert>
</rule>
</pattern>

<!--
Ensure that, within the context of a Measurement Scenario, each EnergyResource type has a EndUse='All end uses'
<severity> error
-->
<!-- <pattern id="sc.measured.energyResource.allEndUses">
<!-- <pattern id="sc.measured.energyResource.allEndUses">
<rule context="auc:Scenario[auc:ScenarioType/auc:CurrentBuilding/auc:CalculationMethod/auc:Measured]/auc:ResourceUses[auc:ResourceUse/auc:EnergyResource]">
<let name="energyResourceTypes" value="auc:ResourceUse/auc:EnergyResource/text()"/>
<let name="numEnergyResourceTypes" value="count(auc:ResourceUse/auc:EnergyResource/"
Expand Down
9 changes: 6 additions & 3 deletions schematron/lib/siteBuildingElements.sch
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,12 @@
<assert test="($allCityCount = 1 and $allStateCount = 1 and $allClimateZoneCount &lt;= 1) or ($allCityCount &lt;= 1 and $allStateCount &lt;= 1 and $allClimateZoneCount = 1)" role="WARNING">
elements 'auc:City' and 'auc:State' or element 'auc:ClimateZoneType//auc:ClimateZone' are RECOMMENDED EXACTLY ONCE at either the 'auc:Site' or 'auc:Building' level.
</assert>
<assert test="false()" role="INFO">Number of 'auc:City' elements defined at the 'auc:Site' = <value-of select="$siteCityCount"/>, 'auc:Building' = <value-of select="$allCityCount - $siteCityCount"/></assert>
<assert test="false()" role="INFO">Number of 'auc:State' elements defined at the 'auc:Site' = <value-of select="$siteStateCount"/>, 'auc:Building' = <value-of select="$allStateCount - $siteStateCount"/></assert>
<assert test="false()" role="INFO">Number of 'auc:ClimateZoneType//auc:ClimateZone' elements defined at the 'auc:Site' = <value-of select="$siteClimateZoneCount"/>, 'auc:Building' = <value-of select="$allClimateZoneCount - $siteClimateZoneCount"/></assert>
<assert test="false()" role="INFO">Number of 'auc:City' elements defined at the 'auc:Site' = <value-of select="$siteCityCount"/>, 'auc:Building' = <value-of select="$allCityCount - $siteCityCount"/>
</assert>
<assert test="false()" role="INFO">Number of 'auc:State' elements defined at the 'auc:Site' = <value-of select="$siteStateCount"/>, 'auc:Building' = <value-of select="$allStateCount - $siteStateCount"/>
</assert>
<assert test="false()" role="INFO">Number of 'auc:ClimateZoneType//auc:ClimateZone' elements defined at the 'auc:Site' = <value-of select="$siteClimateZoneCount"/>, 'auc:Building' = <value-of select="$allClimateZoneCount - $siteClimateZoneCount"/>
</assert>
</rule>
</pattern>
</schema>
2 changes: 1 addition & 1 deletion schematron/lib/tests/data/ex01.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0"?>
<?xml version="1.0" encoding="UTF-8"?>
<auc:BuildingSync xmlns:auc="http://buildingsync.net/schemas/bedes-auc/2019" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://buildingsync.net/schemas/bedes-auc/2019 https://raw.githubusercontent.com/BuildingSync/schema/1c73127d389b779c6b74029be72c6e9ff3187113/BuildingSync.xsd">
<auc:Facilities>
<auc:Facility>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<auc:BuildingSync xmlns:auc="http://buildingsync.net/schemas/bedes-auc/2019" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://buildingsync.net/schemas/bedes-auc/2019 https://raw.githubusercontent.com/BuildingSync/schema/v2.0/BuildingSync.xsd">
<auc:Facilities>
<auc:Facility ID="Facility-69916113180740">
Expand Down
3 changes: 2 additions & 1 deletion schematron/v2.0.0/examples/SEED_01.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<auc:BuildingSync xmlns:auc="http://buildingsync.net/schemas/bedes-auc/2019" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://buildingsync.net/schemas/bedes-auc/2019 https://raw.githubusercontent.com/BuildingSync/schema/v2.0/BuildingSync.xsd">
<?xml version="1.0" encoding="UTF-8"?>
<auc:BuildingSync xmlns:auc="http://buildingsync.net/schemas/bedes-auc/2019" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://buildingsync.net/schemas/bedes-auc/2019 https://raw.githubusercontent.com/BuildingSync/schema/v2.0/BuildingSync.xsd">
<auc:Facilities>
<auc:Facility>
<auc:Sites>
Expand Down
4 changes: 2 additions & 2 deletions schematron/v2.0.0/v2-0-0_BRICR_SEED.sch
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
<sch:assert test="count(./auc:ResourceUses/auc:ResourceUse[auc:EnergyResource=&quot;Natural gas&quot;]/auc:AnnualFuelUseConsistentUnits) = 1">[WARNING] element "/auc:BuildingSync/auc:Facilities/auc:Facility/auc:Reports/auc:Report/auc:Scenarios/auc:Scenario/auc:ResourceUses/auc:ResourceUse[auc:EnergyResource="Natural gas"]/auc:AnnualFuelUseConsistentUnits" is RECOMMENDED</sch:assert>
<sch:assert test="count(./auc:ScenarioType/auc:PackageOfMeasures/auc:CalculationMethod/auc:Modeled) = 1">[WARNING] element "/auc:BuildingSync/auc:Facilities/auc:Facility/auc:Reports/auc:Report/auc:Scenarios/auc:Scenario/auc:ScenarioType/auc:PackageOfMeasures/auc:CalculationMethod/auc:Modeled" is RECOMMENDED</sch:assert>
<sch:assert test="count(./auc:ScenarioType/auc:PackageOfMeasures/auc:MeasureIDs) = 1">[WARNING] element "/auc:BuildingSync/auc:Facilities/auc:Facility/auc:Reports/auc:Report/auc:Scenarios/auc:Scenario/auc:ScenarioType/auc:PackageOfMeasures/auc:MeasureIDs" is RECOMMENDED</sch:assert>
<sch:assert test="count(./auc:ResourceUses/auc:ResourceUse) > 0">[WARNING] element "/auc:BuildingSync/auc:Facilities/auc:Facility/auc:Reports/auc:Report/auc:Scenarios/auc:Scenario/auc:ResourceUses/auc:ResourceUse" is RECOMMENDED</sch:assert>
<sch:assert test="count(./auc:TimeSeriesData/auc:TimeSeries) > 0">[WARNING] element "/auc:BuildingSync/auc:Facilities/auc:Facility/auc:Reports/auc:Report/auc:Scenarios/auc:Scenario/auc:TimeSeriesData/auc:TimeSeries" is RECOMMENDED</sch:assert>
<sch:assert test="count(./auc:ResourceUses/auc:ResourceUse) &gt; 0">[WARNING] element "/auc:BuildingSync/auc:Facilities/auc:Facility/auc:Reports/auc:Report/auc:Scenarios/auc:Scenario/auc:ResourceUses/auc:ResourceUse" is RECOMMENDED</sch:assert>
<sch:assert test="count(./auc:TimeSeriesData/auc:TimeSeries) &gt; 0">[WARNING] element "/auc:BuildingSync/auc:Facilities/auc:Facility/auc:Reports/auc:Report/auc:Scenarios/auc:Scenario/auc:TimeSeriesData/auc:TimeSeries" is RECOMMENDED</sch:assert>
</sch:rule>
</sch:pattern>
</sch:schema>
Loading