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

Rds/kjw/function get swh uses associated with each building segment #1401

Merged
Changes from 2 commits
Commits
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
## get_SWH_uses_associated_with_each_building_segment

Description: This function gets all the SWH uses connected to a building segment. This function is primarily to encapsulate getting service water heating uses in one function so that if a change is made in the schema as to how service water heating use is specified, the RCT only needs to change in one place.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, so you are saying you would just have to update this function?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes


Inputs:
- **RMD**
- **building_segment_id** - the id of the building segment

Returns:
- **swh_uses**: A list containing the ids of all service water heating uses associated with a building segment

Function Call:
- get_component_by_ID
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this different from get_obj_by_id?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no... I'm not sure which is correct, but my understanding is that the RCT team understood either way what's going on

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sure they would understand. I think I am just advocating for cleanliness more now because I am also currently going through every single TCD description and making revisions to have consistent wording and formatting.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consistency is definitely better when possible!


Data Lookup: None

Logic:
- get the building segment: `building_segment = get_component_by_ID(RMD, building_segment_id)`
- create a blank list: `swh_uses = []`
- look at each swh use: `for swh_use in building_segment.service_water_heating_uses:`
- append the use to the list: `swh_uses.append(swh_use)`


**Returns** swh_uses

**[Back](../_toc.md)**

**Notes:**
Loading