Skip to content

Commit

Permalink
Remove old adhoc fixes for #989
Browse files Browse the repository at this point in the history
  • Loading branch information
nailend committed Jan 10, 2023
1 parent b5db836 commit 6a58844
Showing 1 changed file with 0 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -918,33 +918,6 @@ def calc_building_amenity_share(df_cts_buildings):
"building_amenity_share"
].multiply(df_demand_share["cell_share"])

# # Fix #989
# # Mismatched bus_id
# # May result in failing sanity checks
# from saio.boundaries import egon_map_zensus_buildings_filtered_all
#
# with db.session_scope() as session:
# query = session.query(
# egon_map_zensus_buildings_filtered_all.id,
# MapZensusGridDistricts.bus_id,
# ).filter(
# egon_map_zensus_buildings_filtered_all.id.in_(
# df_cts_buildings.id.values
# ),
# MapZensusGridDistricts.zensus_population_id
# == egon_map_zensus_buildings_filtered_all.zensus_population_id,
# )
#
# df_map_bus_id = pd.read_sql(
# query.statement, session.connection(), index_col=None
# )
#
# df_demand_share = pd.merge(
# left=df_demand_share.drop(columns="bus_id"),
# right=df_map_bus_id,
# on="id",
# )

# only pass selected columns
df_demand_share = df_demand_share[
["id", "bus_id", "scenario", "profile_share"]
Expand Down Expand Up @@ -1402,30 +1375,6 @@ def adapt_numpy_int64(numpy_int64):
columns={"index": "serial"}
)

# # Fix #989
# # Mismatched zensus population id
# from saio.boundaries import egon_map_zensus_buildings_filtered_all
#
# with db.session_scope() as session:
# query = session.query(
# egon_map_zensus_buildings_filtered_all.id,
# egon_map_zensus_buildings_filtered_all.zensus_population_id,
# ).filter(
# egon_map_zensus_buildings_filtered_all.id.in_(
# df_cts_buildings.id.values
# )
# )
#
# df_map_zensus_population_id = pd.read_sql(
# query.statement, session.connection(), index_col=None
# )
#
# df_cts_buildings = pd.merge(
# left=df_cts_buildings.drop(columns="zensus_population_id"),
# right=df_map_zensus_population_id,
# on="id",
# )

# Write table to db for debugging and postprocessing
write_table_to_postgis(
df_cts_buildings,
Expand Down

0 comments on commit 6a58844

Please sign in to comment.