Skip to content
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

Fix problems using versioning #859

Draft
wants to merge 4 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/egon/data/datasets/mv_grid_districts.py
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,12 @@ def merge_polygons_to_grid_district():
engine = db.engine()
MvGridDistrictsDissolved.__table__.drop(bind=engine, checkfirst=True)
MvGridDistrictsDissolved.__table__.create(bind=engine)
MvGridDistricts.__table__.drop(bind=engine, checkfirst=True)
db.execute_sql(
f"""
DROP TABLE IF EXISTS {MvGridDistricts.__table__.schema}.{MvGridDistricts.__table__.name} CASCADE;
"""
)

MvGridDistricts.__table__.create(bind=engine)

with session_scope() as session:
Expand Down Expand Up @@ -817,7 +822,7 @@ def define_mv_grid_districts():
mv_grid_districts_setup = partial(
Dataset,
name="MvGridDistricts",
version="0.0.2",
version="0.0.3",
dependencies=[],
tasks=(define_mv_grid_districts),
)
5 changes: 2 additions & 3 deletions src/egon/data/datasets/osmtgmod/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -514,8 +514,7 @@ def to_pypsa():
db.execute_sql(
"""
-- CLEAN UP OF TABLES
DELETE FROM grid.egon_etrago_bus
WHERE carrier = 'AC';
DELETE FROM grid.egon_etrago_bus;
DELETE FROM grid.egon_etrago_line;
DELETE FROM grid.egon_etrago_transformer;
"""
Expand Down Expand Up @@ -776,7 +775,7 @@ class Osmtgmod(Dataset):
def __init__(self, dependencies):
super().__init__(
name="Osmtgmod",
version="0.0.4",
version="0.0.5",
dependencies=dependencies,
tasks=(
import_osm_data,
Expand Down