Skip to content

Commit b031eea

Browse files
Merge pull request #51 from pnnl/feature/doc-update
update doc site
2 parents e97ca82 + 894263e commit b031eea

27 files changed

Lines changed: 2114 additions & 1013 deletions

‎comcheck_api/ai/skill/SKILL.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ print(result["performanceRating"])
204204
offer building-area / envelope / lighting / mechanical / renewable / credits / simulation instead.
205205
`comcheck_api.list_operations()` enumerates the `building_area`,
206206
`envelope`, `interior_lighting`, `exterior_lighting`, `mechanical`,
207-
`renewable`, and `credits` groups.
207+
`credits`, and `renewable` groups.
208208

209209
## Common patterns
210210

‎comcheck_api/api/api_services.py‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ def update_project(
197197
self._handle_api_error(error)
198198

199199
def assemblies_uvalue(
200-
self, envelope_data: Dict[str, Any], energy_code
200+
self, envelope_data: Dict[str, Any], energy_code: str
201201
) -> Dict[str, Any]:
202202
"""get assemblies u values
203203
@@ -672,7 +672,9 @@ def fan_maximum_allowable_hp(
672672
"""Calculate maximum allowable horsepower for a fan.
673673
674674
Args:
675-
fan_data: Fan data
675+
fan_data: A single object with ``designBrakeHp`` and ``brakeHp``.
676+
Both keys are required; the endpoint returns a server error
677+
if ``brakeHp`` is absent or if a list is sent.
676678
energy_code: The energy code for the endpoint path
677679
678680
Returns:

‎comcheck_api/client/comcheck_client.py‎

Lines changed: 545 additions & 483 deletions
Large diffs are not rendered by default.

‎comcheck_api/defaults.py‎

Lines changed: 43 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Module for project default templates/values."""
22

33
import copy
4+
from typing import NoReturn
45
from uuid import uuid4
56

67
from comcheck_api.constants.building_area_constants import DEFAULT_BUILDING_AREA
@@ -34,11 +35,32 @@
3435
)
3536

3637
from comcheck_api.constants.common_constants import PROJECT_TEMPLATE
38+
from comcheck_api.types.common_types import ExteriorArea, InteriorSpace
39+
from comcheck_api.types.core_types import (
40+
AgWall,
41+
BgWall,
42+
ComBuilding,
43+
Door,
44+
Fan,
45+
FanSystem,
46+
Fixture,
47+
Floor,
48+
HVACPlant,
49+
HVACSystem,
50+
OffsiteRenewableProcurement,
51+
RenewableSystem,
52+
Roof,
53+
ServiceWaterHeatingSystem,
54+
Skylight,
55+
ThermalBridge,
56+
WholeBldgUse,
57+
Window,
58+
)
3759

3860
# from comcheck_api.constants.lighting_constants import DEFAULT_FIXTURE_SCHEDULE
3961

4062

41-
def get_default_project_template():
63+
def get_default_project_template() -> ComBuilding:
4264
"""Return a deep copy of the default :class:`~comcheck_api.types.core_types.ComBuilding` template.
4365
4466
The template is pre-populated with sensible defaults for location
@@ -50,7 +72,7 @@ def get_default_project_template():
5072
return copy.deepcopy(PROJECT_TEMPLATE)
5173

5274

53-
def get_default_building_area_template():
75+
def get_default_building_area_template() -> WholeBldgUse:
5476
"""Return a deep copy of the default :class:`~comcheck_api.types.core_types.WholeBldgUse` template.
5577
5678
Defaults to an *Automotive Facility* with 1 000 sq ft floor area and
@@ -68,7 +90,7 @@ def get_default_building_area_template():
6890
return area
6991

7092

71-
def get_default_roof_template():
93+
def get_default_roof_template() -> Roof:
7294
"""Return a deep copy of the default :class:`~comcheck_api.types.core_types.Roof` template.
7395
7496
Defaults to an above-deck roof with 6 000 sq ft gross area and
@@ -80,7 +102,7 @@ def get_default_roof_template():
80102
return copy.deepcopy(DEFAULT_ROOF)
81103

82104

83-
def get_default_ag_wall_template():
105+
def get_default_ag_wall_template() -> AgWall:
84106
"""Return a deep copy of the default :class:`~comcheck_api.types.core_types.AgWall` template.
85107
86108
Defaults to a metal-frame 24-inch above-grade wall with 4 800 sq ft
@@ -92,7 +114,7 @@ def get_default_ag_wall_template():
92114
return copy.deepcopy(DEFAULT_AG_WALL)
93115

94116

95-
def get_default_floor_template():
117+
def get_default_floor_template() -> Floor:
96118
"""Return a deep copy of the default :class:`~comcheck_api.types.core_types.Floor` template.
97119
98120
Defaults to a heated slab-on-grade floor with 320 sq ft gross area
@@ -104,7 +126,7 @@ def get_default_floor_template():
104126
return copy.deepcopy(DEFAULT_FLOOR)
105127

106128

107-
def get_default_bg_wall_template():
129+
def get_default_bg_wall_template() -> BgWall:
108130
"""Return a deep copy of the default :class:`~comcheck_api.types.core_types.BgWall` template.
109131
110132
Defaults to a concrete below-grade wall with 3 000 sq ft gross area,
@@ -116,7 +138,7 @@ def get_default_bg_wall_template():
116138
return copy.deepcopy(DEFAULT_BG_WALL)
117139

118140

119-
def get_default_skylight_template():
141+
def get_default_skylight_template() -> Skylight:
120142
"""Return a deep copy of the default :class:`~comcheck_api.types.core_types.Skylight` template.
121143
122144
Defaults to a no-curb, double-pane low-E skylight with 100 sq ft
@@ -128,7 +150,7 @@ def get_default_skylight_template():
128150
return copy.deepcopy(DEFAULT_SKYLIGHT)
129151

130152

131-
def get_default_window_template():
153+
def get_default_window_template() -> Window:
132154
"""Return a deep copy of the default :class:`~comcheck_api.types.core_types.Window` template.
133155
134156
Defaults to a triple-pane, non-operable, metal-frame window with
@@ -140,7 +162,7 @@ def get_default_window_template():
140162
return copy.deepcopy(DEFAULT_WINDOW)
141163

142164

143-
def get_default_door_template():
165+
def get_default_door_template() -> Door:
144166
"""Return a deep copy of the default :class:`~comcheck_api.types.core_types.Door` template.
145167
146168
Defaults to a swinging, insulated metal entrance door with 23 sq ft
@@ -152,7 +174,7 @@ def get_default_door_template():
152174
return copy.deepcopy(DEFAULT_DOOR)
153175

154176

155-
def get_default_thermal_bridge_template():
177+
def get_default_thermal_bridge_template() -> ThermalBridge:
156178
"""Return a deep copy of the default :class:`~comcheck_api.types.core_types.ThermalBridge` template.
157179
158180
Defaults to a prescriptive linear floor-to-wall intersection thermal
@@ -164,7 +186,7 @@ def get_default_thermal_bridge_template():
164186
return copy.deepcopy(DEFAULT_THERMAL_BRIDGE)
165187

166188

167-
def get_default_interior_space_template():
189+
def get_default_interior_space_template() -> InteriorSpace:
168190
"""Return a deep copy of the default interior lighting space template.
169191
170192
In the COMcheck API schema, an interior lighting space is represented by
@@ -182,7 +204,7 @@ def get_default_interior_space_template():
182204
return copy.deepcopy(DEFAULT_INTERIOR_SPACE_AREA)
183205

184206

185-
def get_default_fixture_template():
207+
def get_default_fixture_template() -> Fixture:
186208
"""Return a deep copy of the default :class:`~comcheck_api.types.core_types.Fixture` template.
187209
188210
Defaults to an LED fixture at 32 W, quantity 1, with no lighting controls.
@@ -193,7 +215,7 @@ def get_default_fixture_template():
193215
return copy.deepcopy(DEFAULT_FIXTURE)
194216

195217

196-
def get_default_exterior_area_template():
218+
def get_default_exterior_area_template() -> ExteriorArea:
197219
"""Return a deep copy of the default exterior lighting area template.
198220
199221
In the COMcheck API schema, an exterior lighting area is represented by
@@ -210,7 +232,7 @@ def get_default_exterior_area_template():
210232
return copy.deepcopy(DEFAULT_EXTERIOR_AREA)
211233

212234

213-
def get_default_fixture_schedule_template():
235+
def get_default_fixture_schedule_template() -> NoReturn:
214236
"""Return a default fixture schedule template with a unique key.
215237
216238
.. warning::
@@ -221,7 +243,7 @@ def get_default_fixture_schedule_template():
221243
raise NotImplementedError("DEFAULT_FIXTURE_SCHEDULE constant not yet implemented")
222244

223245

224-
def get_default_renewable_system_template():
246+
def get_default_renewable_system_template() -> RenewableSystem:
225247
"""Return a deep copy of the default renewable system template.
226248
227249
Defaults to a Solar PV system with 0.0 capacity in Watts.
@@ -232,7 +254,7 @@ def get_default_renewable_system_template():
232254
return copy.deepcopy(DEFAULT_RENEWABLE_SYSTEM)
233255

234256

235-
def get_default_offsite_renewable_procurement_template():
257+
def get_default_offsite_renewable_procurement_template() -> OffsiteRenewableProcurement:
236258
"""Return a deep copy of the default offsite renewable procurement template.
237259
238260
Defaults to an unspecified procurement type with 0.0 kWh annual energy.
@@ -243,7 +265,7 @@ def get_default_offsite_renewable_procurement_template():
243265
return copy.deepcopy(DEFAULT_OFFSITE_RENEWABLE_PROCUREMENT)
244266

245267

246-
def get_default_hvac_system_template():
268+
def get_default_hvac_system_template() -> HVACSystem:
247269
"""Return a deep copy of the default HVAC system template.
248270
249271
Defaults to an unknown cooling and heating equipment with no economizer,
@@ -255,7 +277,7 @@ def get_default_hvac_system_template():
255277
return copy.deepcopy(DEFAULT_HVAC_SYSTEM)
256278

257279

258-
def get_default_fan_system_template():
280+
def get_default_fan_system_template() -> FanSystem:
259281
"""Return a deep copy of the default fan system template.
260282
261283
Defaults to motor nameplate HP compliance method with no fans and no
@@ -267,7 +289,7 @@ def get_default_fan_system_template():
267289
return copy.deepcopy(DEFAULT_FAN_SYSTEM)
268290

269291

270-
def get_default_fan_template():
292+
def get_default_fan_template() -> Fan:
271293
"""Return a deep copy of the default fan template.
272294
273295
Defaults to an unspecified fan type with 0.0 volume and no efficiency data.
@@ -278,7 +300,7 @@ def get_default_fan_template():
278300
return copy.deepcopy(DEFAULT_FAN)
279301

280302

281-
def get_default_hvac_plant_template():
303+
def get_default_hvac_plant_template() -> HVACPlant:
282304
"""Return a deep copy of the default HVAC plant template.
283305
284306
Defaults to a heating plant with hot water boiler (100 kBtu/hr capacity)
@@ -290,7 +312,7 @@ def get_default_hvac_plant_template():
290312
return copy.deepcopy(DEFAULT_HVAC_PLANT)
291313

292314

293-
def get_default_water_heater_template():
315+
def get_default_water_heater_template() -> ServiceWaterHeatingSystem:
294316
"""Return a deep copy of the default service water heating system template.
295317
296318
Defaults to a storage water heater with unknown fuel type, 1 quantity,

‎comcheck_api/introspection.py‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
"interior_lighting": project_interior_lighting_operations,
3737
"exterior_lighting": project_exterior_lighting_operations,
3838
"mechanical": project_mechanical_operations,
39-
"renewable": project_renewable_operations,
4039
"credits": project_credit_operations,
40+
"renewable": project_renewable_operations,
4141
}
4242

