Skip to content

Commit

Permalink
Merge pull request #430 from GermanZero-de/flats-buildings
Browse files Browse the repository at this point in the history
Flats buildings
  • Loading branch information
bgrundmann authored Dec 19, 2024
2 parents 85eafdf + bfb3be1 commit 618ebc8
Show file tree
Hide file tree
Showing 10 changed files with 4,481 additions and 4,509 deletions.
2 changes: 1 addition & 1 deletion data/production.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{

"public": "65bc761515b917a44a6b13ffed572c47df7eb91b",
"public": "792f13783c65eb8b1c712d06383a27dab2f0d217",
"proprietary": "b16f4d452591473fd57a68d21467d145a513f976"
}
6 changes: 2 additions & 4 deletions exploration-and-data-generation/ags-update/adjust.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from typing import Literal


STR_COLS = 3
STR_COLS = 0


def read_data(
Expand All @@ -27,7 +27,7 @@ def read_data(
data = row[STR_COLS + 1 :]
if remove_empty_rows and all((x == "" for x in data)):
continue
data = [float(x) for x in data]
data = [float(x) if x != "" else 0.0 for x in data]
result[ags] = (str_data, data)
return header, result

Expand Down Expand Up @@ -156,8 +156,6 @@ def compare(file1: str, file2: str, *, remove_empty_rows: bool):
if data1[ags] == data2[ags]:
equals += 1
else:
for (a, b) in zip(data1[ags], data2[ags]):
assert a <= b
unequal.append(ags)

print("SUMMARY")
Expand Down
34 changes: 4 additions & 30 deletions src/climatevision/generator/refdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,47 +473,21 @@ def filename(year_ref: int, what: str) -> str:
"nat_organic_agri": "2016",
"renewable_energy": "2021",
},
# 2021: {
# "ags": "2021",
# "area": "2021",
# "area_kinds": "2021",
# "assumptions": "2021",
# "buildings": "2018", # Building census is delayed
# "co2path": "2018", # We can use this unchanged.
# "destatis": "2018", # TODO: What about this? (Landkreisfeiner öffentlicher Verkehr)
# Have to check for above that we can use the traffic code to do the transplant
# "facts": "2018", # TODO: Bene is late
# "flats": "2018", # TODO: Building census is delayed
# "industry_facilites": "2018", # TODO: Jan
# "nat_agri": "2021",
# "nat_energy": "2021",
# "nat_organic_agri": "2020",
# "nat_res_buildings": "2018", # TODO: Building census is delayed
# "population": "2021",
# "renewable_energy": "2018", # TODO: What about this?
# "traffic": "2018", # TODO: We did write code to transplant this, must still check in the work
# "traffic_air": "2018", # TODO: ? Can we use the transplant code for this as well?!
# "traffic_rail": "2018", # TODO: ? CAn we use the transplant code for this as well?!
# },
# For all "unchanged" reference files we need to do
# the merging of the AGSes (we have previously convinced ourselves
# that the only interesting changes that have happened to AGS
# is that some kommune have been joined)
2021: {
"ags": "2021", # FINISHED
"area": "2021", # FINISHED
"area_kinds": "2021", # FINISHED
"assumptions": "2018", # NO CHANGES
"buildings": "2018", # AGS TRANSPLANT 2018 to 2021 OR 2022 - 5 month (HAUKE)
"assumptions": "2018", # NO CHANGES - FINISHED
"buildings": "2021", # AGS TRANSPLANT 2018 to 2021 FINISHED
"co2path": "2018", # NO CHANGES NEEDED (IF CO2 BUDGET STAYS "CONSTANT")
"destatis": "2021", # AGS TRANSPLANT 2018 TO 2021 FINISHED
"facts": "2021", # FINISHED
"flats": "2018", # AGS TRANSPLANT 2018 to 2021 OR 2022 - 5 month (HAUKE)
"flats": "2021", # FROM DESTATIS 2021 - FINISHED
"industry_facilites": "2021", # FINISHED
"nat_agri": "2021", # FINISHED
"nat_energy": "2021", # FINISHED
"nat_organic_agri": "2020", # FINISHED
"nat_res_buildings": "2018", # AGS TRANSPLANT 2018 to 2021 OR 2022 - 5 month (HAUKE -- MAYBE UNCHANGED?)
"nat_res_buildings": "2018", # WE ARE USING THIS UNCHANGED (ONLY STATES AND NO NEW DATA)
"population": "2021", # FINISHED
"renewable_energy": "2021", # LEON TO CHECK WHAT WENT WRONG
"traffic": "2021", # AGS TRANSPLANT 2018 to 2021 FINISHED
Expand Down
14 changes: 7 additions & 7 deletions tests/end_to_end_expected/2021/entries_03159016_2022_2035.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@
"m_year_target": 2035,
"m_year_baseline": 2022,
"m_year_ref": 2021,
"r_area_m2": 5125600.0,
"r_area_m2_1flat": 1238094.45,
"r_area_m2_2flat": 513206.64,
"r_area_m2_3flat": 3079966.4,
"r_area_m2_dorm": 193898.66999999998,
"r_area_m2": 5199700.0,
"r_area_m2_1flat": 1252690.66,
"r_area_m2_2flat": 514944.36000000004,
"r_area_m2_3flat": 3103370.4,
"r_area_m2_dorm": 196792.68,
"r_biomass_fec": 137856.5790508387,
"r_buildings_1919_1948": 2355.0,
"r_buildings_1949_1978": 9309.0,
Expand All @@ -126,8 +126,8 @@
"r_buildings_2009_2011": 169.0,
"r_buildings_2011_today": 1022.1774756417581,
"r_buildings_com": 20352.177475641758,
"r_buildings_ge_3_apts": 6781.0,
"r_buildings_le_2_apts": 12243.0,
"r_buildings_ge_3_apts": 6834.0,
"r_buildings_le_2_apts": 12365.0,
"r_buildings_nat": 19652588.0,
"r_buildings_until_1919": 2735.0,
"r_coal_fec": 6819.203254644129,
Expand Down
Loading

0 comments on commit 618ebc8

Please sign in to comment.