Skip to content

Conversation

@reyery
Copy link
Member

@reyery reyery commented Oct 22, 2025

No description provided.

justinfmccarty and others added 25 commits October 8, 2025 14:42
1. I have implemented the use of two new columns to the shading assembly database. The first (shading_location) allows the user to specify is shading is on the outside or inside of a window. The second allows the user to specify the setpoint of radiation that activates the shading system. Previously this was hardcoded at 300 W/m2.
2. Additionally, I have changed the way total window insolation is calculated. Previously this was treated like walls where the sum of the window radiation for all directions was taken. Now there is a for loop that iterates over each cardinal direction and calculates the insolation for the windows of that direction. This is future proofing for if we decide to treat the shading system and shading factor differently per direction.
3. The calc_blinds_activation function in blinds was taking in radiation as Watts, but needed it as W/m2 (this is the unit for the setpoint). I fixed this so that insolation goes into the function in W/m2 and then later in the parent script (calc_Isol_daysim) is changed back Watts as expected.
```
the rabbit is nice
it helps with pythonic code
but write code myself
```
Eliminated the loads_output, massflows_output, and temperatures_output parameters from function calls and definitions in create_unittest_data.py, as they are no longer required. This simplifies the test setup and function signatures.
Introduces a DatabaseMapping dataclass to encapsulate database mapping configuration for building properties. Updates all usages in building_envelope.py, building_hvac.py, and building_supply_systems.py to use the new dataclass, improving code clarity and maintainability.
Introduces an optional 'field_defaults' parameter to DatabaseMapping for handling missing/legacy fields, with logic to add missing columns using these defaults in BuildingPropertiesDatabase. Updates the envelope shading mapping to use this feature and adds documentation outlining a migration plan to move defaults to schemas.yml in the future.
Replaces the use of 'any' with 'Any' from the typing module for the field_defaults attribute in the DatabaseMapping dataclass to ensure correct type hinting.
Introduced a __post_init__ method to DatabaseMapping that raises ValueError if column_renames or field_defaults reference fields not present in the fields list. This ensures data consistency and prevents misconfiguration.
Introduces a check to ensure all required fields exist in the merged DataFrame before slicing. Raises a detailed ValueError if any fields are missing, helping to diagnose issues with database configuration or schema mismatches.
Enhanced the ValueError raised when required fields are missing in the database to include a suggested field_defaults configuration for developers. The new message provides clearer guidance on resolving issues with legacy databases and directs users to relevant documentation.
Updated the equality checks for shading_location to include spaces around the '==' operator for improved code readability and consistency.
Updated assertion error messages in test_calc_thermal_loads.py to use f-strings for improved readability and clarity.
Added notes in schemas on rf_sh and g_gl values. What does rf_sh=1 vs 0 fr instance.

Rearranged how the frame factor influences window area. This does not substantively change anything but is more logical than lumping frame_factor in with a larger calculation.
Updated all references of 'shading_setpoint_wm2' to 'shading_setpoint_Wm2' across CSV databases, code, and schema definitions for consistency and clarity. This change standardizes the field name and aligns it with the unit notation.
Moved dummy initialization of I_sol_underside outside the window direction loop to avoid overwriting and ensure correct shape.
Eliminated unnecessary variable assignments for I_sol_win_w_direction and I_sol_win in the case where actual_window_area_m2 is zero, as the function already continues to the next iteration.
Replaces string-based shading location checks with the ShadingLocation enum for improved type safety and clarity. Updates related logic in building_solar.py and blinds.py to use the enum, and adds error handling for invalid shading location values.
…ize-shading-setpoint

Shading setpoint now configurable part of Shading Assembly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants