-
Notifications
You must be signed in to change notification settings - Fork 75
Fix demand results #3940
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
Draft
reyery
wants to merge
25
commits into
master
Choose a base branch
from
demand-fix
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Fix demand results #3940
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This reverts commit b26ff6f.
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.