Skip to content

Commit

Permalink
Fix cts_buildings to status2023
Browse files Browse the repository at this point in the history
  • Loading branch information
nailend committed Feb 5, 2024
1 parent 2b4b70a commit c2b6b3a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ def __init__(self, dependencies):
version="0.0.4",
dependencies=dependencies,
tasks=(
cts_buildings,
cts_buildings, # TODO: status2023, currently fixed for only 2023
{cts_electricity, cts_heat},
get_cts_electricity_peak_load,
map_all_used_buildings,
Expand Down Expand Up @@ -442,6 +442,7 @@ def buildings_with_amenities():
Contains synthetic amenities in lost cells. Might be empty
"""


from saio.boundaries import egon_map_zensus_buildings_filtered_all
from saio.openstreetmap import osm_amenities_in_buildings_filtered

Expand All @@ -461,7 +462,7 @@ def buildings_with_amenities():
)
.filter(
EgonDemandRegioZensusElectricity.sector == "service",
EgonDemandRegioZensusElectricity.scenario == "status2019",
EgonDemandRegioZensusElectricity.scenario == "status2023", # TODO: status2023
)
)
df_amenities_in_buildings = pd.read_sql(
Expand Down Expand Up @@ -1210,7 +1211,7 @@ def adapt_numpy_int64(numpy_int64):

log.info("Start logging!")
# Buildings with amenities
df_buildings_with_amenities, df_lost_cells = buildings_with_amenities()
df_buildings_with_amenities, df_lost_cells = buildings_with_amenities() # TODO: status2023 this is fixed to 2023
log.info("Buildings with amenities selected!")

# Median number of amenities per cell
Expand All @@ -1229,7 +1230,7 @@ def adapt_numpy_int64(numpy_int64):

# Amenities not assigned to buildings
df_amenities_without_buildings = amenities_without_buildings()
log.info("Amenities without buildlings selected!")
log.info("Amenities without buildings selected!")

# Append lost cells due to duplicated ids, to cover all demand cells
if not df_lost_cells.empty:
Expand All @@ -1256,7 +1257,7 @@ def adapt_numpy_int64(numpy_int64):
df_amenities_without_buildings, points="geom_amenity"
)
log.info("Synthetic buildings created!")

# df_synthetic_buildings_with_amenities["scn_name"] = scn_name # TODO: status 2023, add eventually
# TODO remove renaming after #722
write_table_to_postgis(
df_synthetic_buildings_with_amenities.rename(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ class OsmBuildingsSynthetic(Base):

id = Column(String, primary_key=True)
cell_id = Column(String, index=True)
# scn_name = Column(String, index=True) # TODO: status2023 currently fixed to 2023
geom_building = Column(Geometry("Polygon", 3035), index=True)
geom_point = Column(Geometry("POINT", 3035))
n_amenities_inside = Column(Integer)
Expand Down

0 comments on commit c2b6b3a

Please sign in to comment.