-
Notifications
You must be signed in to change notification settings - Fork 75
Allow running pv plots without running demand #3911
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
Changes from all commits
772d7dd
471bf9f
cecbac8
89f30a8
e4368a0
d94b8cf
d59270a
ca9dc84
261e502
3c6908b
f49e9d8
2378c8d
a3c5083
9555831
5b160d7
a3a0cc6
869dbc8
0f7f254
6dfdf54
6b4c12a
fbe780d
261ab2c
15d3817
a48c124
c5650eb
46e4390
7b26b9b
2eb9c7b
22d9c8e
7a25a5d
00812aa
f82c3d1
0447871
49313cf
bf104c5
03cc1c1
38901a9
0db063b
60e2758
8c64beb
93e8b12
47390bb
0f0bee5
bdba1c5
38621da
d8f9ce3
565f8f8
f9890f6
4944435
f6d3239
45c1853
96e8071
c59da2a
46b7eb7
ab9746a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -24,6 +24,7 @@ | |||||||||||||||||||
from cea.datamanagement.format_helper.cea4_verify import cea4_verify, verify_shp, \ | ||||||||||||||||||||
COLUMNS_ZONE_4, print_verification_results_4, path_to_input_file_without_db_4, CSV_BUILDING_PROPERTIES_3_CSV | ||||||||||||||||||||
from cea.datamanagement.format_helper.cea4_verify_db import check_directory_contains_csv | ||||||||||||||||||||
from cea.datamanagement.utils import migrate_void_deck_data | ||||||||||||||||||||
from cea.utilities.dbf import dbf_to_dataframe | ||||||||||||||||||||
|
||||||||||||||||||||
COLUMNS_ZONE_3 = ['Name', 'floors_bg', 'floors_ag', 'height_bg', 'height_ag'] | ||||||||||||||||||||
|
@@ -550,9 +551,12 @@ def migrate_cea3_to_cea4(scenario, verbose=False): | |||||||||||||||||||
pass | ||||||||||||||||||||
# print('For Scenario: {scenario}, '.format(scenario=scenario_name), 'zone.shp already follows the CEA-4 format.') | ||||||||||||||||||||
else: | ||||||||||||||||||||
raise ValueError('! zone.shp exists but follows neither the CEA-3 nor CEA-4 format. CEA cannot proceed with the data migration.' | ||||||||||||||||||||
'Check the following column(s) for CEA-3 format: {list_missing_attributes_zone_3}.'.format(list_missing_attributes_zone_3=list_missing_attributes_zone_3), | ||||||||||||||||||||
'Check the following column(s) for CEA-4 format: {list_missing_attributes_zone_4}.'.format(list_missing_attributes_zone_4=list_missing_attributes_zone_4) | ||||||||||||||||||||
if list_missing_attributes_zone_4[0] == 'void_deck' and len(list_missing_attributes_zone_4) == 1: | ||||||||||||||||||||
config = cea.config.Configuration() | ||||||||||||||||||||
locator = cea.inputlocator.InputLocator(config.scenario) | ||||||||||||||||||||
migrate_void_deck_data(locator) | ||||||||||||||||||||
else: | ||||||||||||||||||||
raise ValueError('! zone.shp exists but follows neither the CEA-3 nor CEA-4 format. CEA cannot proceed with the data migration. Check the following column(s) for CEA-3 format: {list_missing_attributes_zone_3}.'.format(list_missing_attributes_zone_3=list_missing_attributes_zone_3), 'Check the following column(s) for CEA-4 format: {list_missing_attributes_zone_4}.'.format(list_missing_attributes_zone_4=list_missing_attributes_zone_4) | ||||||||||||||||||||
) | ||||||||||||||||||||
else: | ||||||||||||||||||||
print("! Ensure zone.shp (CEA-3 format) is present in building-geometry folder.") | ||||||||||||||||||||
|
@@ -571,9 +575,12 @@ def migrate_cea3_to_cea4(scenario, verbose=False): | |||||||||||||||||||
pass | ||||||||||||||||||||
# print('For Scenario: {scenario}, '.format(scenario=scenario_name), 'surroundings.shp already follows the CEA-4 format.') | ||||||||||||||||||||
else: | ||||||||||||||||||||
raise ValueError('surroundings.shp exists but follows neither the CEA-3 nor CEA-4 format. CEA cannot proceed with the data migration.' | ||||||||||||||||||||
'Check the following column(s) for CEA-3 format: {list_missing_attributes_surroundings_3}.'.format(list_missing_attributes_surroundings_3=list_missing_attributes_surroundings_3), | ||||||||||||||||||||
'Check the following column(s) for CEA-4 format: {list_missing_attributes_surroundings_4}.'.format(list_missing_attributes_surroundings_4=list_missing_attributes_surroundings_4) | ||||||||||||||||||||
if list_missing_attributes_zone_4[0] == 'void_deck' and len(list_missing_attributes_zone_4) == 1: | ||||||||||||||||||||
config = cea.config.Configuration() | ||||||||||||||||||||
locator = cea.inputlocator.InputLocator(config.scenario) | ||||||||||||||||||||
migrate_void_deck_data(locator) | ||||||||||||||||||||
else: | ||||||||||||||||||||
raise ValueError('surroundings.shp exists but follows neither the CEA-3 nor CEA-4 format. CEA cannot proceed with the data migration. Check the following column(s) for CEA-3 format: {list_missing_attributes_surroundings_3}.'.format(list_missing_attributes_surroundings_3=list_missing_attributes_surroundings_3), 'Check the following column(s) for CEA-4 format: {list_missing_attributes_surroundings_4}.'.format(list_missing_attributes_surroundings_4=list_missing_attributes_surroundings_4) | ||||||||||||||||||||
) | ||||||||||||||||||||
Comment on lines
+578
to
584
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wrong list referenced in surroundings branch; remove void_deck migration here.
Apply this diff: - else:
- if list_missing_attributes_zone_4[0] == 'void_deck' and len(list_missing_attributes_zone_4) == 1:
- config = cea.config.Configuration()
- locator = cea.inputlocator.InputLocator(config.scenario)
- migrate_void_deck_data(locator)
- else:
- raise ValueError('surroundings.shp exists but follows neither the CEA-3 nor CEA-4 format. CEA cannot proceed with the data migration. Check the following column(s) for CEA-3 format: {list_missing_attributes_surroundings_3}.'.format(list_missing_attributes_surroundings_3=list_missing_attributes_surroundings_3), 'Check the following column(s) for CEA-4 format: {list_missing_attributes_surroundings_4}.'.format(list_missing_attributes_surroundings_4=list_missing_attributes_surroundings_4)
- )
+ else:
+ raise ValueError('surroundings.shp exists but follows neither the CEA-3 nor CEA-4 format. CEA cannot proceed with the data migration. Check the following column(s) for CEA-3 format: {list_missing_attributes_surroundings_3}.'.format(list_missing_attributes_surroundings_3=list_missing_attributes_surroundings_3), 'Check the following column(s) for CEA-4 format: {list_missing_attributes_surroundings_4}.'.format(list_missing_attributes_surroundings_4=list_missing_attributes_surroundings_4)) 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
|
||||||||||||||||||||
else: | ||||||||||||||||||||
print('! (optional) Run Surroundings Helper to generate surroundings.shp after the data migration.') | ||||||||||||||||||||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -234,6 +234,13 @@ class EnvelopeProperties: | |||||||||||||||||||||||||
A_op: Annotated[float, "Opaque area above ground [m2]"] | ||||||||||||||||||||||||||
win_wall: Annotated[float, "Window to wall ratio [-]"] | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
# Area fields added from BuildingRCModel | ||||||||||||||||||||||||||
Aroof: Annotated[float, "Roof area [m2]"] | ||||||||||||||||||||||||||
Aunderside: Annotated[float, "Underside area [m2]"] | ||||||||||||||||||||||||||
Awall_ag: Annotated[float, "Above ground wall area [m2]"] | ||||||||||||||||||||||||||
Awin_ag: Annotated[float, "Above ground window area [m2]"] | ||||||||||||||||||||||||||
Aop_bg: Annotated[float, "Area of opaque surfaces below ground [m2]"] | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
Comment on lines
+237
to
+243
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. New area fields should have safe defaults Envelope CSVs in the wild may not include these new columns yet. Without defaults, from_dict will raise. Provide 0.0 defaults to maintain backward compatibility. Apply: - Aroof: Annotated[float, "Roof area [m2]"]
- Aunderside: Annotated[float, "Underside area [m2]"]
- Awall_ag: Annotated[float, "Above ground wall area [m2]"]
- Awin_ag: Annotated[float, "Above ground window area [m2]"]
- Aop_bg: Annotated[float, "Area of opaque surfaces below ground [m2]"]
+ Aroof: Annotated[float, "Roof area [m2]"] = 0.0
+ Aunderside: Annotated[float, "Underside area [m2]"] = 0.0
+ Awall_ag: Annotated[float, "Above ground wall area [m2]"] = 0.0
+ Awin_ag: Annotated[float, "Above ground window area [m2]"] = 0.0
+ Aop_bg: Annotated[float, "Area of opaque surfaces below ground [m2]"] = 0.0 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
|
||||||||||||||||||||||||||
# FIXME: These fields does not neccessarily describe the building envelope | ||||||||||||||||||||||||||
Es: Annotated[float, "Heated/cooled share [-]"] | ||||||||||||||||||||||||||
occupied_bg: Annotated[float, "Basement occupation factor [-]"] | ||||||||||||||||||||||||||
|
@@ -263,18 +270,14 @@ def from_dict(cls, solar: dict): | |||||||||||||||||||||||||
@dataclass(frozen=True) | ||||||||||||||||||||||||||
class RCModelProperties: | ||||||||||||||||||||||||||
# --- Area properties --- | ||||||||||||||||||||||||||
footprint: Annotated[float, "Building footprint area [m2]"] | ||||||||||||||||||||||||||
Atot: Annotated[float, "Area of all surfaces facing the building zone [m2]"] | ||||||||||||||||||||||||||
Am: Annotated[float, "Effective mass area [m2]"] | ||||||||||||||||||||||||||
# TODO: Determine if these fields belong here (calculated using calc_useful_areas) | ||||||||||||||||||||||||||
Comment on lines
+273
to
+276
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. RCModelProperties: add defaults for newly required fields If upstream dict lacks 'footprint' or 'Am' (computed later), construction will fail. Provide safe defaults here too. Apply: - footprint: Annotated[float, "Building footprint area [m2]"]
+ footprint: Annotated[float, "Building footprint area [m2]"] = 0.0
@@
- Am: Annotated[float, "Effective mass area [m2]"]
+ Am: Annotated[float, "Effective mass area [m2]"] = 0.0 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
|
||||||||||||||||||||||||||
Af: Annotated[float, "Conditioned floor area (areas that are heated or cooled) [m2]"] | ||||||||||||||||||||||||||
GFA_m2: Annotated[float, "Gross floor area [m2]"] | ||||||||||||||||||||||||||
footprint: Annotated[float, "Building footprint area [m2]"] | ||||||||||||||||||||||||||
Aroof: Annotated[float, "Roof area [m2]"] | ||||||||||||||||||||||||||
Aunderside: Annotated[float, "Underside area [m2]"] | ||||||||||||||||||||||||||
Awall_ag: Annotated[float, "Above ground wall area [m2]"] | ||||||||||||||||||||||||||
Awin_ag: Annotated[float, "Above ground window area [m2]"] | ||||||||||||||||||||||||||
Am: Annotated[float, "Effective mass area [m2]"] | ||||||||||||||||||||||||||
Aef: Annotated[float, "Electrified area (share of gross floor area that is electrified) [m2]"] | ||||||||||||||||||||||||||
Aocc: Annotated[float, "Occupied floor area [m2]"] | ||||||||||||||||||||||||||
Aop_bg: Annotated[float, "Area of opaque surfaces below ground [m2]"] | ||||||||||||||||||||||||||
Hs_ag: Annotated[float, "Share of above-ground gross floor area that is conditioned [m2/m2]"] | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
# --- Thermal properties --- | ||||||||||||||||||||||||||
|
@@ -289,13 +292,6 @@ class RCModelProperties: | |||||||||||||||||||||||||
Htr_op: Annotated[float, "Thermal transmission coefficient for opaque surfaces in RC-model [W/K]"] | ||||||||||||||||||||||||||
Htr_w: Annotated[float, "Thermal transmission coefficient for windows in RC-model [W/K]"] | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
# FIXME: Decide if these fields should be in envelope or rc_model | ||||||||||||||||||||||||||
# --- U-values (Duplicated Envelope properties) --- | ||||||||||||||||||||||||||
U_wall: Annotated[float, "U-value of wall [W/m2K]"] | ||||||||||||||||||||||||||
U_roof: Annotated[float, "U-value of roof [W/m2K]"] | ||||||||||||||||||||||||||
U_win: Annotated[float, "U-value of windows [W/m2K]"] | ||||||||||||||||||||||||||
U_base: Annotated[float, "U-value of floor [W/m2K]"] | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
@classmethod | ||||||||||||||||||||||||||
def from_dict(cls, rc_model: dict): | ||||||||||||||||||||||||||
field_names = cls.__annotations__.keys() | ||||||||||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guard the ‘void_deck-only’ check and build the locator from the passed
scenario
(also avoids indexing errors).list_missing_attributes_zone_4[0]
will crash when the list is empty.['void_deck']
and instantiateInputLocator
with the function’sscenario
argument (not the global config). Also,cea.inputlocator
isn’t imported in this file.Apply this diff:
Add the missing import near the top of the file:
🤖 Prompt for AI Agents