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

More ruby documentation #1771

Merged
merged 22 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
3f95b56
More description for unavailable_periods parameter.
joseph-robertson Jul 10, 2024
1bf7815
Merge branch 'master' into ruby-docs
joseph-robertson Jul 11, 2024
e9c6b26
Temp add.
joseph-robertson Jul 11, 2024
de2d5cd
Start updates to translator util resource.
joseph-robertson Jul 11, 2024
64ff0e7
More helpful description for runner [ci skip]
shorowit Jul 12, 2024
d7651ea
Add code documentation for weather.rb
shorowit Jul 12, 2024
ed18d0f
A little more cleanup.
shorowit Jul 12, 2024
2fad7a0
Finish up docs in util.
joseph-robertson Jul 12, 2024
e5bc942
Relocate utility_bills to utility bill measure.
joseph-robertson Jul 12, 2024
103d7ee
Finish up docs in utility_bills.
joseph-robertson Jul 12, 2024
7eaa929
Require correct path in bills test file.
joseph-robertson Jul 12, 2024
8041d11
Move the utility_bills resource back over.
joseph-robertson Jul 15, 2024
234f638
Start filling out some stochastic schedule docs.
joseph-robertson Jul 15, 2024
3727888
Merge branch 'master' into ruby-docs
joseph-robertson Jul 15, 2024
ac1a10b
Add test for when marginal rate provided.
joseph-robertson Jul 15, 2024
e6a9b70
Move MathTools class into a separate resource file.
shorowit Jul 16, 2024
8793e8f
Progress on hpxml.rb
shorowit Jul 16, 2024
372f5dc
More progress on hpxml.rb
shorowit Jul 17, 2024
5d468e7
More progress on hpxml.rb. Down to ~100 TODOs left.
shorowit Jul 17, 2024
0205006
Final changes for hpxml.rb.
shorowit Jul 17, 2024
52116bb
Latest results.
Jul 17, 2024
d7865a1
Simplify hvac_sizing.rb; no longer need to do azimuth-specific wall c…
shorowit Jul 17, 2024
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
10 changes: 5 additions & 5 deletions BuildResidentialHPXML/measure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3471,7 +3471,7 @@ def arguments(model) # rubocop:disable Lint/UnusedMethodArgument
# Define what happens when the measure is run.
#
# @param model [OpenStudio::Model::Model] OpenStudio Model object
# @param runner [OpenStudio::Measure::OSRunner] OpenStudio Runner object
# @param runner [OpenStudio::Measure::OSRunner] Object typically used to display warnings
# @param user_arguments [OpenStudio::Measure::OSArgumentMap] OpenStudio measure arguments
# @return [Boolean] true if successful
def run(model, runner, user_arguments)
Expand Down Expand Up @@ -3794,7 +3794,7 @@ def argument_errors(args)
module HPXMLFile
# Create the closed-form geometry, and then call individual set_xxx methods
#
# @param runner [OpenStudio::Measure::OSRunner] OpenStudio Runner object
# @param runner [OpenStudio::Measure::OSRunner] Object typically used to display warnings
# @param model [OpenStudio::Model::Model] OpenStudio Model object
# @param args [Hash] Map of :argument_name => value
# @param epw_path [String] Path to the EPW weather file
Expand Down Expand Up @@ -3923,7 +3923,7 @@ def self.need_weather_based_on_args(args)

# Check for errors in hpxml, and validate hpxml_doc against hpxml_path
#
# @param runner [OpenStudio::Measure::OSRunner] OpenStudio Runner object
# @param runner [OpenStudio::Measure::OSRunner] Object typically used to display warnings
# @param hpxml [HPXML] HPXML object
# @param hpxml_doc [Oga::XML::Element] Root XML element of the HPXML document
# @param hpxml_path [TODO] TODO
Expand Down Expand Up @@ -3964,7 +3964,7 @@ def self.validate_hpxml(runner, hpxml, hpxml_doc, hpxml_path)