4343

@@ -64,12 +64,14 @@ class FieldSchema(BaseModel):
6464

6565

6666
class EnumMember(BaseModel):
67+
"""One member of an enum: its Python name and its value."""
68+
6769
name: str
6870
value: str
6971

7072

7173
class TypeSchema(BaseModel):
72-
"""Reflected schema of a Pydantic model or StrEnum."""
74+
"""Reflected schema of a Pydantic model or enum."""
7375

7476
name: str
7577
kind: Literal["model", "enum"]
@@ -82,7 +84,10 @@ def list_operations() -> list[OperationInfo]:
8284
"""Discover public functions in the project operation modules.
8385
8486
Discovered live via :mod:`inspect` so the list always matches the
85-
installed SDK version.
87+
installed SDK version. Groups are returned in the order
88+
``building_area``, ``envelope``, ``interior_lighting``,
89+
``exterior_lighting``, ``mechanical``, ``credits``, ``renewable``.
90+
``COMcheckClient`` methods (API calls) are not included.
8691
"""
8792
out: list[OperationInfo] = []
8893
for group, mod in _OP_MODULES.items():

‎comcheck_api/project_operations/project_envelope_operations.py‎

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ def add_bg_wall_to_project(
201201
def update_bg_wall_in_project(
202202
project: ComBuilding, bg_wall_assembly_type: str, updates: dict[str, Any] | BgWall
203203
) -> ComBuilding:
204-
"""Update an bgWall in the project's envelope.
204+
"""Update a bgWall in the project's envelope.
205205
206206
Args:
207207
project: The project object to modify
@@ -225,7 +225,7 @@ def update_bg_wall_in_project(
225225
def remove_bg_wall_from_project(
226226
project: ComBuilding, bg_wall_assembly_type: str
227227
) -> ComBuilding:
228-
"""Remove an bgWall from the envelope in any project object.
228+
"""Remove a bgWall from the envelope in any project object.
229229
230230
Args:
231231
project: The project object to modify
@@ -275,7 +275,7 @@ def add_floor_to_project(
275275
def update_floor_in_project(
276276
project: ComBuilding, floor_assembly_type: str, updates: dict[str, Any] | Floor
277277
) -> ComBuilding:
278-
"""Update an floor in the project's envelope.
278+
"""Update a floor in the project's envelope.
279279
280280
Args:
281281
project: The project object to modify
@@ -299,7 +299,7 @@ def update_floor_in_project(
299299
def remove_floor_from_project(
300300
project: ComBuilding, floor_assembly_type: str
301301
) -> ComBuilding:
302-
"""Remove an bgWall from the envelope in any project object.
302+
"""Remove a floor from the envelope in any project object.
303303
304304
Args:
305305
project: The project object to modify
@@ -378,17 +378,20 @@ def remove_skylight_from_project(
378378
project: ComBuilding,
379379
skylight_assembly_type: str,
380380
) -> ComBuilding:
381-
"""Add a new skylight to a specific roof in the envelope.
381+
"""Remove a skylight from the project.
382+
383+
Looks for the skylight on the roofs, or in the orphaned
384+
``envelope.skylight`` list for alteration projects.
382385
383386
Args:
384-
project: ComBuilding,
385-
skylight_assembly_type: str
387+
project: The project object to modify
388+
skylight_assembly_type: The assemblyType of the skylight to remove
386389
387390
Returns:
388-
Updated project object with the skylight added to the specified roof
391+
Updated project object with the skylight removed
389392
390393
Raises:
391-
ValueError: If buildingAreaKey is not found or if roof's bldgUseKey doesn't match buildingAreaKey
394+
ValueError: If no skylight with the given assemblyType is found
392395
"""
393396
updated_project = project.model_copy(deep=True)
394397

0 commit comments

Comments
 (0)