Skip to content

Commit

Permalink
Merge pull request #1855 from NREL/more_ruby_doc
Browse files Browse the repository at this point in the history
Some more ruby documentation
  • Loading branch information
shorowit authored Oct 11, 2024
2 parents 5b28c43 + 0dbfaa0 commit 5e5b1fb
Show file tree
Hide file tree
Showing 7 changed files with 241 additions and 243 deletions.
20 changes: 7 additions & 13 deletions HPXMLtoOpenStudio/measure.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<schema_version>3.1</schema_version>
<name>hpxm_lto_openstudio</name>
<uid>b1543b30-9465-45ff-ba04-1d1f85e763bc</uid>
<version_id>c80e402f-4c82-4eae-9336-698bde0e09c3</version_id>
<version_modified>2024-10-11T18:59:49Z</version_modified>
<version_id>72c688f5-e64c-48f3-b1e4-062d4e53586c</version_id>
<version_modified>2024-10-11T22:49:23Z</version_modified>
<xml_checksum>D8922A73</xml_checksum>
<class_name>HPXMLtoOpenStudio</class_name>
<display_name>HPXML to OpenStudio Translator</display_name>
Expand Down Expand Up @@ -357,7 +357,7 @@
<filename>hpxml.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>AF9C179B</checksum>
<checksum>10F59ACC</checksum>
</file>
<file>
<filename>hpxml_schema/HPXML.xsd</filename>
Expand Down Expand Up @@ -387,7 +387,7 @@
<filename>hvac.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>CEDAF4B3</checksum>
<checksum>96EEE054</checksum>
</file>
<file>
<filename>hvac_sizing.rb</filename>
Expand All @@ -405,7 +405,7 @@
<filename>lighting.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>E8D2508C</checksum>
<checksum>9B17C563</checksum>
</file>
<file>
<filename>location.rb</filename>
Expand Down Expand Up @@ -441,7 +441,7 @@
<filename>misc_loads.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>ABD35A7F</checksum>
<checksum>2DCA8614</checksum>
</file>
<file>
<filename>model.rb</filename>
Expand Down Expand Up @@ -639,20 +639,14 @@
<filename>xmlhelper.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>D1BB113E</checksum>
<checksum>DA4456A1</checksum>
</file>
<file>
<filename>xmlvalidator.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>93120E27</checksum>
</file>
<file>
<filename>in.schedules.csv</filename>
<filetype>csv</filetype>
<usage_type>test</usage_type>
<checksum>C8EBFF38</checksum>
</file>
<file>
<filename>test_airflow.rb</filename>
<filetype>rb</filetype>
Expand Down
2 changes: 1 addition & 1 deletion HPXMLtoOpenStudio/resources/hpxml.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11184,7 +11184,7 @@ def from_doc(performance_data_point)
#
# @return [Oga::XML::Document] The HPXML document
def _create_hpxml_document
doc = XMLHelper.create_doc('1.0', 'UTF-8')
doc = XMLHelper.create_doc()
hpxml = XMLHelper.add_element(doc, 'HPXML')
XMLHelper.add_attribute(hpxml, 'xmlns', NameSpace)
XMLHelper.add_attribute(hpxml, 'schemaVersion', Version::HPXML_Version)
Expand Down
180 changes: 92 additions & 88 deletions HPXMLtoOpenStudio/resources/hvac.rb

Large diffs are not rendered by default.

32 changes: 16 additions & 16 deletions HPXMLtoOpenStudio/resources/lighting.rb
Original file line number Diff line number Diff line change
Expand Up @@ -205,14 +205,14 @@ def self.apply(runner, model, spaces, hpxml_bldg, hpxml_header, schedules_file)
end
end

# TODO
# Calculates the annual interior lighting energy use based on the conditioned floor area and types of lamps.
#
# @param eri_version [String] Version of the ANSI/RESNET/ICC 301 Standard to use for equations/assumptions
# @param cfa [Double] Conditioned floor area in the dwelling unit (ft2)
# @param f_int_cfl [TODO] TODO
# @param f_int_lfl [TODO] TODO
# @param f_int_led [TODO] TODO
# @return [TODO] TODO
# @param f_int_cfl [Double] Fraction of interior lighting that is compact fluorescent (CFL)
# @param f_int_lfl [Double] Fraction of interior lighting that is linear fluorescent (LFL)
# @param f_int_led [Double] Fraction of interior lighting that is light-emitting diode (LED)
# @return [Double or nil] Annual interior lighting energy use (kWh/yr)
def self.calc_interior_energy(eri_version, cfa, f_int_cfl, f_int_lfl, f_int_led)
return if f_int_cfl.nil? || f_int_lfl.nil? || f_int_led.nil?

Expand Down Expand Up @@ -249,14 +249,14 @@ def self.calc_interior_energy(eri_version, cfa, f_int_cfl, f_int_lfl, f_int_led)
return int_kwh
end