# Create 3D geometry (surface, subsurfaces) for a given unit type
#
# @param runner [OpenStudio::Measure::OSRunner] OpenStudio Runner object
# @param runner [OpenStudio::Measure::OSRunner] Object typically used to display warnings
# @param model [OpenStudio::Model::Model] OpenStudio Model object
# @param args [Hash] Map of :argument_name => value
# @return [Boolean] True if successful
Expand Down Expand Up @@ -4058,7 +4058,7 @@ def self.unavailable_period_exists(hpxml, column_name, begin_month, begin_day, b
# - emissions scenarios
# - utility bill scenarios
#
# @param runner [OpenStudio::Measure::OSRunner] OpenStudio Runner object
# @param runner [OpenStudio::Measure::OSRunner] Object typically used to display warnings
# @param hpxml [HPXML] HPXML object
# @param args [Hash] Map of :argument_name => value
# @return [Boolean] true if no errors, otherwise false
Expand Down
8 changes: 4 additions & 4 deletions BuildResidentialHPXML/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>build_residential_hpxml</name>
<uid>a13a8983-2b01-4930-8af2-42030b6e4233</uid>
<version_id>635a8ab6-45f1-4969-b2c5-f308519438f8</version_id>
<version_modified>2024-07-11T16:09:59Z</version_modified>
<version_id>a3873251-35cd-48ce-a06c-a433c10a3c13</version_id>
<version_modified>2024-07-12T14:33:25Z</version_modified>
<xml_checksum>2C38F48B</xml_checksum>
<class_name>BuildResidentialHPXML</class_name>
<display_name>HPXML Builder</display_name>
Expand Down Expand Up @@ -7406,13 +7406,13 @@
<filename>measure.rb</filename>
<filetype>rb</filetype>
<usage_type>script</usage_type>
<checksum>F41033B3</checksum>
<checksum>55158D8A</checksum>
</file>
<file>
<filename>geometry.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>8E4E4C7F</checksum>
<checksum>3BCF34D6</checksum>
</file>
<file>
<filename>test_build_residential_hpxml.rb</filename>
Expand Down
8 changes: 4 additions & 4 deletions BuildResidentialHPXML/resources/geometry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
module Geometry
# Create a 3D representation of a single-family detached home using the following arguments.
#
# @param runner [OpenStudio::Measure::OSRunner] OpenStudio Runner object
# @param runner [OpenStudio::Measure::OSRunner] Object typically used to display warnings
# @param model [OpenStudio::Model::Model] OpenStudio Model object
# @param geometry_unit_cfa [Double] conditioned floor area (ft2)
# @param geometry_average_ceiling_height [Double] average ceiling height (ft)
Expand Down Expand Up @@ -1237,7 +1237,7 @@ def self.create_apartment(model:,

# Place a door subsurface on an exterior wall surface (with enough area) prioritized by front, then back, then left, then right, and lowest story.
#
# @param runner [OpenStudio::Measure::OSRunner] OpenStudio Runner object
# @param runner [OpenStudio::Measure::OSRunner] Object typically used to display warnings
# @param model [OpenStudio::Model::Model] OpenStudio Model object
# @param door_area [Double] the area of the opaque door(s) (ft2)
# @return [Boolean] true if successful
Expand Down Expand Up @@ -1373,7 +1373,7 @@ def self.create_doors(runner:,

# Place window subsurfaces on exterior wall surfaces (or skylight subsurfaces on roof surfaces) using target facade areas based on either window to wall area ratios or window areas.
#
# @param runner [OpenStudio::Measure::OSRunner] OpenStudio Runner object
# @param runner [OpenStudio::Measure::OSRunner] Object typically used to display warnings
# @param model [OpenStudio::Model::Model] OpenStudio Model object
# @param window_front_wwr [Double] ratio of window to wall area for the unit's front facade (frac)
# @param window_back_wwr [Double] ratio of window to wall area for the unit's back facade (frac)
Expand Down Expand Up @@ -2279,7 +2279,7 @@ def self.get_wall_area_for_windows(surface:,
# @param max_single_window_area [Double] maximum area for a single window (ft2)
# @param facade [String] front, back, left, or right
# @param model [OpenStudio::Model::Model] OpenStudio Model object
# @param runner [OpenStudio::Measure::OSRunner] OpenStudio Runner object
# @param runner [OpenStudio::Measure::OSRunner] Object typically used to display warnings
# @return [Boolean] true if successful
def self.add_windows_to_wall(surface:,
window_area:,
Expand Down
6 changes: 3 additions & 3 deletions BuildResidentialScheduleFile/measure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def arguments(model) # rubocop:disable Lint/UnusedMethodArgument
# Define what happens when the measure is run.
#
# @param model [OpenStudio::Model::Model] OpenStudio Model object
# @param runner [OpenStudio::Measure::OSRunner] OpenStudio Runner object
# @param runner [OpenStudio::Measure::OSRunner] Object typically used to display warnings
# @param user_arguments [OpenStudio::Measure::OSArgumentMap] OpenStudio measure arguments
# @return [Boolean] true if successful
def run(model, runner, user_arguments)
Expand Down Expand Up @@ -176,7 +176,7 @@ def run(model, runner, user_arguments)

# Write out the HPXML file with the output CSV path containing occupancy schedules.
#
# @param runner [OpenStudio::Measure::OSRunner] OpenStudio Runner object
# @param runner [OpenStudio::Measure::OSRunner] Object typically used to display warnings
# @param doc [Oga::XML::Document] Oga XML Document object
# @param hpxml_path [String] path of the input HPXML file
# @param hpxml_output_path [String] path of the output HPXML file
Expand All @@ -192,7 +192,7 @@ def write_modified_hpxml(runner, doc, hpxml_path, hpxml_output_path, schedules_f

# Create and export the occupancy schedules.
#
# @param runner [OpenStudio::Measure::OSRunner] OpenStudio Runner object
# @param runner [OpenStudio::Measure::OSRunner] Object typically used to display warnings
# @param hpxml [HPXML] HPXML object
# @param hpxml_bldg [HPXML::Building] HPXML Building object representing an individual dwelling unit
# @param weather [WeatherFile] Weather object containing EPW information
Expand Down
8 changes: 4 additions & 4 deletions BuildResidentialScheduleFile/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>build_residential_schedule_file</name>
<uid>f770b2db-1a9f-4e99-99a7-7f3161a594b1</uid>
<version_id>b471ba87-0ebb-4a48-a305-9a4f6a16e1c5</version_id>
<version_modified>2024-07-11T02:46:37Z</version_modified>
<version_id>19d556f5-8f18-4009-9180-94352a5ddc30</version_id>
<version_modified>2024-07-12T14:33:27Z</version_modified>
<xml_checksum>03F02484</xml_checksum>
<class_name>BuildResidentialScheduleFile</class_name>
<display_name>Schedule File Builder</display_name>
Expand Down Expand Up @@ -133,7 +133,7 @@
<filename>measure.rb</filename>
<filetype>rb</filetype>
<usage_type>script</usage_type>
<checksum>3ECB9FB5</checksum>
<checksum>D2B0EB5F</checksum>
</file>
<file>
<filename>README.md</filename>
Expand Down Expand Up @@ -223,7 +223,7 @@
<filename>schedules.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>BBF55F85</checksum>
<checksum>D8145A81</checksum>
</file>
<file>
<filename>schedules_config.md</filename>
Expand Down
2 changes: 1 addition & 1 deletion BuildResidentialScheduleFile/resources/schedules.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

# TODO
class ScheduleGenerator
# @param runner [OpenStudio::Measure::OSRunner] OpenStudio Runner object
# @param runner [OpenStudio::Measure::OSRunner] Object typically used to display warnings
# @param state [TODO] TODO
# @param column_names [TODO] TODO
# @param random_seed [TODO] TODO
Expand Down
47 changes: 24 additions & 23 deletions HPXMLtoOpenStudio/measure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

require resource_file
end
require_relative '../ReportUtilityBills/resources/utility_bills.rb'
shorowit marked this conversation as resolved.
Show resolved Hide resolved

# start the measure
class HPXMLtoOpenStudio < OpenStudio::Measure::ModelMeasure
Expand Down Expand Up @@ -97,7 +98,7 @@ def arguments(model) # rubocop:disable Lint/UnusedMethodArgument
# Define what happens when the measure is run.
#
# @param model [OpenStudio::Model::Model] OpenStudio Model object
# @param runner [OpenStudio::Measure::OSRunner] OpenStudio Runner object
# @param runner [OpenStudio::Measure::OSRunner] Object typically used to display warnings
# @param user_arguments [OpenStudio::Measure::OSArgumentMap] OpenStudio measure arguments
# @return [Boolean] true if successful
def run(model, runner, user_arguments)
Expand Down Expand Up @@ -468,7 +469,7 @@ def make_variable_name(obj_name, unit_number)
#
# @param hpxml [HPXML] HPXML object
# @param hpxml_bldg [HPXML::Building] HPXML Building object representing an individual dwelling unit
# @param runner [OpenStudio::Measure::OSRunner] OpenStudio Runner object
# @param runner [OpenStudio::Measure::OSRunner] Object typically used to display warnings
# @param model [OpenStudio::Model::Model] OpenStudio Model object
# @param epw_path [String] Path to the EPW weather file
# @param weather [WeatherFile] Weather object containing EPW information
Expand Down Expand Up @@ -659,7 +660,7 @@ def add_simulation_params(model)
# TODO
#
# @param model [OpenStudio::Model::Model] OpenStudio Model object
# @param runner [OpenStudio::Measure::OSRunner] OpenStudio Runner object
# @param runner [OpenStudio::Measure::OSRunner] Object typically used to display warnings
# @param spaces [Hash] Map of HPXML locations => OpenStudio Space objects
# @return [TODO] TODO
def add_num_occupants(model, runner, spaces)
Expand All @@ -686,7 +687,7 @@ def create_or_get_space(model, spaces, location)

# Adds any HPXML Roofs to the OpenStudio model.
#
# @param runner [OpenStudio::Measure::OSRunner] OpenStudio Runner object
# @param runner [OpenStudio::Measure::OSRunner] Object typically used to display warnings
# @param model [OpenStudio::Model::Model] OpenStudio Model object
# @param spaces [Hash] Map of HPXML locations => OpenStudio Space objects
# @return [void]
Expand Down Expand Up @@ -804,7 +805,7 @@ def add_roofs(runner, model, spaces)

# Adds any HPXML Walls to the OpenStudio model.
#
# @param runner [OpenStudio::Measure::OSRunner] OpenStudio Runner object
# @param runner [OpenStudio::Measure::OSRunner] Object typically used to display warnings
# @param model [OpenStudio::Model::Model] OpenStudio Model object
# @param spaces [Hash] Map of HPXML locations => OpenStudio Space objects
# @return [void]
Expand Down Expand Up @@ -882,7 +883,7 @@ def add_walls(runner, model, spaces)

# Adds any HPXML RimJoists to the OpenStudio model.
#
# @param runner [OpenStudio::Measure::OSRunner] OpenStudio Runner object
# @param runner [OpenStudio::Measure::OSRunner] Object typically used to display warnings
# @param model [OpenStudio::Model::Model] OpenStudio Model object
# @param spaces [Hash] Map of HPXML locations => OpenStudio Space objects
# @return [void]
Expand Down Expand Up @@ -960,7 +961,7 @@ def add_rim_joists(runner, model, spaces)

# Adds any HPXML Floors to the OpenStudio model.
#
# @param runner [OpenStudio::Measure::OSRunner] OpenStudio Runner object
# @param runner [OpenStudio::Measure::OSRunner] Object typically used to display warnings
# @param model [OpenStudio::Model::Model] OpenStudio Model object
# @param spaces [Hash] Map of HPXML locations => OpenStudio Space objects
# @return [void]
Expand Down Expand Up @@ -1046,7 +1047,7 @@ def add_floors(runner, model, spaces)

# TODO
#
# @param runner [OpenStudio::Measure::OSRunner] OpenStudio Runner object
# @param runner [OpenStudio::Measure::OSRunner] Object typically used to display warnings
# @param model [OpenStudio::Model::Model] OpenStudio Model object
# @param weather [WeatherFile] Weather object containing EPW information
# @param spaces [Hash] Map of HPXML locations => OpenStudio Space objects
Expand Down Expand Up @@ -1170,7 +1171,7 @@ def add_foundation_walls_slabs(runner, model, weather, spaces)

# TODO
#
# @param runner [OpenStudio::Measure::OSRunner] OpenStudio Runner object
# @param runner [OpenStudio::Measure::OSRunner] Object typically used to display warnings
# @param model [OpenStudio::Model::Model] OpenStudio Model object
# @param spaces [Hash] Map of HPXML locations => OpenStudio Space objects
# @param foundation_wall [TODO] TODO
Expand Down Expand Up @@ -1727,7 +1728,7 @@ def apply_adiabatic_construction(model, surfaces, type)

# TODO
#
# @param runner [OpenStudio::Measure::OSRunner] OpenStudio Runner object
# @param runner [OpenStudio::Measure::OSRunner] Object typically used to display warnings
# @param model [OpenStudio::Model::Model] OpenStudio Model object
# @param weather [WeatherFile] Weather object containing EPW information
# @param spaces [Hash] Map of HPXML locations => OpenStudio Space objects
Expand Down Expand Up @@ -1811,7 +1812,7 @@ def add_hot_water_and_appliances(runner, model, weather, spaces)

# TODO
#
# @param runner [OpenStudio::Measure::OSRunner] OpenStudio Runner object
# @param runner [OpenStudio::Measure::OSRunner] Object typically used to display warnings
# @param model [OpenStudio::Model::Model] OpenStudio Model object
# @param weather [WeatherFile] Weather object containing EPW information
# @param spaces [Hash] Map of HPXML locations => OpenStudio Space objects
Expand Down Expand Up @@ -1866,7 +1867,7 @@ def add_cooling_system(model, runner, weather, spaces, airloop_map)

# TODO
#
# @param runner [OpenStudio::Measure::OSRunner] OpenStudio Runner object
# @param runner [OpenStudio::Measure::OSRunner] Object typically used to display warnings
# @param model [OpenStudio::Model::Model] OpenStudio Model object
# @param weather [WeatherFile] Weather object containing EPW information
# @param spaces [Hash] Map of HPXML locations => OpenStudio Space objects
Expand Down Expand Up @@ -1939,7 +1940,7 @@ def add_heating_system(runner, model, weather, spaces, airloop_map)

# TODO
#
# @param runner [OpenStudio::Measure::OSRunner] OpenStudio Runner object
# @param runner [OpenStudio::Measure::OSRunner] Object typically used to display warnings
# @param model [OpenStudio::Model::Model] OpenStudio Model object
# @param weather [WeatherFile] Weather object containing EPW information
# @param spaces [Hash] Map of HPXML locations => OpenStudio Space objects
Expand Down Expand Up @@ -2048,7 +2049,7 @@ def add_ideal_system(model, spaces, epw_path)

# TODO
#
# @param runner [OpenStudio::Measure::OSRunner] OpenStudio Runner object
# @param runner [OpenStudio::Measure::OSRunner] Object typically used to display warnings
# @param model [OpenStudio::Model::Model] OpenStudio Model object
# @param weather [WeatherFile] Weather object containing EPW information
# @param spaces [Hash] Map of HPXML locations => OpenStudio Space objects
Expand All @@ -2065,7 +2066,7 @@ def add_setpoints(runner, model, weather, spaces)

# TODO
#
# @param runner [OpenStudio::Measure::OSRunner] OpenStudio Runner object
# @param runner [OpenStudio::Measure::OSRunner] Object typically used to display warnings
# @param model [OpenStudio::Model::Model] OpenStudio Model object
# @param weather [WeatherFile] Weather object containing EPW information
# @param spaces [Hash] Map of HPXML locations => OpenStudio Space objects
Expand All @@ -2080,7 +2081,7 @@ def add_ceiling_fans(runner, model, weather, spaces)

# TODO
#
# @param runner [OpenStudio::Measure::OSRunner] OpenStudio Runner object
# @param runner [OpenStudio::Measure::OSRunner] Object typically used to display warnings
# @param model [OpenStudio::Model::Model] OpenStudio Model object
# @param spaces [Hash] Map of HPXML locations => OpenStudio Space objects
# @return [TODO] TODO
Expand Down Expand Up @@ -2116,7 +2117,7 @@ def check_distribution_system(hvac_distribution, system_type)

# TODO
#
# @param runner [OpenStudio::Measure::OSRunner] OpenStudio Runner object
# @param runner [OpenStudio::Measure::OSRunner] Object typically used to display warnings
# @param model [OpenStudio::Model::Model] OpenStudio Model object
# @param spaces [Hash] Map of HPXML locations => OpenStudio Space objects
# @return [TODO] TODO
Expand Down Expand Up @@ -2144,7 +2145,7 @@ def add_mels(runner, model, spaces)

# TODO
#
# @param runner [OpenStudio::Measure::OSRunner] OpenStudio Runner object
# @param runner [OpenStudio::Measure::OSRunner] Object typically used to display warnings
# @param model [OpenStudio::Model::Model] OpenStudio Model object
# @param spaces [Hash] Map of HPXML locations => OpenStudio Space objects
# @return [TODO] TODO
Expand All @@ -2170,7 +2171,7 @@ def add_mfls(runner, model, spaces)

# TODO
#
# @param runner [OpenStudio::Measure::OSRunner] OpenStudio Runner object
# @param runner [OpenStudio::Measure::OSRunner] Object typically used to display warnings
# @param model [OpenStudio::Model::Model] OpenStudio Model object
# @param spaces [Hash] Map of HPXML locations => OpenStudio Space objects
# @return [TODO] TODO
Expand All @@ -2181,7 +2182,7 @@ def add_lighting(runner, model, spaces)

# TODO
#
# @param runner [OpenStudio::Measure::OSRunner] OpenStudio Runner object
# @param runner [OpenStudio::Measure::OSRunner] Object typically used to display warnings
# @param model [OpenStudio::Model::Model] OpenStudio Model object
# @param spaces [Hash] Map of HPXML locations => OpenStudio Space objects
# @return [TODO] TODO
Expand All @@ -2200,7 +2201,7 @@ def add_pools_and_permanent_spas(runner, model, spaces)

# TODO
#
# @param runner [OpenStudio::Measure::OSRunner] OpenStudio Runner object
# @param runner [OpenStudio::Measure::OSRunner] Object typically used to display warnings
# @param model [OpenStudio::Model::Model] OpenStudio Model object
# @param weather [WeatherFile] Weather object containing EPW information
# @param spaces [Hash] Map of HPXML locations => OpenStudio Space objects
Expand Down Expand Up @@ -2392,7 +2393,7 @@ def add_generators(model)

# TODO
#
# @param runner [OpenStudio::Measure::OSRunner] OpenStudio Runner object
# @param runner [OpenStudio::Measure::OSRunner] Object typically used to display warnings
# @param model [OpenStudio::Model::Model] OpenStudio Model object
# @param spaces [Hash] Map of HPXML locations => OpenStudio Space objects
# @return [TODO] TODO
Expand Down Expand Up @@ -3450,7 +3451,7 @@ def set_foundation_and_walls_top()

# TODO
#
# @param runner [OpenStudio::Measure::OSRunner] OpenStudio Runner object
# @param runner [OpenStudio::Measure::OSRunner] Object typically used to display warnings
# @return [void]
def set_heating_and_cooling_seasons(runner)
return if @hpxml_bldg.hvac_controls.size == 0
Expand Down
Loading