Skip to content

Commit 7c19270

Browse files
authored
Merge pull request #1756 from NREL/ncflag_eq_zero
Adds error-checking for `NumberofConditionedFloorsAboveGrade`=0
2 parents bb711e1 + 63e7558 commit 7c19270

4 files changed

Lines changed: 12 additions & 5 deletions

File tree

Changelog.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ __New Features__
99
- Maximum power ratio detailed schedule for variable-speed HVAC systems can now be used with `NumberofUnits` dwelling unit multiplier.
1010

1111
__Bugfixes__
12-
- Allows additional flexibility for multiple `Attic`/`Foundation` elements.
12+
- Prevents possible error when using multiple `Attic`/`Foundation` elements for the same attic/foundation type.
13+
- Adds error-checking for `NumberofConditionedFloorsAboveGrade`=0, which is not allowed per the documentation.
1314

1415
## OpenStudio-HPXML v1.8.1
1516

HPXMLtoOpenStudio/measure.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
<schema_version>3.1</schema_version>
44
<name>hpxm_lto_openstudio</name>
55
<uid>b1543b30-9465-45ff-ba04-1d1f85e763bc</uid>
6-
<version_id>36c17bcd-7457-4c11-a65a-478054e6e71c</version_id>
7-
<version_modified>2024-06-18T17:41:35Z</version_modified>
6+
<version_id>b4c90aa7-1a75-4509-8d35-2da7a9483652</version_id>
7+
<version_modified>2024-06-20T18:53:36Z</version_modified>
88
<xml_checksum>D8922A73</xml_checksum>
99
<class_name>HPXMLtoOpenStudio</class_name>
1010
<display_name>HPXML to OpenStudio Translator</display_name>
@@ -369,7 +369,7 @@
369369
<filename>hpxml_schematron/EPvalidator.xml</filename>
370370
<filetype>xml</filetype>
371371
<usage_type>resource</usage_type>
372-
<checksum>E9004049</checksum>
372+
<checksum>AE34574D</checksum>
373373
</file>
374374
<file>
375375
<filename>hpxml_schematron/iso-schematron.xsd</filename>
@@ -711,7 +711,7 @@
711711
<filename>test_validation.rb</filename>
712712
<filetype>rb</filetype>
713713
<usage_type>test</usage_type>
714-
<checksum>32DEB854</checksum>
714+
<checksum>EE974D71</checksum>
715715
</file>
716716
<file>
717717
<filename>test_water_heater.rb</filename>

HPXMLtoOpenStudio/resources/hpxml_schematron/EPvalidator.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,8 @@
417417
<sch:assert role='ERROR' test='count(h:NumberofUnits) &lt;= 1'>Expected 0 or 1 element(s) for xpath: NumberofUnits</sch:assert>
418418
<sch:assert role='ERROR' test='count(h:NumberofConditionedFloors) = 1'>Expected 1 element(s) for xpath: NumberofConditionedFloors</sch:assert>
419419
<sch:assert role='ERROR' test='count(h:NumberofConditionedFloorsAboveGrade) = 1'>Expected 1 element(s) for xpath: NumberofConditionedFloorsAboveGrade</sch:assert>
420+
<!-- We are more strict than HPXML schema for NumberofConditionedFloorsAboveGrade; see https://github.com/NREL/OpenStudio-HPXML/issues/1755 -->
421+
<sch:assert role='ERROR' test='number(h:NumberofConditionedFloorsAboveGrade) &gt; 0 or not(h:NumberofConditionedFloorsAboveGrade)'>Expected NumberofConditionedFloorsAboveGrade to be greater than 0</sch:assert>
420422
<sch:assert role='ERROR' test='number(h:NumberofConditionedFloors) &gt;= number(h:NumberofConditionedFloorsAboveGrade) or not(h:NumberofConditionedFloors) or not(h:NumberofConditionedFloorsAboveGrade)'>Expected NumberofConditionedFloors to be greater than or equal to NumberofConditionedFloorsAboveGrade</sch:assert>
421423
<sch:assert role='ERROR' test='count(h:AverageCeilingHeight) &lt;= 1'>Expected 0 or 1 element(s) for xpath: AverageCeilingHeight</sch:assert>
422424
<sch:assert role='ERROR' test='count(h:NumberofBedrooms) = 1'>Expected 1 element(s) for xpath: NumberofBedrooms</sch:assert>

HPXMLtoOpenStudio/tests/test_validation.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ def test_schema_schematron_error_messages
195195
'invalid-number-of-bedrooms-served-recirc' => ['Expected NumberofBedroomsServed to be greater than ../../../../../BuildingSummary/BuildingConstruction/NumberofBedrooms [context: /HPXML/Building/BuildingDetails/Systems/WaterHeating/HotWaterDistribution/extension/SharedRecirculation, id: "HotWaterDistribution1"]'],
196196
'invalid-number-of-bedrooms-served-water-heater' => ['Expected extension/NumberofBedroomsServed to be greater than ../../../BuildingSummary/BuildingConstruction/NumberofBedrooms [context: /HPXML/Building/BuildingDetails/Systems/WaterHeating/WaterHeatingSystem[IsSharedSystem="true"], id: "WaterHeatingSystem1"]'],
197197
'invalid-number-of-conditioned-floors' => ['Expected NumberofConditionedFloors to be greater than or equal to NumberofConditionedFloorsAboveGrade [context: /HPXML/Building/BuildingDetails/BuildingSummary/BuildingConstruction, id: "MyBuilding"]'],
198+
'invalid-number-of-conditioned-floors-above-grade' => ['Expected NumberofConditionedFloorsAboveGrade to be greater than 0 [context: /HPXML/Building/BuildingDetails/BuildingSummary/BuildingConstruction, id: "MyBuilding"]'],
198199
'invalid-pilot-light-heating-system' => ['Expected 1 element(s) for xpath: ../../HeatingSystemFuel[text()!="electricity"]'],
199200
'invalid-soil-type' => ["Expected SoilType to be 'sand' or 'silt' or 'clay' or 'loam' or 'gravel' or 'unknown' [context: /HPXML/Building/BuildingDetails/BuildingSummary/Site/Soil, id: \"MyBuilding\"]"],
200201
'invalid-shared-vent-in-unit-flowrate' => ['Expected RatedFlowRate to be greater than extension/InUnitFlowRate [context: /HPXML/Building/BuildingDetails/Systems/MechanicalVentilation/VentilationFans/VentilationFan[UsedForWholeBuildingVentilation="true" and IsSharedSystem="true"], id: "VentilationFan1"]'],
@@ -586,6 +587,9 @@ def test_schema_schematron_error_messages
586587
elsif ['invalid-number-of-conditioned-floors'].include? error_case
587588
hpxml, hpxml_bldg = _create_hpxml('base.xml')
588589
hpxml_bldg.building_construction.number_of_conditioned_floors_above_grade = 3
590+
elsif ['invalid-number-of-conditioned-floors-above-grade'].include? error_case
591+
hpxml, hpxml_bldg = _create_hpxml('base.xml')
592+
hpxml_bldg.building_construction.number_of_conditioned_floors_above_grade = 0
589593
elsif ['invalid-pilot-light-heating-system'].include? error_case
590594
hpxml, hpxml_bldg = _create_hpxml('base-hvac-floor-furnace-propane-only.xml')
591595
hpxml_bldg.heating_systems[0].heating_system_fuel = HPXML::FuelTypeElectricity

0 commit comments

Comments
 (0)