# TODO
# Calculates the annual exterior lighting energy use based on the conditioned floor area and types of lamps.
#
# @param eri_version [String] Version of the ANSI/RESNET/ICC 301 Standard to use for equations/assumptions
# @param cfa [Double] Conditioned floor area in the dwelling unit (ft2)
# @param f_ext_cfl [TODO] TODO
# @param f_ext_lfl [TODO] TODO
# @param f_ext_led [TODO] TODO
# @return [TODO] TODO
# @param f_ext_cfl [Double] Fraction of exterior lighting that is compact fluorescent (CFL)
# @param f_ext_lfl [Double] Fraction of exterior lighting that is linear fluorescent (LFL)
# @param f_ext_led [Double] Fraction of exterior lighting that is light-emitting diode (LED)
# @return [Double or nil] Annual exterior lighting energy use (kWh/yr)
def self.calc_exterior_energy(eri_version, cfa, f_ext_cfl, f_ext_lfl, f_ext_led)
return if f_ext_cfl.nil? || f_ext_lfl.nil? || f_ext_led.nil?

Expand Down Expand Up @@ -293,14 +293,14 @@ def self.calc_exterior_energy(eri_version, cfa, f_ext_cfl, f_ext_lfl, f_ext_led)
return ext_kwh
end

# TODO
# Calculates the annual garage lighting energy use based on the garage area and types of lamps.
#
# @param eri_version [String] Version of the ANSI/RESNET/ICC 301 Standard to use for equations/assumptions
# @param gfa [TODO] TODO
# @param f_grg_cfl [TODO] TODO
# @param f_grg_lfl [TODO] TODO
# @param f_grg_led [TODO] TODO
# @return [TODO] TODO
# @param gfa [Double] Garage floor area (ft2)
# @param f_grg_cfl [Double] Fraction of garage lighting that is compact fluorescent (CFL)
# @param f_grg_lfl [Double] Fraction of garage lighting that is linear fluorescent (LFL)
# @param f_grg_led [Double] Fraction of garage lighting that is light-emitting diode (LED)
# @return [Double or nil] Annual garage lighting energy use (kWh/yr)
def self.calc_garage_energy(eri_version, gfa, f_grg_cfl, f_grg_lfl, f_grg_led)
return if f_grg_cfl.nil? || f_grg_lfl.nil? || f_grg_led.nil?

Expand Down
10 changes: 5 additions & 5 deletions HPXMLtoOpenStudio/resources/misc_loads.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ def self.apply_plug_loads(runner, model, spaces, hpxml_bldg, hpxml_header, sched
#
# @param runner [OpenStudio::Measure::OSRunner] Object typically used to display warnings
# @param model [OpenStudio::Model::Model] OpenStudio Model object
# @param plug_load [TODO] TODO
# @param plug_load [HPXML::PlugLoad] The HPXML plug load of interest
# @param obj_name [String] Name for the OpenStudio object
# @param spaces [Hash] Map of HPXML locations => OpenStudio Space objects
# @param schedules_file [SchedulesFile] SchedulesFile wrapper class instance of detailed schedule files
# @param unavailable_periods [HPXML::UnavailablePeriods] Object that defines periods for, e.g., power outages or vacancies
# @param apply_ashrae140_assumptions [TODO] TODO
# @param apply_ashrae140_assumptions [Boolean] True if an ASHRAE 140 test case where we want to override our normal assumptions
# @return [nil]
def self.apply_plug_load(runner, model, plug_load, obj_name, spaces, schedules_file, unavailable_periods, apply_ashrae140_assumptions)
kwh = 0
Expand Down Expand Up @@ -132,7 +132,7 @@ def self.apply_fuel_loads(runner, model, spaces, hpxml_bldg, hpxml_header, sched
#
# @param runner [OpenStudio::Measure::OSRunner] Object typically used to display warnings
# @param model [OpenStudio::Model::Model] OpenStudio Model object
# @param fuel_load [TODO] TODO
# @param fuel_load [HPXML::FuelLoad] The HPXML fuel load of interest
# @param obj_name [String] Name for the OpenStudio object
# @param spaces [Hash] Map of HPXML locations => OpenStudio Space objects
# @param schedules_file [SchedulesFile] SchedulesFile wrapper class instance of detailed schedule files
Expand Down Expand Up @@ -213,7 +213,7 @@ def self.apply_pools_and_permanent_spas(runner, model, spaces, hpxml_bldg, hpxml
#
# @param runner [OpenStudio::Measure::OSRunner] Object typically used to display warnings
# @param model [OpenStudio::Model::Model] OpenStudio Model object
# @param pool_or_spa [TODO] TODO
# @param pool_or_spa [HPXML::Pool or HPXML::PermanentSpa] The HPXML pool or permanent space of interest
# @param spaces [Hash] Map of HPXML locations => OpenStudio Space objects
# @param schedules_file [SchedulesFile] SchedulesFile wrapper class instance of detailed schedule files
# @param unavailable_periods [HPXML::UnavailablePeriods] Object that defines periods for, e.g., power outages or vacancies
Expand Down Expand Up @@ -303,7 +303,7 @@ def self.apply_pool_or_permanent_spa_heater(runner, model, pool_or_spa, spaces,
#
# @param runner [OpenStudio::Measure::OSRunner] Object typically used to display warnings
# @param model [OpenStudio::Model::Model] OpenStudio Model object
# @param pool_or_spa [TODO] TODO
# @param pool_or_spa [HPXML::Pool or HPXML::PermanentSpa] The HPXML pool or permanent space of interest
# @param spaces [Hash] Map of HPXML locations => OpenStudio Space objects
# @param schedules_file [SchedulesFile] SchedulesFile wrapper class instance of detailed schedule files
# @param unavailable_periods [HPXML::UnavailablePeriods] Object that defines periods for, e.g., power outages or vacancies
Expand Down
Loading

0 comments on commit 5e5b1fb

Please sign in to comment.