diff --git a/.gitignore b/.gitignore index 0a9bce1..10e71da 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,32 @@ -/.idea/* -/ego.io.egg-info/* +# exclude project files +.idea/ + + +# exclude certain types of files +*.doctree +*.txt +*.html +*.js +*.inv +*.pyc +*.ttf +*.woff +*.png +*.css +*.pkl + +# exclude locally built docs +doc/_html + +# exclude egg-info +ego.io.egg-info/ +ego.io.egg-info/* /egoio.egg-info/PKG-INFO /egoio.egg-info/SOURCES.txt /egoio.egg-info/dependency_links.txt /egoio.egg-info/top_level.txt + +#exclude pycaches /egoio/__pycache__/__init__.cpython-34.pyc /egoio/tools/__pycache__/__init__.cpython-34.pyc /egoio/tools/__pycache__/config.cpython-34.pyc diff --git a/egoio/db_tables/boundaries.py b/egoio/db_tables/boundaries.py index dd925d8..e9b44b0 100644 --- a/egoio/db_tables/boundaries.py +++ b/egoio/db_tables/boundaries.py @@ -3,7 +3,6 @@ from geoalchemy2.types import Geometry from sqlalchemy.ext.declarative import declarative_base - Base = declarative_base() metadata = Base.metadata @@ -487,6 +486,16 @@ class BkgVg2506Gem(Base): ) +class FfeOsmNut3(Base): + __tablename__ = 'ffe_osm_nut3' + __table_args__ = {'schema': 'boundaries'} + + id = Column(Integer, primary_key=True, server_default=text("nextval('boundaries.ffe_osm_nut3_id_seq'::regclass)")) + version = Column(Text) + nuts_code = Column(String(5)) + geom = Column(Geometry('MULTIPOLYGON', 3035), index=True) + + class OsmPostcode(Base): __tablename__ = 'osm_postcode' __table_args__ = {'schema': 'boundaries'} diff --git a/egoio/db_tables/climate.py b/egoio/db_tables/climate.py index 4fd15e0..e3e10ec 100644 --- a/egoio/db_tables/climate.py +++ b/egoio/db_tables/climate.py @@ -3,7 +3,6 @@ from geoalchemy2.types import Geometry from sqlalchemy.ext.declarative import declarative_base - Base = declarative_base() metadata = Base.metadata diff --git a/egoio/db_tables/demand.py b/egoio/db_tables/demand.py index 370765c..5cf79c9 100644 --- a/egoio/db_tables/demand.py +++ b/egoio/db_tables/demand.py @@ -3,7 +3,6 @@ from geoalchemy2.types import Geometry from sqlalchemy.ext.declarative import declarative_base - Base = declarative_base() metadata = Base.metadata diff --git a/egoio/db_tables/economy.py b/egoio/db_tables/economy.py index c65bb59..88510c6 100644 --- a/egoio/db_tables/economy.py +++ b/egoio/db_tables/economy.py @@ -2,7 +2,6 @@ from sqlalchemy import Column, Float, String from sqlalchemy.ext.declarative import declarative_base - Base = declarative_base() metadata = Base.metadata diff --git a/egoio/db_tables/emission.py b/egoio/db_tables/emission.py index f359880..6e52d58 100644 --- a/egoio/db_tables/emission.py +++ b/egoio/db_tables/emission.py @@ -1,5 +1,7 @@ # coding: utf-8 from sqlalchemy import MetaData - metadata = MetaData() + + + diff --git a/egoio/db_tables/environment.py b/egoio/db_tables/environment.py index 101a384..cad17cb 100644 --- a/egoio/db_tables/environment.py +++ b/egoio/db_tables/environment.py @@ -3,7 +3,6 @@ from geoalchemy2.types import Geometry from sqlalchemy.ext.declarative import declarative_base - Base = declarative_base() metadata = Base.metadata diff --git a/egoio/db_tables/grid.py b/egoio/db_tables/grid.py index 014a5d1..05c6313 100644 --- a/egoio/db_tables/grid.py +++ b/egoio/db_tables/grid.py @@ -1,10 +1,8 @@ # coding: utf-8 -from sqlalchemy import ARRAY, BigInteger, Boolean, Column, Date, DateTime, Float, ForeignKey, Integer, Numeric, SmallInteger, String, Text, text +from sqlalchemy import ARRAY, BigInteger, Boolean, CHAR, Column, Date, DateTime, Float, ForeignKey, Integer, JSON, Numeric, SmallInteger, String, Table, Text, text from geoalchemy2.types import Geometry from sqlalchemy.orm import relationship from sqlalchemy.ext.declarative import declarative_base -from sqlalchemy.dialects.postgresql import DOUBLE_PRECISION, JSON - Base = declarative_base() metadata = Base.metadata @@ -228,7 +226,7 @@ class EgoDpMvGriddistrict(Base): type2_cnt = Column(Integer) type3 = Column(Integer) type3_cnt = Column(Integer) - group = Column(String(1)) + group = Column(CHAR(1)) gem = Column(Integer) gem_clean = Column(Integer) zensus_sum = Column(Integer) @@ -265,6 +263,22 @@ class EgoDpMvlvSubstation(Base): subst_cnt = Column(Integer) +class EgoLineExpansionCost(Base): + __tablename__ = 'ego_line_expansion_costs' + __table_args__ = {'schema': 'grid'} + + version = Column(Text) + cost_id = Column(BigInteger, primary_key=True) + voltage_level = Column(Text) + component = Column(Text) + measure = Column(Text) + investment_cost = Column(Float(53)) + unit = Column(Text) + comment = Column(Text) + source = Column(Text) + capital_costs_pypsa = Column(Float(53)) + + class EgoPfHvBus(Base): __tablename__ = 'ego_pf_hv_bus' __table_args__ = {'schema': 'grid'} @@ -279,6 +293,227 @@ class EgoPfHvBus(Base): geom = Column(Geometry('POINT', 4326), index=True) +class EgoPfHvExtensionBus(Base): + __tablename__ = 'ego_pf_hv_extension_bus' + __table_args__ = {'schema': 'grid'} + + version = Column(Text, primary_key=True, nullable=False) + scn_name = Column(String, primary_key=True, nullable=False, server_default=text("'Status Quo'::character varying")) + bus_id = Column(BigInteger, primary_key=True, nullable=False) + v_nom = Column(Float(53)) + current_type = Column(Text, server_default=text("'AC'::text")) + v_mag_pu_min = Column(Float(53), server_default=text("0")) + v_mag_pu_max = Column(Float(53)) + geom = Column(Geometry('POINT', 4326), index=True) + project = Column(String) + + +class EgoPfHvExtensionGenerator(Base): + __tablename__ = 'ego_pf_hv_extension_generator' + __table_args__ = {'schema': 'grid'} + + version = Column(Text, primary_key=True, nullable=False) + scn_name = Column(String, primary_key=True, nullable=False) + generator_id = Column(BigInteger, primary_key=True, nullable=False) + bus = Column(BigInteger) + dispatch = Column(Text, server_default=text("'flexible'::text")) + control = Column(Text, server_default=text("'PQ'::text")) + p_nom = Column(Float(53), server_default=text("0")) + p_nom_extendable = Column(Boolean, server_default=text("false")) + p_nom_min = Column(Float(53), server_default=text("0")) + p_nom_max = Column(Float(53)) + p_min_pu_fixed = Column(Float(53), server_default=text("0")) + p_max_pu_fixed = Column(Float(53), server_default=text("1")) + sign = Column(Float(53), server_default=text("1")) + source = Column(BigInteger) + marginal_cost = Column(Float(53)) + capital_cost = Column(Float(53)) + efficiency = Column(Float(53)) + + +class EgoPfHvExtensionGeneratorPqSet(Base): + __tablename__ = 'ego_pf_hv_extension_generator_pq_set' + __table_args__ = {'schema': 'grid'} + + version = Column(Text, primary_key=True, nullable=False) + scn_name = Column(String, primary_key=True, nullable=False) + generator_id = Column(BigInteger, primary_key=True, nullable=False) + temp_id = Column(Integer, primary_key=True, nullable=False) + p_set = Column(ARRAY(Float(precision=53))) + q_set = Column(ARRAY(Float(precision=53))) + p_min_pu = Column(ARRAY(Float(precision=53))) + p_max_pu = Column(ARRAY(Float(precision=53))) + + +class EgoPfHvExtensionLine(Base): + __tablename__ = 'ego_pf_hv_extension_line' + __table_args__ = {'schema': 'grid'} + + version = Column(Text, primary_key=True, nullable=False) + scn_name = Column(String, primary_key=True, nullable=False) + line_id = Column(BigInteger, primary_key=True, nullable=False) + bus0 = Column(BigInteger) + bus1 = Column(BigInteger) + x = Column(Numeric, server_default=text("0")) + r = Column(Numeric, server_default=text("0")) + g = Column(Numeric, server_default=text("0")) + b = Column(Numeric, server_default=text("0")) + s_nom = Column(Numeric, server_default=text("0")) + s_nom_extendable = Column(Boolean, server_default=text("false")) + s_nom_min = Column(Float(53), server_default=text("0")) + s_nom_max = Column(Float(53)) + capital_cost = Column(Float(53)) + length = Column(Float(53)) + cables = Column(Integer) + frequency = Column(Numeric) + terrain_factor = Column(Float(53), server_default=text("1")) + geom = Column(Geometry('MULTILINESTRING', 4326)) + topo = Column(Geometry('LINESTRING', 4326)) + v_nom = Column(BigInteger) + project = Column(String) + project_id = Column(BigInteger) + + +class EgoPfHvExtensionLink(Base): + __tablename__ = 'ego_pf_hv_extension_link' + __table_args__ = {'schema': 'grid'} + + version = Column(Text) + scn_name = Column(String, primary_key=True, nullable=False) + link_id = Column(BigInteger, primary_key=True, nullable=False) + bus0 = Column(BigInteger) + bus1 = Column(BigInteger) + efficiency = Column(Float(53), server_default=text("1")) + marginal_cost = Column(Float(53), server_default=text("0")) + p_nom = Column(Numeric, server_default=text("0")) + p_nom_extendable = Column(Boolean, server_default=text("false")) + p_nom_min = Column(Float(53), server_default=text("0")) + p_nom_max = Column(Float(53)) + capital_cost = Column(Float(53)) + length = Column(Float(53)) + terrain_factor = Column(Float(53), server_default=text("1")) + geom = Column(Geometry('MULTILINESTRING', 4326)) + topo = Column(Geometry('LINESTRING', 4326)) + project = Column(String) + project_id = Column(BigInteger) + + +class EgoPfHvExtensionLoad(Base): + __tablename__ = 'ego_pf_hv_extension_load' + __table_args__ = {'schema': 'grid'} + + version = Column(Text, primary_key=True, nullable=False) + scn_name = Column(String, primary_key=True, nullable=False) + load_id = Column(BigInteger, primary_key=True, nullable=False) + bus = Column(BigInteger) + sign = Column(Float(53), server_default=text("'-1'::integer")) + e_annual = Column(Float(53)) + + +class EgoPfHvExtensionLoadPqSet(Base): + __tablename__ = 'ego_pf_hv_extension_load_pq_set' + __table_args__ = {'schema': 'grid'} + + version = Column(Text, primary_key=True, nullable=False) + scn_name = Column(String, primary_key=True, nullable=False) + load_id = Column(BigInteger, primary_key=True, nullable=False) + temp_id = Column(Integer, nullable=False) + p_set = Column(ARRAY(Float(precision=53))) + q_set = Column(ARRAY(Float(precision=53))) + + +class EgoPfHvExtensionSource(Base): + __tablename__ = 'ego_pf_hv_extension_source' + __table_args__ = {'schema': 'grid'} + + version = Column(Text, primary_key=True, nullable=False) + source_id = Column(BigInteger, primary_key=True, nullable=False) + name = Column(Text) + co2_emissions = Column(Float(53)) + commentary = Column(Text) + + +class EgoPfHvExtensionStorage(Base): + __tablename__ = 'ego_pf_hv_extension_storage' + __table_args__ = {'schema': 'grid'} + + version = Column(Text, primary_key=True, nullable=False) + scn_name = Column(String, primary_key=True, nullable=False) + storage_id = Column(BigInteger, primary_key=True, nullable=False) + bus = Column(BigInteger) + dispatch = Column(Text, server_default=text("'flexible'::text")) + control = Column(Text, server_default=text("'PQ'::text")) + p_nom = Column(Float(53), server_default=text("0")) + p_nom_extendable = Column(Boolean, server_default=text("false")) + p_nom_min = Column(Float(53), server_default=text("0")) + p_nom_max = Column(Float(53)) + p_min_pu_fixed = Column(Float(53), server_default=text("0")) + p_max_pu_fixed = Column(Float(53), server_default=text("1")) + sign = Column(Float(53), server_default=text("1")) + source = Column(BigInteger) + marginal_cost = Column(Float(53)) + capital_cost = Column(Float(53)) + efficiency = Column(Float(53)) + soc_initial = Column(Float(53)) + soc_cyclic = Column(Boolean, server_default=text("false")) + max_hours = Column(Float(53)) + efficiency_store = Column(Float(53)) + efficiency_dispatch = Column(Float(53)) + standing_loss = Column(Float(53)) + + +class EgoPfHvExtensionStoragePqSet(Base): + __tablename__ = 'ego_pf_hv_extension_storage_pq_set' + __table_args__ = {'schema': 'grid'} + + version = Column(Text) + scn_name = Column(String, primary_key=True, nullable=False) + storage_id = Column(BigInteger, primary_key=True, nullable=False) + temp_id = Column(Integer, primary_key=True, nullable=False) + p_set = Column(ARRAY(Float(precision=53))) + q_set = Column(ARRAY(Float(precision=53))) + p_min_pu = Column(ARRAY(Float(precision=53))) + p_max_pu = Column(ARRAY(Float(precision=53))) + soc_set = Column(ARRAY(Float(precision=53))) + inflow = Column(ARRAY(Float(precision=53))) + + +class EgoPfHvExtensionTempResolution(Base): + __tablename__ = 'ego_pf_hv_extension_temp_resolution' + __table_args__ = {'schema': 'grid'} + + version = Column(Text, primary_key=True, nullable=False) + temp_id = Column(BigInteger, primary_key=True, nullable=False) + timesteps = Column(BigInteger, nullable=False) + resolution = Column(Text) + start_time = Column(DateTime) + + +class EgoPfHvExtensionTransformer(Base): + __tablename__ = 'ego_pf_hv_extension_transformer' + __table_args__ = {'schema': 'grid'} + + version = Column(Text, primary_key=True, nullable=False) + scn_name = Column(String, primary_key=True, nullable=False) + trafo_id = Column(BigInteger, primary_key=True, nullable=False) + bus0 = Column(BigInteger) + bus1 = Column(BigInteger) + x = Column(Numeric, server_default=text("0")) + r = Column(Numeric, server_default=text("0")) + g = Column(Numeric, server_default=text("0")) + b = Column(Numeric, server_default=text("0")) + s_nom = Column(Float(53), server_default=text("0")) + s_nom_extendable = Column(Boolean, server_default=text("false")) + s_nom_min = Column(Float(53), server_default=text("0")) + s_nom_max = Column(Float(53)) + tap_ratio = Column(Float(53)) + phase_shift = Column(Float(53)) + capital_cost = Column(Float(53), server_default=text("0")) + geom = Column(Geometry('MULTILINESTRING', 4326)) + topo = Column(Geometry('LINESTRING', 4326)) + project = Column(String) + + class EgoPfHvGenerator(Base): __tablename__ = 'ego_pf_hv_generator' __table_args__ = {'schema': 'grid'} @@ -308,12 +543,12 @@ class EgoPfHvGeneratorPqSet(Base): version = Column(Text, primary_key=True, nullable=False) scn_name = Column(String, primary_key=True, nullable=False, server_default=text("'Status Quo'::character varying")) - generator_id = Column(String(25), primary_key=True, nullable=False) + generator_id = Column(Integer, primary_key=True, nullable=False) temp_id = Column(Integer, primary_key=True, nullable=False) - p_set = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - q_set = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - p_min_pu = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - p_max_pu = Column(ARRAY(DOUBLE_PRECISION(precision=53))) + p_set = Column(ARRAY(Float(precision=53))) + q_set = Column(ARRAY(Float(precision=53))) + p_min_pu = Column(ARRAY(Float(precision=53))) + p_max_pu = Column(ARRAY(Float(precision=53))) class EgoPfHvLine(Base): @@ -360,6 +595,7 @@ class EgoPfHvLink(Base): terrain_factor = Column(Float(53), server_default=text("1")) geom = Column(Geometry('MULTILINESTRING', 4326)) topo = Column(Geometry('LINESTRING', 4326)) + class EgoPfHvLoad(Base): __tablename__ = 'ego_pf_hv_load' @@ -377,19 +613,139 @@ class EgoPfHvLoadPqSet(Base): __tablename__ = 'ego_pf_hv_load_pq_set' __table_args__ = {'schema': 'grid'} - version = Column(ForeignKey('model_draft.ego_scenario.version'), primary_key=True, nullable=False) + version = Column(Text, primary_key=True, nullable=False) scn_name = Column(String, primary_key=True, nullable=False, server_default=text("'Status Quo'::character varying")) load_id = Column(BigInteger, primary_key=True, nullable=False) temp_id = Column(Integer, nullable=False) - p_set = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - q_set = Column(ARRAY(DOUBLE_PRECISION(precision=53))) + p_set = Column(ARRAY(Float(precision=53))) + q_set = Column(ARRAY(Float(precision=53))) + + +class EgoPfHvResultMeta(Base): + __tablename__ = 'ego_pf_hv_result_meta' + __table_args__ = {'schema': 'grid'} + + result_id = Column(BigInteger, primary_key=True) + modeldraft_id = Column(BigInteger, nullable=False) + scn_name = Column(String) + calc_date = Column(DateTime) + user_name = Column(String) + method = Column(String) + start_snapshot = Column(Integer) + end_snapshot = Column(Integer) + snapshots = Column(ARRAY(DateTime())) + solver = Column(String) + settings = Column(JSON) + + +class EgoPfHvSource(Base): + __tablename__ = 'ego_pf_hv_source' + __table_args__ = {'schema': 'grid'} + + version = Column(Text, primary_key=True, nullable=False) + source_id = Column(BigInteger, primary_key=True, nullable=False) + name = Column(Text) + co2_emissions = Column(Float(53)) + commentary = Column(Text) + + +class EgoPfHvStorage(Base): + __tablename__ = 'ego_pf_hv_storage' + __table_args__ = {'schema': 'grid'} + + version = Column(Text, primary_key=True, nullable=False) + scn_name = Column(String, primary_key=True, nullable=False, server_default=text("'Status Quo'::character varying")) + storage_id = Column(BigInteger, primary_key=True, nullable=False) + bus = Column(BigInteger) + dispatch = Column(Text, server_default=text("'flexible'::text")) + control = Column(Text, server_default=text("'PQ'::text")) + p_nom = Column(Float(53), server_default=text("0")) + p_nom_extendable = Column(Boolean, server_default=text("false")) + p_nom_min = Column(Float(53), server_default=text("0")) + p_nom_max = Column(Float(53)) + p_min_pu_fixed = Column(Float(53), server_default=text("0")) + p_max_pu_fixed = Column(Float(53), server_default=text("1")) + sign = Column(Float(53), server_default=text("1")) + source = Column(BigInteger) + marginal_cost = Column(Float(53)) + capital_cost = Column(Float(53)) + efficiency = Column(Float(53)) + soc_initial = Column(Float(53)) + soc_cyclic = Column(Boolean, server_default=text("false")) + max_hours = Column(Float(53)) + efficiency_store = Column(Float(53)) + efficiency_dispatch = Column(Float(53)) + standing_loss = Column(Float(53)) + + +class EgoPfHvStoragePqSet(Base): + __tablename__ = 'ego_pf_hv_storage_pq_set' + __table_args__ = {'schema': 'grid'} + + version = Column(Text, primary_key=True, nullable=False) + scn_name = Column(String, primary_key=True, nullable=False, server_default=text("'Status Quo'::character varying")) + storage_id = Column(BigInteger, primary_key=True, nullable=False) + temp_id = Column(Integer, primary_key=True, nullable=False) + p_set = Column(ARRAY(Float(precision=53))) + q_set = Column(ARRAY(Float(precision=53))) + p_min_pu = Column(ARRAY(Float(precision=53))) + p_max_pu = Column(ARRAY(Float(precision=53))) + soc_set = Column(ARRAY(Float(precision=53))) + inflow = Column(ARRAY(Float(precision=53))) + + +class EgoPfHvTempResolution(Base): + __tablename__ = 'ego_pf_hv_temp_resolution' + __table_args__ = {'schema': 'grid'} + + version = Column(Text, primary_key=True, nullable=False) + temp_id = Column(BigInteger, primary_key=True, nullable=False) + timesteps = Column(BigInteger, nullable=False) + resolution = Column(Text) + start_time = Column(DateTime) + + +class EgoPfHvTransformer(Base): + __tablename__ = 'ego_pf_hv_transformer' + __table_args__ = {'schema': 'grid'} + + version = Column(Text, primary_key=True, nullable=False) + scn_name = Column(String, primary_key=True, nullable=False, server_default=text("'Status Quo'::character varying")) + trafo_id = Column(BigInteger, primary_key=True, nullable=False) + bus0 = Column(BigInteger) + bus1 = Column(BigInteger) + x = Column(Numeric, server_default=text("0")) + r = Column(Numeric, server_default=text("0")) + g = Column(Numeric, server_default=text("0")) + b = Column(Numeric, server_default=text("0")) + s_nom = Column(Float(53), server_default=text("0")) + s_nom_extendable = Column(Boolean, server_default=text("false")) + s_nom_min = Column(Float(53), server_default=text("0")) + s_nom_max = Column(Float(53)) + tap_ratio = Column(Float(53)) + phase_shift = Column(Float(53)) + capital_cost = Column(Float(53), server_default=text("0")) + geom = Column(Geometry('MULTILINESTRING', 4326)) + topo = Column(Geometry('LINESTRING', 4326)) + + +class OtgEhvhvResultsMetadatum(Base): + __tablename__ = 'otg_ehvhv_results_metadata' + __table_args__ = {'schema': 'grid'} + + id = Column(Integer, primary_key=True) + osm_date = Column(Date) + abstraction_date = Column(Date) + applied_plans = Column(Text) + applied_year = Column(Integer) + user_comment = Column(Text) class EgoPfHvResultBus(Base): __tablename__ = 'ego_pf_hv_result_bus' __table_args__ = {'schema': 'grid'} - result_id = Column(BigInteger, primary_key=True, nullable=False) + result_id = Column(ForeignKey('grid.ego_pf_hv_result_meta.result_id'), primary_key=True, nullable=False) bus_id = Column(BigInteger, primary_key=True, nullable=False) x = Column(Float(53)) y = Column(Float(53)) @@ -397,27 +753,32 @@ class EgoPfHvResultBus(Base): current_type = Column(Text) v_mag_pu_min = Column(Float(53)) v_mag_pu_max = Column(Float(53)) - geom = Column(Geometry('POINT', 4326)) - - + geom = Column(Geometry('POINT', 4326), index=True) + + result = relationship('EgoPfHvResultMeta') + + class EgoPfHvResultBusT(Base): __tablename__ = 'ego_pf_hv_result_bus_t' __table_args__ = {'schema': 'grid'} - - result_id = Column(BigInteger, primary_key=True, nullable=False) + + result_id = Column(ForeignKey('grid.ego_pf_hv_result_meta.result_id'), primary_key=True, nullable=False) bus_id = Column(BigInteger, primary_key=True, nullable=False) - p = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - q = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - v_mag_pu = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - v_ang = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - marginal_price = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - + v_mag_pu_set = Column(ARRAY(Float(precision=53))) + p = Column(ARRAY(Float(precision=53))) + q = Column(ARRAY(Float(precision=53))) + v_mag_pu = Column(ARRAY(Float(precision=53))) + v_ang = Column(ARRAY(Float(precision=53))) + marginal_price = Column(ARRAY(Float(precision=53))) + + result = relationship('EgoPfHvResultMeta') + class EgoPfHvResultGenerator(Base): __tablename__ = 'ego_pf_hv_result_generator' __table_args__ = {'schema': 'grid'} - result_id = Column(BigInteger, primary_key=True, nullable=False) + result_id = Column(ForeignKey('grid.ego_pf_hv_result_meta.result_id'), primary_key=True, nullable=False) generator_id = Column(BigInteger, primary_key=True, nullable=False) bus = Column(BigInteger) dispatch = Column(Text) @@ -433,29 +794,33 @@ class EgoPfHvResultGenerator(Base): marginal_cost = Column(Float(53)) capital_cost = Column(Float(53)) efficiency = Column(Float(53)) - p_nom_opt= Column(Float(53)) - - + p_nom_opt = Column(Float(53)) + + result = relationship('EgoPfHvResultMeta') + + class EgoPfHvResultGeneratorT(Base): __tablename__ = 'ego_pf_hv_result_generator_t' - __table_args__ = {'schema': 'grid'} - - result_id = Column(BigInteger, primary_key=True, nullable=False) + __table_args__ = {'schema': 'grid'} + + result_id = Column(ForeignKey('grid.ego_pf_hv_result_meta.result_id'), primary_key=True, nullable=False) generator_id = Column(BigInteger, primary_key=True, nullable=False) - p_set = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - q_set = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - p_min_pu = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - p_max_pu = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - p = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - q = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - status = Column(ARRAY(BigInteger)) - + p_set = Column(ARRAY(Float(precision=53))) + q_set = Column(ARRAY(Float(precision=53))) + p_min_pu = Column(ARRAY(Float(precision=53))) + p_max_pu = Column(ARRAY(Float(precision=53))) + p = Column(ARRAY(Float(precision=53))) + q = Column(ARRAY(Float(precision=53))) + status = Column(ARRAY(BigInteger())) + + result = relationship('EgoPfHvResultMeta') + class EgoPfHvResultLine(Base): __tablename__ = 'ego_pf_hv_result_line' __table_args__ = {'schema': 'grid'} - - result_id = Column(BigInteger, primary_key=True, nullable=False) + + result_id = Column(ForeignKey('grid.ego_pf_hv_result_meta.result_id'), primary_key=True, nullable=False) line_id = Column(BigInteger, primary_key=True, nullable=False) bus0 = Column(BigInteger) bus1 = Column(BigInteger) @@ -471,7 +836,7 @@ class EgoPfHvResultLine(Base): length = Column(Float(53)) cables = Column(Integer) frequency = Column(Numeric) - terrain_factor = Column(Float(53)) + terrain_factor = Column(Float(53), server_default=text("1")) x_pu = Column(Numeric) r_pu = Column(Numeric) g_pu = Column(Numeric) @@ -479,124 +844,121 @@ class EgoPfHvResultLine(Base): s_nom_opt = Column(Numeric) geom = Column(Geometry('MULTILINESTRING', 4326)) topo = Column(Geometry('LINESTRING', 4326)) - - + + result = relationship('EgoPfHvResultMeta') + + class EgoPfHvResultLineT(Base): __tablename__ = 'ego_pf_hv_result_line_t' - __table_args__ = {'schema': 'grid'} - - result_id = Column(BigInteger, primary_key=True, nullable=False) + __table_args__ = {'schema': 'grid'} + + result_id = Column(ForeignKey('grid.ego_pf_hv_result_meta.result_id'), primary_key=True, nullable=False) line_id = Column(BigInteger, primary_key=True, nullable=False) - p0 = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - q0 = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - p1 = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - q1 = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - + p0 = Column(ARRAY(Float(precision=53))) + q0 = Column(ARRAY(Float(precision=53))) + p1 = Column(ARRAY(Float(precision=53))) + q1 = Column(ARRAY(Float(precision=53))) + + result = relationship('EgoPfHvResultMeta') + class EgoPfHvResultLoad(Base): __tablename__ = 'ego_pf_hv_result_load' - __table_args__ = {'schema': 'grid'} - - result_id = Column(BigInteger, primary_key=True, nullable=False) + __table_args__ = {'schema': 'grid'} + + result_id = Column(ForeignKey('grid.ego_pf_hv_result_meta.result_id'), primary_key=True, nullable=False) load_id = Column(BigInteger, primary_key=True, nullable=False) bus = Column(BigInteger) - sign = Column(Float(53), server_default=text("(-1)")) + sign = Column(Float(53)) e_annual = Column(Float(53)) - - + + result = relationship('EgoPfHvResultMeta') + + class EgoPfHvResultLoadT(Base): __tablename__ = 'ego_pf_hv_result_load_t' - __table_args__ = {'schema': 'grid'} - - result_id = Column(BigInteger, primary_key=True, nullable=False) - load_id = Column(BigInteger, primary_key=True, nullable=False) - p_set = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - q_set = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - p = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - q = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - - -class EgoPfHvResultMeta(Base): - __tablename__ = 'ego_pf_hv_result_meta' __table_args__ = {'schema': 'grid'} - result_id = Column(BigInteger, primary_key=True, nullable=False) - scn_name = Column(String) - calc_date = Column(DateTime) - user_name = Column(Text) - method = Column(String) - start_snapshot = Column(Integer) - end_snapshot = Column(Integer) - snapshots = Column(ARRAY(DateTime)) - solver = Column(String) - settings = Column(JSON) + result_id = Column(ForeignKey('grid.ego_pf_hv_result_meta.result_id'), primary_key=True, nullable=False) + load_id = Column(BigInteger, primary_key=True, nullable=False) + p_set = Column(ARRAY(Float(precision=53))) + q_set = Column(ARRAY(Float(precision=53))) + p = Column(ARRAY(Float(precision=53))) + q = Column(ARRAY(Float(precision=53))) + + result = relationship('EgoPfHvResultMeta') + class EgoPfHvResultStorage(Base): __tablename__ = 'ego_pf_hv_result_storage' __table_args__ = {'schema': 'grid'} - result_id = Column(BigInteger, primary_key=True, nullable=False) + result_id = Column(ForeignKey('grid.ego_pf_hv_result_meta.result_id'), primary_key=True, nullable=False) storage_id = Column(BigInteger, primary_key=True, nullable=False) bus = Column(BigInteger) dispatch = Column(Text) control = Column(Text) - p_nom = Column(Float(53), server_default=text("0")) - p_nom_extendable = Column(Boolean, server_default=text("false")) - p_nom_min = Column(Float(53), server_default=text("0")) + p_nom = Column(Float(53)) + p_nom_extendable = Column(Boolean) + p_nom_min = Column(Float(53)) p_nom_max = Column(Float(53)) - p_min_pu_fixed = Column(Float(53), server_default=text("0")) - p_max_pu_fixed = Column(Float(53), server_default=text("1")) - sign = Column(Float(53), server_default=text("1")) - source = Column(ForeignKey('grid.ego_pf_hv_source.source_id'), index=True) + p_min_pu_fixed = Column(Float(53)) + p_max_pu_fixed = Column(Float(53)) + sign = Column(Float(53)) + source = Column(BigInteger) marginal_cost = Column(Float(53)) capital_cost = Column(Float(53)) efficiency = Column(Float(53)) soc_initial = Column(Float(53)) - soc_cyclic = Column(Boolean) + soc_cyclic = Column(Boolean, server_default=text("false")) max_hours = Column(Float(53)) efficiency_store = Column(Float(53)) efficiency_dispatch = Column(Float(53)) standing_loss = Column(Float(53)) p_nom_opt = Column(Float(53)) + result = relationship('EgoPfHvResultMeta') + class EgoPfHvResultStorageT(Base): __tablename__ = 'ego_pf_hv_result_storage_t' __table_args__ = {'schema': 'grid'} - - result_id = Column(BigInteger, primary_key=True, nullable=False) + + result_id = Column(ForeignKey('grid.ego_pf_hv_result_meta.result_id'), primary_key=True, nullable=False) storage_id = Column(BigInteger, primary_key=True, nullable=False) - p_set = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - q_set = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - p_min_pu = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - p_max_pu = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - soc_set = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - inflow = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - p = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - q = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - state_of_charge = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - spill = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - + p_set = Column(ARRAY(Float(precision=53))) + q_set = Column(ARRAY(Float(precision=53))) + p_min_pu = Column(ARRAY(Float(precision=53))) + p_max_pu = Column(ARRAY(Float(precision=53))) + soc_set = Column(ARRAY(Float(precision=53))) + inflow = Column(ARRAY(Float(precision=53))) + p = Column(ARRAY(Float(precision=53))) + q = Column(ARRAY(Float(precision=53))) + state_of_charge = Column(ARRAY(Float(precision=53))) + spill = Column(ARRAY(Float(precision=53))) + + result = relationship('EgoPfHvResultMeta') + class EgoPfHvResultTransformer(Base): __tablename__ = 'ego_pf_hv_result_transformer' __table_args__ = {'schema': 'grid'} - result_id = Column(BigInteger, primary_key=True, nullable=False) + result_id = Column(ForeignKey('grid.ego_pf_hv_result_meta.result_id'), primary_key=True, nullable=False) trafo_id = Column(BigInteger, primary_key=True, nullable=False) - bus0 = Column(BigInteger, index=True) - bus1 = Column(BigInteger, index=True) - x = Column(Numeric, server_default=text("0")) - r = Column(Numeric, server_default=text("0")) - g = Column(Numeric, server_default=text("0")) - b = Column(Numeric, server_default=text("0")) - s_nom = Column(Float(53), server_default=text("0")) - s_nom_extendable = Column(Boolean, server_default=text("false")) - s_nom_min = Column(Float(53), server_default=text("0")) + bus0 = Column(BigInteger) + bus1 = Column(BigInteger) + x = Column(Numeric) + r = Column(Numeric) + g = Column(Numeric) + b = Column(Numeric) + s_nom = Column(Numeric) + s_nom_extendable = Column(Boolean) + s_nom_min = Column(Float(53)) s_nom_max = Column(Float(53)) tap_ratio = Column(Float(53)) phase_shift = Column(Float(53)) - capital_cost = Column(Float(53), server_default=text("0")) + capital_cost = Column(Float(53)) x_pu = Column(Numeric) r_pu = Column(Numeric) g_pu = Column(Numeric) @@ -605,108 +967,21 @@ class EgoPfHvResultTransformer(Base): geom = Column(Geometry('MULTILINESTRING', 4326)) topo = Column(Geometry('LINESTRING', 4326)) + result = relationship('EgoPfHvResultMeta') + class EgoPfHvResultTransformerT(Base): __tablename__ = 'ego_pf_hv_result_transformer_t' __table_args__ = {'schema': 'grid'} - - result_id = Column(BigInteger, primary_key=True, nullable=False) - trafo_id = Column(BigInteger, primary_key=True, nullable=False) - p0 = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - q0 = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - p1 = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - q1 = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - - -class EgoPfHvSource(Base): - __tablename__ = 'ego_pf_hv_source' - __table_args__ = {'schema': 'grid'} - - version = Column(Text, primary_key=True, nullable=False) - source_id = Column(BigInteger, primary_key=True, nullable=False) - name = Column(Text) - co2_emissions = Column(Float(53)) - commentary = Column(Text) - - -class EgoPfHvStorage(Base): - __tablename__ = 'ego_pf_hv_storage' - __table_args__ = {'schema': 'grid'} - - version = Column(Text, primary_key=True, nullable=False) - scn_name = Column(String, primary_key=True, nullable=False, server_default=text("'Status Quo'::character varying")) - storage_id = Column(BigInteger, primary_key=True, nullable=False) - bus = Column(BigInteger) - dispatch = Column(Text, server_default=text("'flexible'::text")) - control = Column(Text, server_default=text("'PQ'::text")) - p_nom = Column(Float(53), server_default=text("0")) - p_nom_extendable = Column(Boolean, server_default=text("false")) - p_nom_min = Column(Float(53), server_default=text("0")) - p_nom_max = Column(Float(53)) - p_min_pu_fixed = Column(Float(53), server_default=text("0")) - p_max_pu_fixed = Column(Float(53), server_default=text("1")) - sign = Column(Float(53), server_default=text("1")) - source = Column(BigInteger) - marginal_cost = Column(Float(53)) - capital_cost = Column(Float(53)) - efficiency = Column(Float(53)) - soc_initial = Column(Float(53)) - soc_cyclic = Column(Boolean, server_default=text("false")) - max_hours = Column(Float(53)) - efficiency_store = Column(Float(53)) - efficiency_dispatch = Column(Float(53)) - standing_loss = Column(Float(53)) - -class EgoPfHvStoragePqSet(Base): - __tablename__ = 'ego_pf_hv_storage_pq_set' - __table_args__ = {'schema': 'grid'} - - version = Column(Text, primary_key=True, nullable=False) - scn_name = Column(String, primary_key=True, nullable=False, server_default=text("'Status Quo'::character varying")) - storage_id = Column(BigInteger, primary_key=True, nullable=False) - temp_id = Column(Integer, primary_key=True, nullable=False) - p_set = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - q_set = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - p_min_pu = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - p_max_pu = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - soc_set = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - inflow = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - - -class EgoPfHvTempResolution(Base): - __tablename__ = 'ego_pf_hv_temp_resolution' - __table_args__ = {'schema': 'grid'} - - version = Column(Text, primary_key=True, nullable=False) - temp_id = Column(BigInteger, primary_key=True, nullable=False) - timesteps = Column(BigInteger, nullable=False) - resolution = Column(Text) - start_time = Column(DateTime) - - -class EgoPfHvTransformer(Base): - __tablename__ = 'ego_pf_hv_transformer' - __table_args__ = {'schema': 'grid'} - - version = Column(Text, primary_key=True, nullable=False) - scn_name = Column(String, primary_key=True, nullable=False, server_default=text("'Status Quo'::character varying")) + result_id = Column(ForeignKey('grid.ego_pf_hv_result_meta.result_id'), primary_key=True, nullable=False) trafo_id = Column(BigInteger, primary_key=True, nullable=False) - bus0 = Column(BigInteger) - bus1 = Column(BigInteger) - x = Column(Numeric, server_default=text("0")) - r = Column(Numeric, server_default=text("0")) - g = Column(Numeric, server_default=text("0")) - b = Column(Numeric, server_default=text("0")) - s_nom = Column(Float(53), server_default=text("0")) - s_nom_extendable = Column(Boolean, server_default=text("false")) - s_nom_min = Column(Float(53), server_default=text("0")) - s_nom_max = Column(Float(53)) - tap_ratio = Column(Float(53)) - phase_shift = Column(Float(53)) - capital_cost = Column(Float(53), server_default=text("0")) - geom = Column(Geometry('MULTILINESTRING', 4326)) - topo = Column(Geometry('LINESTRING', 4326)) + p0 = Column(ARRAY(Float(precision=53))) + q0 = Column(ARRAY(Float(precision=53))) + p1 = Column(ARRAY(Float(precision=53))) + q1 = Column(ARRAY(Float(precision=53))) + + result = relationship('EgoPfHvResultMeta') class OtgEhvhvBranchDatum(Base): @@ -797,26 +1072,3 @@ class OtgEhvhvDclineDatum(Base): topo = Column(Geometry('LINESTRING', 4326)) result = relationship('OtgEhvhvResultsMetadatum') - - -class OtgEhvhvResultsMetadatum(Base): - __tablename__ = 'otg_ehvhv_results_metadata' - __table_args__ = {'schema': 'grid'} - - id = Column(Integer, primary_key=True) - osm_date = Column(Date) - abstraction_date = Column(Date) - applied_plans = Column(Text) - applied_year = Column(Integer) - user_comment = Column(Text) - - -class EgoScenario(Base): - __tablename__ = 'ego_scenario' - __table_args__ = {'schema': 'model_draft'} - - version = Column(Text, primary_key=True) - version_name = Column(Text) - release = Column(Boolean) - comment = Column(Text) - timestamp = Column(DateTime) diff --git a/egoio/db_tables/model_draft.py b/egoio/db_tables/model_draft.py index befd48b..3b88d0b 100644 --- a/egoio/db_tables/model_draft.py +++ b/egoio/db_tables/model_draft.py @@ -1,12 +1,10 @@ # coding: utf-8 -from sqlalchemy import ARRAY, BigInteger, Boolean, CheckConstraint, Column, Date, DateTime, Float, ForeignKey, ForeignKeyConstraint, Index, Integer, JSON, Numeric, SmallInteger, String, Table, Text, UniqueConstraint, text +from sqlalchemy import ARRAY, BigInteger, Boolean, CHAR, CheckConstraint, Column, Date, DateTime, Float, ForeignKey, ForeignKeyConstraint, Index, Integer, JSON, Numeric, SmallInteger, String, Table, Text, UniqueConstraint, text from geoalchemy2.types import Geometry, Raster -from sqlalchemy.orm import relationship from sqlalchemy.dialects.postgresql.hstore import HSTORE from sqlalchemy.dialects.postgresql.base import OID +from sqlalchemy.orm import relationship from sqlalchemy.ext.declarative import declarative_base -from sqlalchemy.dialects.postgresql import ARRAY, DOUBLE_PRECISION, INTEGER, NUMERIC, TEXT, BIGINT, TIMESTAMP, VARCHAR - Base = declarative_base() metadata = Base.metadata @@ -92,6 +90,144 @@ class BkgVg250201601011Sta(Base): debkg_id = Column(String(16)) +class BnetzaEegAnlagenstammdaten(Base): + __tablename__ = 'bnetza_eeg_anlagenstammdaten' + __table_args__ = {'schema': 'model_draft'} + + id = Column(Integer, primary_key=True, server_default=text("nextval('model_draft.bnetza_eeg_anlagenstammdaten_registerdaten_id_seq'::regclass)")) + geom = Column(Geometry('POINT', 5652), index=True) + Meldedatum = Column(String) + Meldegrund = Column(String) + Anlagennummer = Column(String) + _1_8_EEG_Anlagenschlüssel = Column('1.8 EEG-Anlagenschl\xfcssel', String) + _3_1_Genehmigungs_datum = Column('3.1 Genehmigungs-datum', String) + _3_2_Genehmigungs_behörde = Column('3.2 Genehmigungs-beh\xf6rde', String) + _3_3_Genehmigungs_Aktenzeichen = Column('3.3 Genehmigungs-Aktenzeichen', String) + _3_4_Geplantes_Inbetriebnahme_datum = Column('3.4 Geplantes Inbetriebnahme-datum', String) + _3_5_Errichtungs_frist = Column('3.5 Errichtungs-frist', String) + _4_1_Energieträger = Column('4.1 Energietr\xe4ger', String) + _4_2_Installierte_Leistung__kW_ = Column('4.2 Installierte Leistung [kW]', String) + _4_2_1_Inst__Leistung_vor_Leistungs_änderung__ohne_Flexprämie_ = Column('4.2.1 Inst. Leistung vor Leistungs-\xe4nderung (ohne Flexpr\xe4mie)', String) + _4_2_2_Inst__Leistung_nach_Leistungs_änderung__ohne_Flexprämie = Column('4.2.2 Inst. Leistung nach Leistungs-\xe4nderung (ohne Flexpr\xe4mie', String) + _4_3_Tatsächliche_Inbetrieb_nahme = Column('4.3 Tats\xe4chliche Inbetrieb-nahme', String) + _4_4_Datum_Leistungs_änderung = Column('4.4 Datum Leistungs-\xe4nderung', String) + _4_5_Stilllegungs_datum = Column('4.5 Stilllegungs-datum', String) + _4_6_Name_der_Anlage = Column('4.6 Name der Anlage', String) + _4_7_Strasse_bzw__Flurstück = Column('4.7 Strasse bzw. Flurst\xfcck', String) + _4_8_Haus_nummer = Column('4.8 Haus-nummer', String) + _4_9_Postleit_zahl = Column('4.9 Postleit-zahl', String) + _4_10_Ort_bzw__Gemarkung = Column('4.10 Ort bzw. Gemarkung', String) + Gemeinde_schlüssel = Column('Gemeinde-schl\xfcssel', String) + _4_11_Bundesland = Column('4.11 Bundesland', String) + UTM_Zonenwert = Column('UTM-Zonenwert', Integer) + UTM_East = Column('UTM-East', Float(53)) + UTM_North = Column('UTM-North', Float(53)) + _4_13_Zugehörigkeit_Anlagenpark = Column('4.13 Zugeh\xf6rigkeit Anlagenpark', String) + _4_13_1__Name_des_Anlagenparks = Column('4.13.1 Name des Anlagenparks', String) + _4_14_Spannungsebene = Column('4.14 Spannungsebene', String) + _4_15_Netzanschlusspunkt = Column('4.15 Netzanschlusspunkt', String) + Zählpunktbezeichnung = Column(String) + _4_16_Name_des_Netzbetreibers = Column('4.16 Name des Netzbetreibers', String) + _4_17_Fernsteuerbarkeit_durch_ = Column('4.17 Fernsteuerbarkeit durch:', String) + _4_18_Gemeinsame_techn__Einrichtung = Column('4.18 Gemeinsame techn. Einrichtung', String) + _4_19_Inanspruchnahme_finanzielle_Förderung = Column('4.19 Inanspruchnahme finanzielle F\xf6rderung', String) + _4_20_Eigenverbrauch_geplant = Column('4.20 Eigenverbrauch geplant', String) + _5_1_Eingesetzte_Biomasse = Column('5.1 Eingesetzte Biomasse', String) + _5_2_Ausschließlich_Biomasse = Column('5.2 Ausschlie\xdflich Biomasse', String) + _5_3_Flexprämie = Column('5.3 Flexpr\xe4mie', String) + _5_4_Erstmalige_Inanspruchnahme_Flexprämie = Column('5.4 Erstmalige Inanspruchnahme Flexpr\xe4mie', String) + _5_4_1_Leistungserhöhung_Flexprämie = Column('5.4.1 Leistungserh\xf6hung Flexpr\xe4mie', String) + _5_4_2_Datum_Leistungserhöhung_Flexprämie = Column('5.4.2 Datum Leistungserh\xf6hung Flexpr\xe4mie', String) + _5_4_3_Umfang_der_Leistungserhöhung__kW_ = Column('5.4.3 Umfang der Leistungserh\xf6hung [kW]', String) + _5_5_Erstmalig_ausschließlich_Biomethan = Column('5.5 Erstmalig ausschlie\xdflich Biomethan', String) + _5_6__5_8_in_alter_Version__Zustimmung_gesonderte_Veröffentlich = Column('5.6 (5.8 in alter Version) Zustimmung gesonderte Ver\xf6ffentlich', String) + _6_1_KWK_Anlage = Column('6.1 KWK-Anlage', String) + _6_2_Thermische_Leistung__kW_ = Column('6.2 Thermische Leistung [kW]', String) + _6_3_Andere_Energieträger_vor_01_08_2014 = Column('6.3 Andere Energietr\xe4ger vor 01.08.2014', String) + _6_4_Eingesetzte_andere_Energieträger_vor_01_08_2014 = Column('6.4 Eingesetzte andere Energietr\xe4ger vor 01.08.2014', String) + _6_5_Erstmalige_Stromerzeugung = Column('6.5 Erstmalige Stromerzeugung', String) + _7_1_Windanlagenhersteller = Column('7.1 Windanlagenhersteller', String) + _7_2_Anlagentyp = Column('7.2 Anlagentyp', String) + _7_3_Nabenhöhe__m_ = Column('7.3 Nabenh\xf6he [m]', Float(53)) + _7_4_Rotordurch_messer__m_ = Column('7.4 Rotordurch-messer [m]', Float(53)) + _7_5_Repowering = Column('7.5 Repowering', String) + _7_6_Stilllegung_gemeldet = Column('7.6 Stilllegung gemeldet', String) + _7_7_1_Mittlere_Windge_schwindigkeit__m_s_ = Column('7.7.1 Mittlere Windge-schwindigkeit [m/s]', Float(53)) + _7_7_2_Formparameter_Weibull_Verteilung = Column('7.7.2 Formparameter Weibull-Verteilung', Float(53)) + _7_7_3_Skalenparameter_Weibull_Verteilung = Column('7.7.3 Skalenparameter Weibull-Verteilung', Float(53)) + _7_7_4_Ertrags_einschätzung__kWh_ = Column('7.7.4 Ertrags-einsch\xe4tzung [kWh]', Float(53)) + _7_7_5_Ertragseinschätzung_Referenzertrag____ = Column('7.7.5 Ertragseinsch\xe4tzung/Referenzertrag [%]', Float(53)) + _7_8_1_Seelage = Column('7.8.1 Seelage', String) + _7_8_2_Wassertiefe__m_ = Column('7.8.2 Wassertiefe [m]', Float(53)) + _7_8_3_Küstenentfernung__km_ = Column('7.8.3 K\xfcstenentfernung [km]', Float(53)) + _7_9_Pilotwindanlage = Column('7.9 Pilotwindanlage', String) + _8_1_Ertüchtigung_Wasserkraftanlage = Column('8.1 Ert\xfcchtigung Wasserkraftanlage', String) + _8_2_Art_der_Ertüchtigung = Column('8.2 Art der Ert\xfcchtigung', String) + _8_3_Zulassungspflichtige_Maßnahme = Column('8.3 Zulassungspflichtige Ma\xdfnahme', String) + _8_4__HöheLeistungs_steigerung____ = Column('8.4. H\xf6heLeistungs-steigerung [%]', Float(53)) + _8_5_Datum_der_Ertüchtigung = Column('8.5 Datum der Ert\xfcchtigung', String) + _9_1_Zuschlagnummer_PV_Freifläche = Column('9.1 Zuschlagnummer PV-Freifl\xe4che', String) + _9_2_Wie_viel_Fläche_wird_durch_die_PV_Freiflächenanlage_in_An = Column('9.2 Wie viel Fl\xe4che wird durch die PV-Freifl\xe4chenanlage in An', Float(53)) + _9_3_Wie_viel_der_PV_Freifläche_ist_davon_Ackerland___ha_ = Column('9.3 Wie viel der PV-Freifl\xe4che ist davon Ackerland? [ha]', Float(53)) + + +class BnetzaEegAnlagenstammdatenWindClassification(Base): + __tablename__ = 'bnetza_eeg_anlagenstammdaten_wind_classification' + __table_args__ = {'schema': 'model_draft'} + + id = Column(Integer, primary_key=True) + version = Column(Text) + meldegrund = Column(Text) + anlagennummer = Column(String(14)) + _1_8_eeg_anlagenschlüssel = Column('1.8_eeg-anlagenschl\xfcssel', Text) + _4_2_installierte_leistung = Column('4.2_installierte_leistung', Float(53)) + _7_1_windanlagenhersteller = Column('7.1_windanlagenhersteller', Text) + _7_2_anlagentyp = Column('7.2_anlagentyp', Text) + _7_3_nabenhöhe = Column('7.3_nabenh\xf6he', Float(53)) + _7_4_rotordurch_messer = Column('7.4_rotordurch-messer', Float(53)) + _7_5_repowering = Column('7.5_repowering', Text) + _7_6_stilllegung_gemeldet = Column('7.6_stilllegung_gemeldet', Text) + _7_7_1_mittlere_windgeschwindigkeit = Column('7.7.1_mittlere_windgeschwindigkeit', Float(53)) + _7_7_2_formparameter_weibull_verteilung = Column('7.7.2_formparameter_weibull-verteilung', Float(53)) + _7_7_3_skalenparameter_weibull_verteilung = Column('7.7.3_skalenparameter_weibull-verteilung', Float(53)) + _7_7_4_ertrags_einschätzung = Column('7.7.4_ertrags-einsch\xe4tzung', Float(53)) + _7_7_5_ertragseinschätzung_referenzertrag = Column('7.7.5_ertragseinsch\xe4tzung/referenzertrag', Float(53)) + _7_8_1_seelage = Column('7.8.1_seelage', Text) + _7_8_2_wassertiefe = Column('7.8.2_wassertiefe', Text) + _7_8_3_küstenentfernung = Column('7.8.3_k\xfcstenentfernung', Text) + _7_9_pilotwindanlage = Column('7.9_pilotwindanlage', Text) + wea_manufacturer = Column(Text) + wea_power_class = Column(Float(53)) + wea_power_revised = Column(Float(53)) + wea_rotor_area = Column(Float(53)) + wea_specific_power = Column(Float(53)) + wea_type = Column(Text) + wea_type_comment = Column(Text) + geom = Column(Geometry('POINT', 3035), index=True) + + +class BnetzaEegAnlagenstammdatenWindLttc(Base): + __tablename__ = 'bnetza_eeg_anlagenstammdaten_wind_lttc' + __table_args__ = {'schema': 'model_draft'} + + lttc_id = Column(Integer, primary_key=True, server_default=text("nextval('model_draft.bnetza_eeg_anlagenstammdaten_wind_lttc_lttc_id_seq'::regclass)")) + version = Column(Text) + wea_count = Column(Integer) + lttc_power_sum = Column(Float(53)) + lttc_area_ha = Column(Float(53)) + wea_manufacturer = Column(Text) + wea_power_class = Column(Float(53)) + wea_power_avg = Column(Float(53)) + wea_hubhight_avg = Column(Float(53)) + wea_rotor_avg = Column(Float(53)) + wea_rotor_area_avg = Column(Float(53)) + wea_specific_power = Column(Float(53)) + wea_type = Column(Text) + wea_group = Column(Text) + geom_centroid = Column(Geometry('POINT', 3035), index=True) + geom = Column(Geometry('POLYGON', 3035), index=True) + + class BuergenDistrictLandUse(Base): __tablename__ = 'buergen_district_land_use' __table_args__ = {'schema': 'model_draft'} @@ -174,15 +310,6 @@ class BuergenGeoMunicipality(Base): id = Column(BigInteger, primary_key=True, server_default=text("nextval('model_draft.buergen_geo_municipality_id_seq'::regclass)")) -class BuergenGeoTest(Base): - __tablename__ = 'buergen_geo_test' - __table_args__ = {'schema': 'model_draft'} - - region_key = Column(String(50)) - geom = Column(Geometry('MULTIPOLYGON')) - id = Column(BigInteger, primary_key=True, server_default=text("nextval('model_draft.buergen_geo_test_id_seq'::regclass)")) - - class BuergenGridexpIfcEnergyTransitionDistrict(Base): __tablename__ = 'buergen_gridexp_ifc_energy_transition_district' __table_args__ = {'schema': 'model_draft'} @@ -311,14 +438,6 @@ class BuergenGridexpnIfpStakeholderRegionalLvl(Base): id = Column(BigInteger, primary_key=True, server_default=text("nextval('model_draft.buergen_gridexpn_ifp_stakeholder_regional_lvl_id_seq'::regclass)")) -class BuergenTest2(Base): - __tablename__ = 'buergen_test2' - __table_args__ = {'schema': 'model_draft'} - - id = Column(BigInteger, primary_key=True, server_default=text("nextval('model_draft.buergen_test2_id_seq'::regclass)")) - name = Column(String(50)) - - class BuergenWindexpnSocialAcceptanceAnalysisDistrict(Base): __tablename__ = 'buergen_windexpn_social_acceptance_analysis_district' __table_args__ = {'schema': 'model_draft'} @@ -354,6 +473,102 @@ class BuergenWindexpnSocialAcceptanceAnalysisMunicipality(Base): id = Column(BigInteger, primary_key=True, server_default=text("nextval('model_draft.buergen_windexpn_social_acceptance_analysis_municipality_id_seq'::regclass)")) +t_corr_mv_bus_results = Table( + 'corr_mv_bus_results', metadata, + Column('name', Text), + Column('control', Text), + Column('type', Text), + Column('v_nom', Float(53)), + Column('v', ARRAY(Float(precision=53))), + Column('mv_grid', Integer), + Column('result_id', Integer), + Column('geom', Geometry('POINT', 4326)), + Column('v_ang', ARRAY(Float(precision=53))), + Column('p', ARRAY(Float(precision=53))), + Column('q', ARRAY(Float(precision=53))), + schema='model_draft' +) + + +t_corr_mv_lines_results = Table( + 'corr_mv_lines_results', metadata, + Column('name', Text), + Column('bus0', Text), + Column('bus1', Text), + Column('s_nom', Float(53)), + Column('s', ARRAY(Float(precision=53))), + Column('v_nom', Float(53)), + Column('mv_grid', Integer), + Column('result_id', Integer), + Column('geom', Geometry('LINESTRING', 4326)), + Column('x', Float(53)), + Column('r', Float(53)), + Column('length', Float(53)), + schema='model_draft' +) + + +class CorrVisHvBus(Base): + __tablename__ = 'corr_vis_hv_bus' + __table_args__ = {'schema': 'model_draft'} + + bus_id = Column(BigInteger) + v_nom = Column(Float(53)) + geom = Column(Geometry('POINT', 4326)) + vis_id = Column(Integer, primary_key=True, server_default=text("nextval('model_draft.corr_vis_hv_bus_vis_id_seq'::regclass)")) + + +class CorrVisHvLine(Base): + __tablename__ = 'corr_vis_hv_lines' + __table_args__ = {'schema': 'model_draft'} + + line_id = Column(BigInteger) + v_nom = Column(Float(53)) + s_nom = Column(Numeric) + topo = Column(Geometry('LINESTRING', 4326)) + cables = Column(Integer) + bus0 = Column(BigInteger) + bus1 = Column(BigInteger) + result_id = Column(BigInteger) + s_rel_max = Column(Float(53)) + rel_time_over = Column(Float(53)) + s_rel = Column(Float(53)) + snapshot = Column(Integer) + vis_id = Column(Integer, primary_key=True, server_default=text("nextval('model_draft.corr_vis_hv_lines_vis_id_seq'::regclass)")) + max_srel = Column(Float(53)) + + +class CorrVisMvBus(Base): + __tablename__ = 'corr_vis_mv_bus' + __table_args__ = {'schema': 'model_draft'} + + name = Column(Text) + type = Column(Text) + v_nom = Column(Float(53)) + mv_grid = Column(Integer) + geom = Column(Geometry('POINT', 4326)) + result_id = Column(Integer) + vis_id = Column(Integer, primary_key=True, server_default=text("nextval('model_draft.corr_vis_mv_bus_vis_id_seq'::regclass)")) + + +class CorrVisMvLine(Base): + __tablename__ = 'corr_vis_mv_lines' + __table_args__ = {'schema': 'model_draft'} + + name = Column(Text) + v_nom = Column(Float(53)) + s_nom = Column(Float(53)) + mv_grid = Column(Integer) + geom = Column(Geometry('LINESTRING', 4326)) + result_id = Column(Integer) + s_rel_max = Column(Float(53)) + rel_time_over = Column(Float(53)) + s_rel = Column(Float(53)) + snapshot = Column(Integer) + vis_id = Column(Integer, primary_key=True, server_default=text("nextval('model_draft.corr_vis_mv_lines_vis_id_seq'::regclass)")) + max_srel = Column(Float(53)) + + class DataTypeTest(Base): __tablename__ = 'data_type_tests' __table_args__ = {'schema': 'model_draft'} @@ -431,7 +646,7 @@ class EgoBoundariesBkgVg2506GemClean(Base): ags_0 = Column(String(12)) area_ha = Column(Numeric) count_hole = Column(Integer) - path = Column(ARRAY(INTEGER())) + path = Column(ARRAY(Integer())) is_hole = Column(Boolean) geom = Column(Geometry('POLYGON', 3035), index=True) @@ -450,7 +665,7 @@ class EgoBoundariesHvmvSubstPerGem(Base): ags_0 = Column(String(12)) area_ha = Column(Numeric) count_hole = Column(Integer) - path = Column(ARRAY(INTEGER())) + path = Column(ARRAY(Integer())) is_hole = Column(Boolean) geom = Column(Geometry('POLYGON', 3035), index=True) subst_sum = Column(Integer) @@ -555,6 +770,7 @@ class EgoDataProcessingResult(Base): __table_args__ = {'schema': 'model_draft'} id = Column(Integer, primary_key=True, server_default=text("nextval('model_draft.ego_data_processing_results_id_seq'::regclass)")) + version = Column(Text) schema_name = Column(Text) table_name = Column(Text) description = Column(Text) @@ -584,7 +800,7 @@ class EgoDataProcessingResultsMvgd(Base): geom = Column(Geometry('MULTIPOLYGON', 3035), index=True) timestamp = Column(DateTime) compound = Column(Text) - group = Column(String(1)) + group = Column(CHAR(1)) consumption = Column(Numeric) consumption_per_area = Column(Numeric) @@ -991,8 +1207,8 @@ class EgoDemandHvmvDemand(Base): __table_args__ = {'schema': 'model_draft'} id = Column(Integer, primary_key=True, server_default=text("nextval('model_draft.ego_demand_hvmv_demand_id_seq'::regclass)")) - p_set = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - q_set = Column(ARRAY(DOUBLE_PRECISION(precision=53))) + p_set = Column(ARRAY(Float(precision=53))) + q_set = Column(ARRAY(Float(precision=53))) class EgoDemandLaBufferbug(Base): @@ -1064,6 +1280,14 @@ class EgoDemandLoadMelt(Base): geom = Column(Geometry('POLYGON', 3035), index=True) +class EgoDemandLoadMelt99(Base): + __tablename__ = 'ego_demand_load_melt_99' + __table_args__ = {'schema': 'model_draft'} + + id = Column(Integer, primary_key=True, server_default=text("nextval('model_draft.ego_demand_load_melt_99_id_seq'::regclass)")) + geom = Column(Geometry('POLYGON', 3035), index=True) + + t_ego_demand_load_melt_error_2_geom_mview = Table( 'ego_demand_load_melt_error_2_geom_mview', metadata, Column('id', Integer, unique=True), @@ -1324,22 +1548,6 @@ class EgoDemandPerGva(Base): ) -class EgoDemandPfLoadSingle(Base): - __tablename__ = 'ego_demand_pf_load_single' - __table_args__ = ( - ForeignKeyConstraint(['bus', 'scn_name'], ['model_draft.ego_grid_pf_hv_bus.bus_id', 'model_draft.ego_grid_pf_hv_bus.scn_name']), - {'schema': 'model_draft'} - ) - - scn_name = Column(String, nullable=False, server_default=text("'Status Quo'::character varying")) - load_id = Column(BigInteger, primary_key=True) - bus = Column(BigInteger) - sign = Column(Float(53), server_default=text("'-1'::integer")) - e_annual = Column(Float(53)) - - ego_grid_pf_hv_bu = relationship('EgoGridPfHvBus') - - class EgoDeuLoadsOsm(Base): __tablename__ = 'ego_deu_loads_osm' __table_args__ = {'schema': 'model_draft'} @@ -1455,53 +1663,6 @@ class EgoDpSupplyConvPowerplant(Base): nuts = Column(String) -class EgoDpSupplyConvPowerplantV030pre1(Base): - __tablename__ = 'ego_dp_supply_conv_powerplant_v030pre1' - __table_args__ = {'schema': 'model_draft'} - - preversion = Column(Text, primary_key=True, nullable=False) - id = Column(Integer, primary_key=True, nullable=False) - bnetza_id = Column(Text) - company = Column(Text) - name = Column(Text) - postcode = Column(Text) - city = Column(Text) - street = Column(Text) - state = Column(Text) - block = Column(Text) - commissioned_original = Column(Text) - commissioned = Column(Float(53)) - retrofit = Column(Float(53)) - shutdown = Column(Float(53)) - status = Column(Text) - fuel = Column(Text) - technology = Column(Text) - type = Column(Text) - eeg = Column(Text) - chp = Column(Text) - capacity = Column(Float(53)) - capacity_uba = Column(Float(53)) - chp_capacity_uba = Column(Float(53)) - efficiency_data = Column(Float(53)) - efficiency_estimate = Column(Float(53)) - network_node = Column(Text) - voltage = Column(Text) - network_operator = Column(Text) - name_uba = Column(Text) - lat = Column(Float(53)) - lon = Column(Float(53)) - comment = Column(Text) - geom = Column(Geometry('POINT', 4326), index=True) - voltage_level = Column(SmallInteger) - subst_id = Column(BigInteger) - otg_id = Column(BigInteger) - un_id = Column(BigInteger) - la_id = Column(Integer) - scenario = Column(Text, primary_key=True, nullable=False) - flag = Column(Text) - nuts = Column(String) - - class EgoDpSupplyResPowerplant(Base): __tablename__ = 'ego_dp_supply_res_powerplant' __table_args__ = {'schema': 'model_draft'} @@ -1539,12 +1700,13 @@ class EgoDpSupplyResPowerplant(Base): scenario = Column(String, primary_key=True, nullable=False) flag = Column(String) nuts = Column(String) + w_id = Column(BigInteger) la_id = Column(Integer) mvlv_subst_id = Column(Integer) rea_sort = Column(Integer) rea_flag = Column(String) rea_geom_line = Column(Geometry('LINESTRING', 3035)) - rea_geom_new = Column(Geometry('POINT', 3035)) + rea_geom_new = Column(Geometry('POINT', 3035), index=True) t_ego_dp_supply_res_powerplant_out_mview = Table( @@ -1582,6 +1744,7 @@ class EgoDpSupplyResPowerplant(Base): Column('scenario', String), Column('flag', String), Column('nuts', String), + Column('w_id', BigInteger), Column('la_id', Integer), Column('mvlv_subst_id', Integer), Column('rea_sort', Integer), @@ -1592,75 +1755,6 @@ class EgoDpSupplyResPowerplant(Base): ) -class EgoDpSupplyResPowerplantV030pre1(Base): - __tablename__ = 'ego_dp_supply_res_powerplant_v030pre1' - __table_args__ = {'schema': 'model_draft'} - - preversion = Column(Text, primary_key=True, nullable=False) - id = Column(BigInteger, primary_key=True, nullable=False) - start_up_date = Column(DateTime) - electrical_capacity = Column(Numeric) - generation_type = Column(Text) - generation_subtype = Column(String) - thermal_capacity = Column(Numeric) - city = Column(String) - postcode = Column(String) - address = Column(String) - lon = Column(Numeric) - lat = Column(Numeric) - gps_accuracy = Column(String) - validation = Column(String) - notification_reason = Column(String) - eeg_id = Column(String) - tso = Column(Float(53)) - tso_eic = Column(String) - dso_id = Column(String) - dso = Column(String) - voltage_level_var = Column(String) - network_node = Column(String) - power_plant_id = Column(String) - source = Column(String) - comment = Column(String) - geom = Column(Geometry('POINT', 4326), index=True) - subst_id = Column(BigInteger) - otg_id = Column(BigInteger) - un_id = Column(BigInteger) - voltage_level = Column(SmallInteger) - scenario = Column(String, primary_key=True, nullable=False) - flag = Column(String) - nuts = Column(String) - la_id = Column(Integer) - mvlv_subst_id = Column(Integer) - rea_sort = Column(Integer) - rea_flag = Column(String) - rea_geom_line = Column(Geometry('LINESTRING', 3035)) - rea_geom_new = Column(Geometry('POINT', 3035)) - - -class EgoEhvSubstation(Base): - __tablename__ = 'ego_ehv_substation' - __table_args__ = {'schema': 'model_draft'} - - version = Column(Text, primary_key=True, nullable=False) - subst_id = Column(Integer, primary_key=True, nullable=False, server_default=text("nextval('model_draft.ego_ehv_substation_subst_id_seq'::regclass)")) - lon = Column(Float(53), nullable=False) - lat = Column(Float(53), nullable=False) - point = Column(Geometry('POINT', 4326), nullable=False) - polygon = Column(Geometry, nullable=False) - voltage = Column(Text) - power_type = Column(Text) - substation = Column(Text) - osm_id = Column(Text, nullable=False) - osm_www = Column(Text, nullable=False) - frequency = Column(Text) - subst_name = Column(Text) - ref = Column(Text) - operator = Column(Text) - dbahn = Column(Text) - status = Column(SmallInteger, nullable=False) - otg_id = Column(BigInteger) - - class EgoGridEhvSubstation(Base): __tablename__ = 'ego_grid_ehv_substation' __table_args__ = {'schema': 'model_draft'} @@ -1692,19 +1786,19 @@ class EgoGridEhvSubstationVoronoi(EgoGridEhvSubstation): subst_id = Column(ForeignKey('model_draft.ego_grid_ehv_substation.subst_id'), primary_key=True) -class EgoGridHvElectricalNeighboursBus(Base): - __tablename__ = 'ego_grid_hv_electrical_neighbours_bus' - __table_args__ = {'schema': 'model_draft'} - - scn_name = Column(String, primary_key=True, nullable=False, server_default=text("'Status Quo'::character varying")) - bus_id = Column(BigInteger, primary_key=True, nullable=False) - v_nom = Column(Float(53)) - id = Column(BigInteger, nullable=False) - cntr_id = Column(Text) - current_type = Column(Text, server_default=text("'AC'::text")) - v_mag_pu_min = Column(Float(53), server_default=text("0")) - v_mag_pu_max = Column(Float(53)) - geom = Column(Geometry('POINT', 4326)) +t_ego_grid_hv_electrical_neighbours_bus = Table( + 'ego_grid_hv_electrical_neighbours_bus', metadata, + Column('scn_name', String, nullable=False, server_default=text("'Status Quo'::character varying")), + Column('bus_id', BigInteger), + Column('central_bus', Boolean, server_default=text("false")), + Column('v_nom', Float(53)), + Column('cntr_id', Text), + Column('current_type', Text, server_default=text("'AC'::text")), + Column('v_mag_pu_min', Float(53), server_default=text("0")), + Column('v_mag_pu_max', Float(53)), + Column('geom', Geometry('POINT', 4326)), + schema='model_draft' +) class EgoGridHvElectricalNeighboursLine(Base): @@ -1715,7 +1809,8 @@ class EgoGridHvElectricalNeighboursLine(Base): line_id = Column(BigInteger, primary_key=True, nullable=False) bus0 = Column(BigInteger) bus1 = Column(BigInteger) - cntr_id = Column(Text) + cntr_id_1 = Column(Text) + cntr_id_2 = Column(Text) v_nom = Column(BigInteger) x = Column(Numeric, server_default=text("0")) r = Column(Numeric, server_default=text("0")) @@ -1734,6 +1829,31 @@ class EgoGridHvElectricalNeighboursLine(Base): topo = Column(Geometry('LINESTRING', 4326)) +t_ego_grid_hv_electrical_neighbours_link = Table( + 'ego_grid_hv_electrical_neighbours_link', metadata, + Column('scn_name', String, nullable=False, server_default=text("'Status Quo'::character varying")), + Column('link_id', BigInteger, nullable=False), + Column('bus0', BigInteger), + Column('bus1', BigInteger), + Column('cntr_id_1', String), + Column('cntr_id_2', String), + Column('v_nom', BigInteger), + Column('efficiency', Float(53), server_default=text("1")), + Column('p_nom', Numeric, server_default=text("0")), + Column('p_nom_extendable', Boolean, server_default=text("false")), + Column('p_nom_min', Float(53), server_default=text("0")), + Column('p_min_pu', Float(53)), + Column('p_max_pu', Float(53)), + Column('p_nom_max', Float(53)), + Column('capital_cost', Float(53)), + Column('length', Float(53)), + Column('terrain_factor', Float(53), server_default=text("1")), + Column('geom', Geometry('MULTILINESTRING', 4326)), + Column('topo', Geometry('LINESTRING', 4326)), + schema='model_draft' +) + + class EgoGridHvElectricalNeighboursTransformer(Base): __tablename__ = 'ego_grid_hv_electrical_neighbours_transformer' __table_args__ = {'schema': 'model_draft'} @@ -1755,7 +1875,10 @@ class EgoGridHvElectricalNeighboursTransformer(Base): phase_shift = Column(Float(53)) capital_cost = Column(Float(53), server_default=text("0")) geom = Column(Geometry('MULTILINESTRING', 4326)) + geom_point = Column(Geometry('POINT', 4326)) topo = Column(Geometry('LINESTRING', 4326)) + v1 = Column(Float(53), server_default=text("0")) + v2 = Column(Float(53), server_default=text("0")) s1 = Column(Float(53), server_default=text("0")) s2 = Column(Float(53), server_default=text("0")) s_min = Column(Float(53), server_default=text("0")) @@ -1916,6 +2039,41 @@ class EgoGridHvmvSubstationVoronoiCutNnCollect(Base): ) +class EgoGridLine(Base): + __tablename__ = 'ego_grid_line' + __table_args__ = {'schema': 'model_draft'} + + id = Column(Integer, primary_key=True, server_default=text("nextval('model_draft.ego_grid_line_id_seq'::regclass)")) + run_id = Column(BigInteger) + edge_name = Column(String(20)) + grid_id_db = Column(String(30)) + node1 = Column(String(40)) + node2 = Column(String(40)) + type_kind = Column(String(20)) + type_name = Column(String(30)) + length = Column(Float) + U_n = Column(Float) + C = Column(Float) + L = Column(Float) + R = Column(Float) + I_max_th = Column(Float) + + +class EgoGridLineExpansionCost(Base): + __tablename__ = 'ego_grid_line_expansion_costs' + __table_args__ = {'schema': 'model_draft'} + + cost_id = Column(BigInteger, primary_key=True) + voltage_level = Column(Text) + component = Column(Text) + measure = Column(Text) + investment_cost = Column(Float(53)) + unit = Column(Text) + comment = Column(Text) + source = Column(Text) + capital_costs_pypsa = Column(Float(53)) + + class EgoGridLvBuildingConn(Base): __tablename__ = 'ego_grid_lv_building_conn' __table_args__ = {'schema': 'model_draft'} @@ -2180,7 +2338,7 @@ class EgoGridMvGriddistrict(Base): type2_cnt = Column(Integer) type3 = Column(Integer) type3_cnt = Column(Integer) - group = Column(String(1)) + group = Column(CHAR(1)) gem = Column(Integer) gem_clean = Column(Integer) zensus_sum = Column(Integer) @@ -2214,7 +2372,7 @@ class EgoGridMvGriddistrict(Base): Column('type2_cnt', Integer), Column('type3', Integer), Column('type3_cnt', Integer), - Column('group', String(1)), + Column('group', CHAR(1)), Column('gem', Integer), Column('gem_clean', Integer), Column('zensus_sum', Integer), @@ -2250,7 +2408,7 @@ class EgoGridMvGriddistrict(Base): Column('type2_cnt', Integer), Column('type3', Integer), Column('type3_cnt', Integer), - Column('group', String(1)), + Column('group', CHAR(1)), Column('gem', Integer), Column('gem_clean', Integer), Column('zensus_sum', Integer), @@ -2604,16 +2762,17 @@ class EgoGridPfHvBus(Base): geom = Column(Geometry('POINT', 4326)) -class EgoGridPfHvBusVMagSet(Base): - __tablename__ = 'ego_grid_pf_hv_bus_v_mag_set' +class EgoGridPfHvBusV030(Base): + __tablename__ = 'ego_grid_pf_hv_bus_v030' __table_args__ = {'schema': 'model_draft'} scn_name = Column(String, primary_key=True, nullable=False, server_default=text("'Status Quo'::character varying")) bus_id = Column(BigInteger, primary_key=True, nullable=False) - temp_id = Column(ForeignKey('model_draft.ego_grid_pf_hv_temp_resolution.temp_id'), primary_key=True, nullable=False) - v_mag_pu_set = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - - temp = relationship('EgoGridPfHvTempResolution') + v_nom = Column(Float(53)) + current_type = Column(Text, server_default=text("'AC'::text")) + v_mag_pu_min = Column(Float(53), server_default=text("0")) + v_mag_pu_max = Column(Float(53)) + geom = Column(Geometry('POINT', 4326)) class EgoGridPfHvBusmap(Base): @@ -2626,12 +2785,104 @@ class EgoGridPfHvBusmap(Base): path_length = Column(Numeric) -class EgoGridPfHvGenerator(Base): - __tablename__ = 'ego_grid_pf_hv_generator' +t_ego_grid_pf_hv_extension_bus = Table( + 'ego_grid_pf_hv_extension_bus', metadata, + Column('scn_name', String, nullable=False, server_default=text("'extension_nep2035_confirmed'::character varying")), + Column('bus_id', BigInteger, nullable=False), + Column('v_nom', Float(53)), + Column('current_type', Text, server_default=text("'AC'::text")), + Column('v_mag_pu_min', Float(53), server_default=text("0")), + Column('v_mag_pu_max', Float(53)), + Column('geom', Geometry('POINT', 4326)), + Column('project', String), + Column('bus_name', String), + schema='model_draft' +) + + +t_ego_grid_pf_hv_extension_line = Table( + 'ego_grid_pf_hv_extension_line', metadata, + Column('scn_name', String, nullable=False, server_default=text("'extension_nep2035_confirmed'::character varying")), + Column('line_id', BigInteger, nullable=False), + Column('bus0', BigInteger), + Column('bus1', BigInteger), + Column('x', Numeric, server_default=text("0")), + Column('r', Numeric, server_default=text("0")), + Column('g', Numeric, server_default=text("0")), + Column('b', Numeric, server_default=text("0")), + Column('s_nom', Numeric, server_default=text("0")), + Column('s_nom_extendable', Boolean, server_default=text("false")), + Column('s_nom_min', Float(53), server_default=text("0")), + Column('s_nom_max', Float(53)), + Column('capital_cost', Float(53)), + Column('length', Float(53)), + Column('cables', Integer), + Column('frequency', Numeric), + Column('terrain_factor', Float(53), server_default=text("1")), + Column('geom', Geometry('MULTILINESTRING', 4326)), + Column('topo', Geometry('LINESTRING', 4326)), + Column('v_nom', BigInteger), + Column('project', String), + Column('project_id', BigInteger), + Column('segment', BigInteger), + Column('cable', Boolean, server_default=text("false")), + Column('nova', String), + schema='model_draft' +) + + +class EgoGridPfHvExtensionLink(Base): + __tablename__ = 'ego_grid_pf_hv_extension_link' + __table_args__ = {'schema': 'model_draft'} + + scn_name = Column(String, primary_key=True, nullable=False, server_default=text("'extension_nep2035_confirmed'::character varying")) + link_id = Column(BigInteger, primary_key=True, nullable=False) + bus0 = Column(BigInteger) + bus1 = Column(BigInteger) + efficiency = Column(Float(53), server_default=text("1")) + p_nom = Column(Numeric, server_default=text("0")) + p_nom_extendable = Column(Boolean, server_default=text("false")) + p_nom_min = Column(Float(53), server_default=text("0")) + p_nom_max = Column(Float(53)) + capital_cost = Column(Float(53)) + marginal_cost = Column(Float(53)) + length = Column(Float(53)) + terrain_factor = Column(Float(53), server_default=text("1")) + geom = Column(Geometry('MULTILINESTRING', 4326)) + topo = Column(Geometry('LINESTRING', 4326)) + project = Column(Text) + project_id = Column(BigInteger) + segment = Column(String) + v_nom = Column(BigInteger) + + +class EgoGridPfHvExtensionLoad(Base): + __tablename__ = 'ego_grid_pf_hv_extension_load' + __table_args__ = {'schema': 'model_draft'} + + scn_name = Column(String, primary_key=True, nullable=False, server_default=text("'BE and NO'::character varying")) + load_id = Column(BigInteger, primary_key=True, nullable=False) + bus = Column(BigInteger) + sign = Column(Float(53), server_default=text("'-1'::integer")) + e_annual = Column(Float(53)) + + +t_ego_grid_pf_hv_extension_source = Table( + 'ego_grid_pf_hv_extension_source', metadata, + Column('source_id', BigInteger), + Column('name', Text), + Column('co2_emissions', Float(53)), + Column('commentary', Text), + schema='model_draft' +) + + +class EgoGridPfHvExtensionStorage(Base): + __tablename__ = 'ego_grid_pf_hv_extension_storage' __table_args__ = {'schema': 'model_draft'} scn_name = Column(String, primary_key=True, nullable=False, server_default=text("'Status Quo'::character varying")) - generator_id = Column(BigInteger, primary_key=True, nullable=False) + storage_id = Column(BigInteger, primary_key=True, nullable=False) bus = Column(BigInteger) dispatch = Column(Text, server_default=text("'flexible'::text")) control = Column(Text, server_default=text("'PQ'::text")) @@ -2642,89 +2893,87 @@ class EgoGridPfHvGenerator(Base): p_min_pu_fixed = Column(Float(53), server_default=text("0")) p_max_pu_fixed = Column(Float(53), server_default=text("1")) sign = Column(Float(53), server_default=text("1")) - source = Column(ForeignKey('model_draft.ego_grid_pf_hv_source.source_id'), index=True) + source = Column(BigInteger) marginal_cost = Column(Float(53)) capital_cost = Column(Float(53)) efficiency = Column(Float(53)) - - ego_grid_pf_hv_source = relationship('EgoGridPfHvSource') + soc_initial = Column(Float(53)) + soc_cyclic = Column(Boolean, server_default=text("false")) + max_hours = Column(Float(53)) + efficiency_store = Column(Float(53)) + efficiency_dispatch = Column(Float(53)) + standing_loss = Column(Float(53)) -class EgoGridPfHvGeneratorPqSet(Base): - __tablename__ = 'ego_grid_pf_hv_generator_pq_set' +class EgoGridPfHvExtensionStoragePqSet(Base): + __tablename__ = 'ego_grid_pf_hv_extension_storage_pq_set' __table_args__ = {'schema': 'model_draft'} scn_name = Column(String, primary_key=True, nullable=False, server_default=text("'Status Quo'::character varying")) - generator_id = Column(BigInteger, primary_key=True, nullable=False) - temp_id = Column(ForeignKey('model_draft.ego_grid_pf_hv_temp_resolution.temp_id'), primary_key=True, nullable=False) - p_set = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - q_set = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - p_min_pu = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - p_max_pu = Column(ARRAY(DOUBLE_PRECISION(precision=53))) + storage_id = Column(BigInteger, primary_key=True, nullable=False) + temp_id = Column(Integer, primary_key=True, nullable=False) + p_set = Column(ARRAY(Float(precision=53))) + q_set = Column(ARRAY(Float(precision=53))) + p_min_pu = Column(ARRAY(Float(precision=53))) + p_max_pu = Column(ARRAY(Float(precision=53))) + soc_set = Column(ARRAY(Float(precision=53))) + inflow = Column(ARRAY(Float(precision=53))) - temp = relationship('EgoGridPfHvTempResolution') +t_ego_grid_pf_hv_extension_temp_resolution = Table( + 'ego_grid_pf_hv_extension_temp_resolution', metadata, + Column('temp_id', BigInteger), + Column('timesteps', BigInteger), + Column('resolution', Text), + Column('start_time', DateTime), + schema='model_draft' +) -class EgoGridPfHvLine(Base): - __tablename__ = 'ego_grid_pf_hv_line' + +class EgoGridPfHvExtensionTransformer(Base): + __tablename__ = 'ego_grid_pf_hv_extension_transformer' __table_args__ = {'schema': 'model_draft'} - scn_name = Column(String, primary_key=True, nullable=False, server_default=text("'Status Quo'::character varying")) - line_id = Column(BigInteger, primary_key=True, nullable=False) + scn_name = Column(String, primary_key=True, nullable=False, server_default=text("'extension_nep2035_confirmed'::character varying")) + trafo_id = Column(BigInteger, primary_key=True, nullable=False) bus0 = Column(BigInteger) bus1 = Column(BigInteger) x = Column(Numeric, server_default=text("0")) r = Column(Numeric, server_default=text("0")) g = Column(Numeric, server_default=text("0")) b = Column(Numeric, server_default=text("0")) - s_nom = Column(Numeric, server_default=text("0")) + s_nom = Column(Float(53), server_default=text("0")) s_nom_extendable = Column(Boolean, server_default=text("false")) s_nom_min = Column(Float(53), server_default=text("0")) s_nom_max = Column(Float(53)) - capital_cost = Column(Float(53)) - length = Column(Float(53)) - cables = Column(Integer) - frequency = Column(Numeric) - terrain_factor = Column(Float(53), server_default=text("1")) + tap_ratio = Column(Float(53)) + phase_shift = Column(Float(53)) + capital_cost = Column(Float(53), server_default=text("0")) geom = Column(Geometry('MULTILINESTRING', 4326)) topo = Column(Geometry('LINESTRING', 4326)) - -class EgoGridPfHvLink(Base): - __tablename__ = 'ego_grid_pf_hv_link' + project = Column(String) + v0 = Column(Float(53), server_default=text("0")) + v1 = Column(Float(53), server_default=text("0")) + s0 = Column(Float(53), server_default=text("0")) + s1 = Column(Float(53), server_default=text("0")) + s_min = Column(Float(53), server_default=text("0")) + + +class EgoGridPfHvGeneratorPqSetV030(Base): + __tablename__ = 'ego_grid_pf_hv_generator_pq_set_v030' __table_args__ = {'schema': 'model_draft'} scn_name = Column(String, primary_key=True, nullable=False, server_default=text("'Status Quo'::character varying")) - link_id = Column(BigInteger, primary_key=True, nullable=False) - bus0 = Column(BigInteger) - bus1 = Column(BigInteger) - efficiency = Column(Float(53)) - marginal_cost = Column(Float(53), server_default=text("0")) - p_nom = Column(Numeric, server_default=text("0")) - p_nom_extendable = Column(Boolean, server_default=text("false")) - p_nom_min = Column(Float(53), server_default=text("0")) - p_nom_max = Column(Float(53)) - capital_cost = Column(Float(53)) - length = Column(Float(53)) - terrain_factor = Column(Float(53), server_default=text("1")) - geom = Column(Geometry('MULTILINESTRING', 4326)) - topo = Column(Geometry('LINESTRING', 4326)) - + generator_id = Column(BigInteger, primary_key=True, nullable=False) + temp_id = Column(Integer, primary_key=True, nullable=False) + p_set = Column(ARRAY(Float(precision=53))) + q_set = Column(ARRAY(Float(precision=53))) + p_min_pu = Column(ARRAY(Float(precision=53))) + p_max_pu = Column(ARRAY(Float(precision=53))) -class EgoGridPfHvExtensionBus(Base): - __tablename__ = 'ego_grid_pf_hv_extension_bus' - __table_args__ = {'schema': 'model_draft'} - scn_name = Column(String, primary_key=True, nullable=False, server_default=text("'NEP'::character varying")) - bus_id = Column(BigInteger, primary_key=True, nullable=False) - v_nom = Column(Float(53)) - current_type = Column(Text, server_default=text("'AC'::text")) - v_mag_pu_min = Column(Float(53), server_default=text("0")) - v_mag_pu_max = Column(Float(53)) - geom = Column(Geometry('POINT', 4326)) - - -class EgoGridPfHvExtensionGenerator(Base): - __tablename__ = 'ego_grid_pf_hv_extension_generator' +class EgoGridPfHvGeneratorV030(Base): + __tablename__ = 'ego_grid_pf_hv_generator_v030' __table_args__ = {'schema': 'model_draft'} scn_name = Column(String, primary_key=True, nullable=False, server_default=text("'Status Quo'::character varying")) @@ -2739,32 +2988,42 @@ class EgoGridPfHvExtensionGenerator(Base): p_min_pu_fixed = Column(Float(53), server_default=text("0")) p_max_pu_fixed = Column(Float(53), server_default=text("1")) sign = Column(Float(53), server_default=text("1")) - source = Column(ForeignKey('model_draft.ego_grid_pf_hv_source.source_id'), index=True) + source = Column(BigInteger) marginal_cost = Column(Float(53)) capital_cost = Column(Float(53)) efficiency = Column(Float(53)) - ego_grid_pf_hv_source = relationship('EgoGridPfHvSource') -class EgoGridPfHvExtensionGeneratorPqSet(Base): - __tablename__ = 'ego_grid_pf_hv_extension_generator_pq_set' +class EgoGridPfHvLine(Base): + __tablename__ = 'ego_grid_pf_hv_line' __table_args__ = {'schema': 'model_draft'} - scn_name = Column(String, primary_key=True, nullable=False, server_default=text("'NEP'::character varying")) - generator_id = Column(BigInteger, primary_key=True, nullable=False) - temp_id = Column(ForeignKey('model_draft.ego_grid_pf_hv_temp_resolution.temp_id'), primary_key=True, nullable=False) - p_set = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - q_set = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - p_min_pu = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - p_max_pu = Column(ARRAY(DOUBLE_PRECISION(precision=53))) + scn_name = Column(String, primary_key=True, nullable=False, server_default=text("'Status Quo'::character varying")) + line_id = Column(BigInteger, primary_key=True, nullable=False) + bus0 = Column(BigInteger) + bus1 = Column(BigInteger) + x = Column(Numeric, server_default=text("0")) + r = Column(Numeric, server_default=text("0")) + g = Column(Numeric, server_default=text("0")) + b = Column(Numeric, server_default=text("0")) + s_nom = Column(Numeric, server_default=text("0")) + s_nom_extendable = Column(Boolean, server_default=text("false")) + s_nom_min = Column(Float(53), server_default=text("0")) + s_nom_max = Column(Float(53)) + capital_cost = Column(Float(53)) + length = Column(Float(53)) + cables = Column(Integer) + frequency = Column(Numeric) + terrain_factor = Column(Float(53), server_default=text("1")) + geom = Column(Geometry('MULTILINESTRING', 4326)) + topo = Column(Geometry('LINESTRING', 4326)) - temp = relationship('EgoGridPfHvTempResolution') -class EgoGridPfHvExtensionLine(Base): - __tablename__ = 'ego_grid_pf_hv_extension_line' +class EgoGridPfHvLineV030(Base): + __tablename__ = 'ego_grid_pf_hv_line_v030' __table_args__ = {'schema': 'model_draft'} - scn_name = Column(String, primary_key=True, nullable=False, server_default=text("'NEP'::character varying")) + scn_name = Column(String, primary_key=True, nullable=False, server_default=text("'Status Quo'::character varying")) line_id = Column(BigInteger, primary_key=True, nullable=False) bus0 = Column(BigInteger) bus1 = Column(BigInteger) @@ -2783,20 +3042,18 @@ class EgoGridPfHvExtensionLine(Base): terrain_factor = Column(Float(53), server_default=text("1")) geom = Column(Geometry('MULTILINESTRING', 4326)) topo = Column(Geometry('LINESTRING', 4326)) - v_nom = Column(BigInteger) - project = Column(String) - project_id = Column(BigInteger) - - -class EgoGridPfHvExtensionLink(Base): - __tablename__ = 'ego_grid_pf_hv_extension_link' + + +class EgoGridPfHvLink(Base): + __tablename__ = 'ego_grid_pf_hv_link' __table_args__ = {'schema': 'model_draft'} - scn_name = Column(String, primary_key=True, nullable=False, server_default=text("'NEP'::character varying")) + scn_name = Column(String, primary_key=True, nullable=False, server_default=text("'Status Quo'::character varying")) link_id = Column(BigInteger, primary_key=True, nullable=False) bus0 = Column(BigInteger) bus1 = Column(BigInteger) - efficiency = Column(Float(53)) + efficiency = Column(Float(53), server_default=text("1")) + marginal_cost = Column(Float(53), server_default=text("0")) p_nom = Column(Numeric, server_default=text("0")) p_nom_extendable = Column(Boolean, server_default=text("false")) p_nom_min = Column(Float(53), server_default=text("0")) @@ -2808,172 +3065,124 @@ class EgoGridPfHvExtensionLink(Base): topo = Column(Geometry('LINESTRING', 4326)) -class EgoGridPfHvExtensionLoad(Base): - __tablename__ = 'ego_grid_pf_hv_extension_load' +class EgoGridPfHvLinkV030(Base): + __tablename__ = 'ego_grid_pf_hv_link_v030' + __table_args__ = {'schema': 'model_draft'} + + scn_name = Column(String, primary_key=True, nullable=False, server_default=text("'Status Quo'::character varying")) + link_id = Column(BigInteger, primary_key=True, nullable=False) + bus0 = Column(BigInteger) + bus1 = Column(BigInteger) + efficiency = Column(Float(53), server_default=text("1")) + marginal_cost = Column(Float(53), server_default=text("0")) + p_nom = Column(Numeric, server_default=text("0")) + p_nom_extendable = Column(Boolean, server_default=text("false")) + p_nom_min = Column(Float(53), server_default=text("0")) + p_nom_max = Column(Float(53)) + capital_cost = Column(Float(53)) + length = Column(Float(53)) + terrain_factor = Column(Float(53), server_default=text("1")) + geom = Column(Geometry('MULTILINESTRING', 4326)) + topo = Column(Geometry('LINESTRING', 4326)) + + +class EgoGridPfHvLoad(Base): + __tablename__ = 'ego_grid_pf_hv_load' __table_args__ = {'schema': 'model_draft'} - scn_name = Column(String, primary_key=True, nullable=False, server_default=text("'NEP'::character varying")) + scn_name = Column(String, primary_key=True, nullable=False, server_default=text("'Status Quo'::character varying")) load_id = Column(BigInteger, primary_key=True, nullable=False) bus = Column(BigInteger) sign = Column(Float(53), server_default=text("'-1'::integer")) e_annual = Column(Float(53)) -class EgoGridPfHvExtensionLoadPqSet(Base): - __tablename__ = 'ego_grid_pf_hv_extension_load_pq_set' + +class EgoGridPfHvLoadPqSetV030(Base): + __tablename__ = 'ego_grid_pf_hv_load_pq_set_v030' __table_args__ = {'schema': 'model_draft'} - scn_name = Column(String, primary_key=True, nullable=False, server_default=text("'NEP'::character varying")) + scn_name = Column(String, primary_key=True, nullable=False, server_default=text("'Status Quo'::character varying")) load_id = Column(BigInteger, primary_key=True, nullable=False) - temp_id = Column(ForeignKey('model_draft.ego_grid_pf_hv_temp_resolution.temp_id'), primary_key=True, nullable=False) - p_set = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - q_set = Column(ARRAY(DOUBLE_PRECISION(precision=53))) + temp_id = Column(Integer, primary_key=True, nullable=False) + p_set = Column(ARRAY(Float(precision=53))) + q_set = Column(ARRAY(Float(precision=53))) - temp = relationship('EgoGridPfHvTempResolution') -class EgoGridPfHvExtensionSource(Base): - __tablename__ = 'ego_grid_pf_hv_extension_source' +class EgoGridPfHvLoadV030(Base): + __tablename__ = 'ego_grid_pf_hv_load_v030' __table_args__ = {'schema': 'model_draft'} - source_id = Column(BigInteger, primary_key=True) - name = Column(Text) - co2_emissions = Column(Float(53)) - commentary = Column(Text) + scn_name = Column(String, primary_key=True, nullable=False, server_default=text("'Status Quo'::character varying")) + load_id = Column(BigInteger, primary_key=True, nullable=False) + bus = Column(BigInteger) + sign = Column(Float(53), server_default=text("'-1'::integer")) + e_annual = Column(Float(53)) -class EgoGridPfHvExtensionStorage(Base): - __tablename__ = 'ego_grid_pf_hv_extension_storage' +t_ego_grid_pf_hv_nep2035_bus = Table( + 'ego_grid_pf_hv_nep2035_bus', metadata, + Column('scn_name', String, nullable=False, server_default=text("'Exogene Netzszenarien'::character varying")), + Column('bus_id', BigInteger, nullable=False), + Column('v_nom', Float(53)), + Column('current_type', Text, server_default=text("'AC'::text")), + Column('v_mag_pu_min', Float(53), server_default=text("0")), + Column('v_mag_pu_max', Float(53)), + Column('geom', Geometry('POINT', 4326)), + schema='model_draft' +) + + +class EgoGridPfHvNep2035Link(Base): + __tablename__ = 'ego_grid_pf_hv_nep2035_link' __table_args__ = {'schema': 'model_draft'} - scn_name = Column(String, primary_key=True, nullable=False, server_default=text("'NEP'::character varying")) - storage_id = Column(BigInteger, primary_key=True, nullable=False) - bus = Column(BigInteger) - dispatch = Column(Text, server_default=text("'flexible'::text")) - control = Column(Text, server_default=text("'PQ'::text")) - p_nom = Column(Float(53), server_default=text("0")) + scn_name = Column(String, primary_key=True, nullable=False, server_default=text("'Exogene Netzszenarien'::character varying")) + link_id = Column(BigInteger, primary_key=True, nullable=False) + bus0 = Column(BigInteger) + bus1 = Column(BigInteger) + efficency = Column(BigInteger, server_default=text("1")) + p_nom = Column(Numeric, server_default=text("0")) p_nom_extendable = Column(Boolean, server_default=text("false")) p_nom_min = Column(Float(53), server_default=text("0")) p_nom_max = Column(Float(53)) - p_min_pu_fixed = Column(Float(53), server_default=text("0")) - p_max_pu_fixed = Column(Float(53), server_default=text("1")) - sign = Column(Float(53), server_default=text("1")) - source = Column(ForeignKey('model_draft.ego_grid_pf_hv_source.source_id'), index=True) - marginal_cost = Column(Float(53)) capital_cost = Column(Float(53)) - efficiency = Column(Float(53)) - soc_initial = Column(Float(53)) - soc_cyclic = Column(Boolean, server_default=text("false")) - max_hours = Column(Float(53)) - efficiency_store = Column(Float(53)) - efficiency_dispatch = Column(Float(53)) - standing_loss = Column(Float(53)) + length = Column(Float(53)) + terrain_factor = Column(Float(53), server_default=text("1")) + geom = Column(Geometry('MULTILINESTRING', 4326)) + topo = Column(Geometry('LINESTRING', 4326)) - ego_grid_pf_hv_source = relationship('EgoGridPfHvSource') -class EgoGridPfHvExtensionStoragePqSet(Base): - __tablename__ = 'ego_grid_pf_hv_extension_storage_pq_set' +class EgoGridPfHvResultBus(Base): + __tablename__ = 'ego_grid_pf_hv_result_bus' __table_args__ = {'schema': 'model_draft'} - scn_name = Column(String, primary_key=True, nullable=False, server_default=text("'NEP'::character varying")) - storage_id = Column(BigInteger, primary_key=True, nullable=False) - temp_id = Column(ForeignKey('model_draft.ego_grid_pf_hv_temp_resolution.temp_id'), primary_key=True, nullable=False) - p_set = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - q_set = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - p_min_pu = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - p_max_pu = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - soc_set = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - inflow = Column(ARRAY(DOUBLE_PRECISION(precision=53))) + result_id = Column(BigInteger, primary_key=True, nullable=False) + bus_id = Column(BigInteger, primary_key=True, nullable=False) + x = Column(Float(53)) + y = Column(Float(53)) + v_nom = Column(Float(53)) + current_type = Column(Text) + v_mag_pu_min = Column(Float(53)) + v_mag_pu_max = Column(Float(53)) + geom = Column(Geometry('POINT', 4326)) - temp = relationship('EgoGridPfHvTempResolution') - -class EgoGridPfHvExtensionTempResolution(Base): - __tablename__ = 'ego_grid_pf_hv_extension_temp_resolution' + +class EgoGridPfHvResultBusT(Base): + __tablename__ = 'ego_grid_pf_hv_result_bus_t' __table_args__ = {'schema': 'model_draft'} - temp_id = Column(BigInteger, primary_key=True) - timesteps = Column(BigInteger, nullable=False) - resolution = Column(Text) - start_time = Column(DateTime) + result_id = Column(BigInteger, primary_key=True, nullable=False) + bus_id = Column(BigInteger, primary_key=True, nullable=False) + v_mag_pu_set = Column(ARRAY(Float(precision=53))) + p = Column(ARRAY(Float(precision=53))) + q = Column(ARRAY(Float(precision=53))) + v_mag_pu = Column(ARRAY(Float(precision=53))) + v_ang = Column(ARRAY(Float(precision=53))) + marginal_price = Column(ARRAY(Float(precision=53))) -class EgoGridPfHvExtensionTransformer(Base): - __tablename__ = 'ego_grid_pf_hv_extension_transformer' - __table_args__ = {'schema': 'model_draft'} - - scn_name = Column(String, primary_key=True, nullable=False, server_default=text("'NEP'::character varying")) - trafo_id = Column(BigInteger, primary_key=True, nullable=False) - bus0 = Column(BigInteger, index=True) - bus1 = Column(BigInteger, index=True) - x = Column(Numeric, server_default=text("0")) - r = Column(Numeric, server_default=text("0")) - g = Column(Numeric, server_default=text("0")) - b = Column(Numeric, server_default=text("0")) - s_nom = Column(Float(53), server_default=text("0")) - s_nom_extendable = Column(Boolean, server_default=text("false")) - s_nom_min = Column(Float(53), server_default=text("0")) - s_nom_max = Column(Float(53)) - tap_ratio = Column(Float(53)) - phase_shift = Column(Float(53)) - capital_cost = Column(Float(53), server_default=text("0")) - geom = Column(Geometry('MULTILINESTRING', 4326)) - topo = Column(Geometry('LINESTRING', 4326)) - project = Column(String) - - -class EgoGridPfHvLoad(Base): - __tablename__ = 'ego_grid_pf_hv_load' - __table_args__ = {'schema': 'model_draft'} - - scn_name = Column(String, primary_key=True, nullable=False, server_default=text("'Status Quo'::character varying")) - load_id = Column(BigInteger, primary_key=True, nullable=False) - bus = Column(BigInteger) - sign = Column(Float(53), server_default=text("'-1'::integer")) - e_annual = Column(Float(53)) - - -class EgoGridPfHvLoadPqSet(Base): - __tablename__ = 'ego_grid_pf_hv_load_pq_set' - __table_args__ = {'schema': 'model_draft'} - - scn_name = Column(String, primary_key=True, nullable=False, server_default=text("'Status Quo'::character varying")) - load_id = Column(BigInteger, primary_key=True, nullable=False) - temp_id = Column(ForeignKey('model_draft.ego_grid_pf_hv_temp_resolution.temp_id'), primary_key=True, nullable=False) - p_set = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - q_set = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - - temp = relationship('EgoGridPfHvTempResolution') - - -class EgoGridPfHvResultBus(Base): - __tablename__ = 'ego_grid_pf_hv_result_bus' - __table_args__ = {'schema': 'model_draft'} - - result_id = Column(BigInteger, primary_key=True, nullable=False) - bus_id = Column(BigInteger, primary_key=True, nullable=False) - x = Column(Float(53)) - y = Column(Float(53)) - v_nom = Column(Float(53)) - current_type = Column(Text) - v_mag_pu_min = Column(Float(53)) - v_mag_pu_max = Column(Float(53)) - geom = Column(Geometry('POINT', 4326)) - - -class EgoGridPfHvResultBusT(Base): - __tablename__ = 'ego_grid_pf_hv_result_bus_t' - __table_args__ = {'schema': 'model_draft'} - - result_id = Column(BigInteger, primary_key=True, nullable=False) - bus_id = Column(BigInteger, primary_key=True, nullable=False) - v_mag_pu_set = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - p = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - q = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - v_mag_pu = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - v_ang = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - marginal_price = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - - -class EgoGridPfHvResultGenerator(Base): - __tablename__ = 'ego_grid_pf_hv_result_generator' +class EgoGridPfHvResultGenerator(Base): + __tablename__ = 'ego_grid_pf_hv_result_generator' __table_args__ = {'schema': 'model_draft'} result_id = Column(BigInteger, primary_key=True, nullable=False) @@ -3001,13 +3210,13 @@ class EgoGridPfHvResultGeneratorT(Base): result_id = Column(BigInteger, primary_key=True, nullable=False) generator_id = Column(BigInteger, primary_key=True, nullable=False) - p_set = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - q_set = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - p_min_pu = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - p_max_pu = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - p = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - q = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - status = Column(ARRAY(BIGINT())) + p_set = Column(ARRAY(Float(precision=53))) + q_set = Column(ARRAY(Float(precision=53))) + p_min_pu = Column(ARRAY(Float(precision=53))) + p_max_pu = Column(ARRAY(Float(precision=53))) + p = Column(ARRAY(Float(precision=53))) + q = Column(ARRAY(Float(precision=53))) + status = Column(ARRAY(BigInteger())) class EgoGridPfHvResultLine(Base): @@ -3046,10 +3255,10 @@ class EgoGridPfHvResultLineT(Base): result_id = Column(BigInteger, primary_key=True, nullable=False) line_id = Column(BigInteger, primary_key=True, nullable=False) - p0 = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - q0 = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - p1 = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - q1 = Column(ARRAY(DOUBLE_PRECISION(precision=53))) + p0 = Column(ARRAY(Float(precision=53))) + q0 = Column(ARRAY(Float(precision=53))) + p1 = Column(ARRAY(Float(precision=53))) + q1 = Column(ARRAY(Float(precision=53))) class EgoGridPfHvResultLoad(Base): @@ -3069,10 +3278,10 @@ class EgoGridPfHvResultLoadT(Base): result_id = Column(BigInteger, primary_key=True, nullable=False) load_id = Column(BigInteger, primary_key=True, nullable=False) - p_set = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - q_set = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - p = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - q = Column(ARRAY(DOUBLE_PRECISION(precision=53))) + p_set = Column(ARRAY(Float(precision=53))) + q_set = Column(ARRAY(Float(precision=53))) + p = Column(ARRAY(Float(precision=53))) + q = Column(ARRAY(Float(precision=53))) class EgoGridPfHvResultMeta(Base): @@ -3086,10 +3295,10 @@ class EgoGridPfHvResultMeta(Base): method = Column(String) start_snapshot = Column(Integer) end_snapshot = Column(Integer) - snapshots = Column(ARRAY(TIMESTAMP())) + snapshots = Column(ARRAY(DateTime())) solver = Column(String) - safe_results = Column(Boolean) settings = Column(JSON) + safe_results = Column(Boolean, server_default=text("false")) class EgoGridPfHvResultStorage(Base): @@ -3127,16 +3336,16 @@ class EgoGridPfHvResultStorageT(Base): result_id = Column(BigInteger, primary_key=True, nullable=False) storage_id = Column(BigInteger, primary_key=True, nullable=False) - p_set = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - q_set = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - p_min_pu = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - p_max_pu = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - soc_set = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - inflow = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - p = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - q = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - state_of_charge = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - spill = Column(ARRAY(DOUBLE_PRECISION(precision=53))) + p_set = Column(ARRAY(Float(precision=53))) + q_set = Column(ARRAY(Float(precision=53))) + p_min_pu = Column(ARRAY(Float(precision=53))) + p_max_pu = Column(ARRAY(Float(precision=53))) + soc_set = Column(ARRAY(Float(precision=53))) + inflow = Column(ARRAY(Float(precision=53))) + p = Column(ARRAY(Float(precision=53))) + q = Column(ARRAY(Float(precision=53))) + state_of_charge = Column(ARRAY(Float(precision=53))) + spill = Column(ARRAY(Float(precision=53))) class EgoGridPfHvResultTransformer(Base): @@ -3173,10 +3382,10 @@ class EgoGridPfHvResultTransformerT(Base): result_id = Column(BigInteger, primary_key=True, nullable=False) trafo_id = Column(BigInteger, primary_key=True, nullable=False) - p0 = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - q0 = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - p1 = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - q1 = Column(ARRAY(DOUBLE_PRECISION(precision=53))) + p0 = Column(ARRAY(Float(precision=53))) + q0 = Column(ARRAY(Float(precision=53))) + p1 = Column(ARRAY(Float(precision=53))) + q1 = Column(ARRAY(Float(precision=53))) class EgoGridPfHvScenarioSetting(Base): @@ -3207,8 +3416,23 @@ class EgoGridPfHvSource(Base): commentary = Column(Text) -class EgoGridPfHvStorage(Base): - __tablename__ = 'ego_grid_pf_hv_storage' +class EgoGridPfHvStoragePqSetV030(Base): + __tablename__ = 'ego_grid_pf_hv_storage_pq_set_v030' + __table_args__ = {'schema': 'model_draft'} + + scn_name = Column(String, primary_key=True, nullable=False, server_default=text("'Status Quo'::character varying")) + storage_id = Column(BigInteger, primary_key=True, nullable=False) + temp_id = Column(Integer, primary_key=True, nullable=False) + p_set = Column(ARRAY(Float(precision=53))) + q_set = Column(ARRAY(Float(precision=53))) + p_min_pu = Column(ARRAY(Float(precision=53))) + p_max_pu = Column(ARRAY(Float(precision=53))) + soc_set = Column(ARRAY(Float(precision=53))) + inflow = Column(ARRAY(Float(precision=53))) + + +class EgoGridPfHvStorageV030(Base): + __tablename__ = 'ego_grid_pf_hv_storage_v030' __table_args__ = {'schema': 'model_draft'} scn_name = Column(String, primary_key=True, nullable=False, server_default=text("'Status Quo'::character varying")) @@ -3223,7 +3447,7 @@ class EgoGridPfHvStorage(Base): p_min_pu_fixed = Column(Float(53), server_default=text("0")) p_max_pu_fixed = Column(Float(53), server_default=text("1")) sign = Column(Float(53), server_default=text("1")) - source = Column(ForeignKey('model_draft.ego_grid_pf_hv_source.source_id'), index=True) + source = Column(BigInteger) marginal_cost = Column(Float(53)) capital_cost = Column(Float(53)) efficiency = Column(Float(53)) @@ -3234,25 +3458,6 @@ class EgoGridPfHvStorage(Base): efficiency_dispatch = Column(Float(53)) standing_loss = Column(Float(53)) - ego_grid_pf_hv_source = relationship('EgoGridPfHvSource') - - -class EgoGridPfHvStoragePqSet(Base): - __tablename__ = 'ego_grid_pf_hv_storage_pq_set' - __table_args__ = {'schema': 'model_draft'} - - scn_name = Column(String, primary_key=True, nullable=False, server_default=text("'Status Quo'::character varying")) - storage_id = Column(BigInteger, primary_key=True, nullable=False) - temp_id = Column(ForeignKey('model_draft.ego_grid_pf_hv_temp_resolution.temp_id'), primary_key=True, nullable=False) - p_set = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - q_set = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - p_min_pu = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - p_max_pu = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - soc_set = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - inflow = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - - temp = relationship('EgoGridPfHvTempResolution') - class EgoGridPfHvTempResolution(Base): __tablename__ = 'ego_grid_pf_hv_temp_resolution' @@ -3287,6 +3492,29 @@ class EgoGridPfHvTransformer(Base): topo = Column(Geometry('LINESTRING', 4326)) +class EgoGridPfHvTransformerV030(Base): + __tablename__ = 'ego_grid_pf_hv_transformer_v030' + __table_args__ = {'schema': 'model_draft'} + + scn_name = Column(String, primary_key=True, nullable=False, server_default=text("'Status Quo'::character varying")) + trafo_id = Column(BigInteger, primary_key=True, nullable=False) + bus0 = Column(BigInteger) + bus1 = Column(BigInteger) + x = Column(Numeric, server_default=text("0")) + r = Column(Numeric, server_default=text("0")) + g = Column(Numeric, server_default=text("0")) + b = Column(Numeric, server_default=text("0")) + s_nom = Column(Float(53), server_default=text("0")) + s_nom_extendable = Column(Boolean, server_default=text("false")) + s_nom_min = Column(Float(53), server_default=text("0")) + s_nom_max = Column(Float(53)) + tap_ratio = Column(Float(53)) + phase_shift = Column(Float(53)) + capital_cost = Column(Float(53), server_default=text("0")) + geom = Column(Geometry('MULTILINESTRING', 4326)) + topo = Column(Geometry('LINESTRING', 4326)) + + class EgoGridPfMvBus(Base): __tablename__ = 'ego_grid_pf_mv_bus' __table_args__ = {'schema': 'model_draft'} @@ -3307,7 +3535,7 @@ class EgoGridPfMvBusVMagSet(Base): scn_name = Column(String, primary_key=True, nullable=False, server_default=text("'Status Quo'::character varying")) bus_id = Column(String(25), primary_key=True, nullable=False) temp_id = Column(Integer, primary_key=True, nullable=False) - v_mag_pu_set = Column(ARRAY(DOUBLE_PRECISION(precision=53))) + v_mag_pu_set = Column(ARRAY(Float(precision=53))) grid_id = Column(Integer) @@ -3333,10 +3561,10 @@ class EgoGridPfMvGeneratorPqSet(Base): scn_name = Column(String, primary_key=True, nullable=False, server_default=text("'Status Quo'::character varying")) generator_id = Column(String(25), primary_key=True, nullable=False) temp_id = Column(Integer, primary_key=True, nullable=False) - p_set = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - q_set = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - p_min_pu = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - p_max_pu = Column(ARRAY(DOUBLE_PRECISION(precision=53))) + p_set = Column(ARRAY(Float(precision=53))) + q_set = Column(ARRAY(Float(precision=53))) + p_min_pu = Column(ARRAY(Float(precision=53))) + p_max_pu = Column(ARRAY(Float(precision=53))) grid_id = Column(Integer) @@ -3377,8 +3605,8 @@ class EgoGridPfMvLoadPqSet(Base): scn_name = Column(String, primary_key=True, nullable=False, server_default=text("'Status Quo'::character varying")) load_id = Column(String(25), primary_key=True, nullable=False) temp_id = Column(Integer, primary_key=True, nullable=False) - p_set = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - q_set = Column(ARRAY(DOUBLE_PRECISION(precision=53))) + p_set = Column(ARRAY(Float(precision=53))) + q_set = Column(ARRAY(Float(precision=53))) grid_id = Column(Integer) @@ -3387,7 +3615,7 @@ class EgoGridPfMvResBus(Base): __table_args__ = {'schema': 'model_draft'} bus_id = Column(String(25), primary_key=True) - v_mag_pu = Column(ARRAY(DOUBLE_PRECISION(precision=53))) + v_mag_pu = Column(ARRAY(Float(precision=53))) class EgoGridPfMvResLine(Base): @@ -3395,10 +3623,10 @@ class EgoGridPfMvResLine(Base): __table_args__ = {'schema': 'model_draft'} line_id = Column(String(25), primary_key=True) - p0 = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - p1 = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - q0 = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - q1 = Column(ARRAY(DOUBLE_PRECISION(precision=53))) + p0 = Column(ARRAY(Float(precision=53))) + p1 = Column(ARRAY(Float(precision=53))) + q0 = Column(ARRAY(Float(precision=53))) + q1 = Column(ARRAY(Float(precision=53))) class EgoGridPfMvResTransformer(Base): @@ -3406,10 +3634,10 @@ class EgoGridPfMvResTransformer(Base): __table_args__ = {'schema': 'model_draft'} trafo_id = Column(String(25), primary_key=True) - p0 = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - p1 = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - q0 = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - q1 = Column(ARRAY(DOUBLE_PRECISION(precision=53))) + p0 = Column(ARRAY(Float(precision=53))) + p1 = Column(ARRAY(Float(precision=53))) + q0 = Column(ARRAY(Float(precision=53))) + q1 = Column(ARRAY(Float(precision=53))) class EgoGridPfMvScenarioSetting(Base): @@ -3469,6 +3697,37 @@ class EgoGridPfMvTransformer(Base): grid_id = Column(Integer) +class EgoGridPpEntsoeBus(Base): + __tablename__ = 'ego_grid_pp_entsoe_bus' + __table_args__ = {'schema': 'model_draft'} + + bus_id = Column(BigInteger, primary_key=True) + station_id = Column(BigInteger) + voltage = Column(Float(53)) + dc = Column(Boolean) + symbol = Column(String) + country = Column(Text) + under_construction = Column(Boolean) + geom = Column(Geometry('POINT')) + + +class EgoGridPpEntsoeLine(Base): + __tablename__ = 'ego_grid_pp_entsoe_line' + __table_args__ = {'schema': 'model_draft'} + + link_id = Column(BigInteger, primary_key=True) + bus0 = Column(BigInteger) + bus1 = Column(BigInteger) + voltage = Column(Float(53)) + circiuts = Column(BigInteger) + dc = Column(Boolean) + underground = Column(Boolean) + under_construction = Column(Boolean) + country1 = Column(String) + country2 = Column(String) + geom = Column(Geometry('LINESTRING')) + + class EgoHvmvSubstation(Base): __tablename__ = 'ego_hvmv_substation' __table_args__ = {'schema': 'model_draft'} @@ -3658,6 +3917,15 @@ class EgoMvGriddistrict(Base): geom = Column(Geometry('MULTIPOLYGON', 3035)) +class EgoNeighboursOffshorePoint(Base): + __tablename__ = 'ego_neighbours_offshore_point' + __table_args__ = {'schema': 'model_draft'} + + cntr_id = Column(Text, primary_key=True) + coastdat_id = Column(BigInteger) + geom = Column(Geometry('POINT', 4326)) + + class EgoOsmAgriculturePerMvgd(Base): __tablename__ = 'ego_osm_agriculture_per_mvgd' __table_args__ = {'schema': 'model_draft'} @@ -3754,7 +4022,7 @@ class EgoOsmSectorPerLvgd4Agricultural(Base): Column('ags_0', String(12)), Column('area_ha', Numeric), Column('count_hole', Integer), - Column('path', ARRAY(INTEGER())), + Column('path', ARRAY(Integer())), Column('is_hole', Boolean), Column('geom', Geometry('POLYGON', 3035), index=True), schema='model_draft' @@ -3775,7 +4043,7 @@ class EgoPoliticalBoundaryHvmvSubstPerGem(Base): ags_0 = Column(String(12)) area_ha = Column(Numeric) count_hole = Column(Integer) - path = Column(ARRAY(INTEGER())) + path = Column(ARRAY(Integer())) is_hole = Column(Boolean) geom = Column(Geometry('POLYGON', 3035), index=True) subst_sum = Column(Integer) @@ -3852,6 +4120,42 @@ class EgoPoliticalBoundaryHvmvSubstPerGem3Nn(Base): ) +class EgoPowerClas(Base): + __tablename__ = 'ego_power_class' + __table_args__ = {'schema': 'model_draft'} + + power_class_id = Column(Integer, primary_key=True, server_default=text("nextval('model_draft.ego_power_class_power_class_id_seq'::regclass)")) + lower_limit = Column(Float(53)) + upper_limit = Column(Float(53)) + wea = Column(Text) + h_hub = Column(Float(53)) + d_rotor = Column(Float(53)) + + +class EgoRenewableFeedin(Base): + __tablename__ = 'ego_renewable_feedin' + __table_args__ = {'schema': 'model_draft'} + + weather_scenario_id = Column(Integer, primary_key=True, nullable=False) + w_id = Column(Integer, primary_key=True, nullable=False) + source = Column(Text, primary_key=True, nullable=False) + weather_year = Column(Integer, primary_key=True, nullable=False) + power_class = Column(Integer, primary_key=True, nullable=False) + feedin = Column(ARRAY(Float(precision=53))) + + +class EgoRenewableFeedinV031(Base): + __tablename__ = 'ego_renewable_feedin_v031' + __table_args__ = {'schema': 'model_draft'} + + weather_scenario_id = Column(Integer, primary_key=True, nullable=False) + w_id = Column(Integer, primary_key=True, nullable=False) + source = Column(Text, primary_key=True, nullable=False) + weather_year = Column(Integer, primary_key=True, nullable=False) + power_class = Column(Integer, primary_key=True, nullable=False) + feedin = Column(ARRAY(Float(precision=53))) + + t_ego_renewable_powerplant_eaa_mview = Table( 'ego_renewable_powerplant_eaa_mview', metadata, Column('id', BigInteger, unique=True), @@ -3900,23 +4204,14 @@ class EgoPoliticalBoundaryHvmvSubstPerGem3Nn(Base): schema='model_draft' ) -class EgoRenewableFeedin(Base): - __tablename__ = 'ego_renewable_feedin_v031' - __table_args__ = {'schema': 'model_draft'} - - weather_scenario_id = Column(Integer, primary_key=True, nullable=False) - w_id = Column(Integer, primary_key=True, nullable=False) - source = Column(Text, primary_key=True, nullable=False) - weather_year = Column(Integer, primary_key=True, nullable=False) - power_class = Column(Integer, primary_key=True, nullable=False) - feedin = Column(ARRAY(DOUBLE_PRECISION(precision=53))) - scenario = Column(Text, primary_key=True, nullable=False) class EgoScenario(Base): __tablename__ = 'ego_scenario' __table_args__ = {'schema': 'model_draft'} - version = Column(Text, primary_key=True) + id = Column(Integer, primary_key=True, nullable=False, server_default=text("nextval('model_draft.ego_scenario_id_seq'::regclass)")) + model = Column(Text) + version = Column(Text, primary_key=True, nullable=False) version_name = Column(Text) release = Column(Boolean) comment = Column(Text) @@ -3939,23 +4234,6 @@ class EgoScenarioInput(Base): meta_data = Column(Text) -class EgoScenarioLog(Base): - __tablename__ = 'ego_scenario_log' - __table_args__ = {'schema': 'model_draft'} - - id = Column(Integer, primary_key=True, server_default=text("nextval('model_draft.ego_scenario_log_id_seq'::regclass)")) - version = Column(Text) - io = Column(Text) - schema_name = Column(Text) - table_name = Column(Text) - script_name = Column(Text) - entries = Column(Integer) - status = Column(Text) - user_name = Column(Text) - timestamp = Column(DateTime) - meta_data = Column(Text) - - class EgoScenarioOverview(Base): __tablename__ = 'ego_scenario_overview' __table_args__ = {'schema': 'model_draft'} @@ -4061,6 +4339,17 @@ class EgoStorageH2AreasDe(Base): geom = Column(Geometry('MULTIPOLYGON', 4326), index=True) +t_ego_supply_aggr_weather_mview = Table( + 'ego_supply_aggr_weather_mview', metadata, + Column('aggr_id', BigInteger), + Column('w_id', BigInteger), + Column('scn_name', String), + Column('bus', BigInteger), + Column('row_number', BigInteger), + schema='model_draft' +) + + t_ego_supply_conv_nep2035_temp = Table( 'ego_supply_conv_nep2035_temp', metadata, Column('preversion', Text), @@ -4370,73 +4659,6 @@ class EgoSupplyGeneratorTest(Base): geom = Column(Geometry('POINT', 4326), index=True) -class EgoSupplyPfGeneratorSingle(Base): - __tablename__ = 'ego_supply_pf_generator_single' - __table_args__ = {'schema': 'model_draft'} - - scn_name = Column(String, primary_key=True, nullable=False, server_default=text("'Status Quo'::character varying")) - generator_id = Column(BigInteger, primary_key=True, nullable=False) - bus = Column(BigInteger) - dispatch = Column(Text, server_default=text("'flexible'::text")) - control = Column(Text, server_default=text("'PQ'::text")) - p_nom = Column(Float(53), server_default=text("0")) - p_nom_extendable = Column(Boolean, server_default=text("false")) - p_nom_min = Column(Float(53), server_default=text("0")) - p_nom_max = Column(Float(53)) - p_min_pu_fixed = Column(Float(53), server_default=text("0")) - p_max_pu_fixed = Column(Float(53), server_default=text("1")) - sign = Column(Float(53), server_default=text("1")) - source = Column(ForeignKey('model_draft.ego_grid_pf_hv_source.source_id')) - marginal_cost = Column(Float(53)) - capital_cost = Column(Float(53)) - efficiency = Column(Float(53)) - w_id = Column(BigInteger) - aggr_id = Column(BigInteger) - voltage_level = Column(SmallInteger) - - ego_grid_pf_hv_source = relationship('EgoGridPfHvSource') - -ego_supply_aggr_weather_mview = Table( - 'ego_supply_aggr_weather_mview', metadata, - Column('row_number', Integer), - Column('w_id', BigInteger), - Column('aggr_id', BigInteger), - Column('scn_name', String), - Column('bus', BigInteger), - schema='model_draft' -) - -class EgoSupplyPfStorageSingle(Base): - __tablename__ = 'ego_supply_pf_storage_single' - __table_args__ = {'schema': 'model_draft'} - - scn_name = Column(String, primary_key=True, nullable=False, server_default=text("'Status Quo'::character varying")) - storage_id = Column(BigInteger, primary_key=True, nullable=False) - bus = Column(BigInteger) - dispatch = Column(Text, server_default=text("'flexible'::text")) - control = Column(Text, server_default=text("'PQ'::text")) - p_nom = Column(Float(53), server_default=text("0")) - p_nom_extendable = Column(Boolean, server_default=text("false")) - p_nom_min = Column(Float(53), server_default=text("0")) - p_nom_max = Column(Float(53)) - p_min_pu_fixed = Column(Float(53), server_default=text("0")) - p_max_pu_fixed = Column(Float(53), server_default=text("1")) - sign = Column(Float(53), server_default=text("1")) - source = Column(ForeignKey('model_draft.ego_grid_pf_hv_source.source_id')) - marginal_cost = Column(Float(53)) - capital_cost = Column(Float(53)) - efficiency = Column(Float(53)) - soc_initial = Column(Float(53)) - soc_cyclic = Column(Boolean, server_default=text("false")) - max_hours = Column(Float(53)) - efficiency_store = Column(Float(53)) - efficiency_dispatch = Column(Float(53)) - standing_loss = Column(Float(53)) - aggr_id = Column(Integer) - - ego_grid_pf_hv_source = relationship('EgoGridPfHvSource') - - class EgoSupplyRea(Base): __tablename__ = 'ego_supply_rea' __table_args__ = {'schema': 'model_draft'} @@ -4492,6 +4714,7 @@ class EgoSupplyRea(Base): Column('scenario', String), Column('flag', String), Column('nuts', String), + Column('w_id', BigInteger), Column('la_id', Integer), Column('mvlv_subst_id', Integer), Column('rea_sort', Integer), @@ -4551,6 +4774,7 @@ class EgoSupplyRea(Base): Column('scenario', String), Column('flag', String), Column('nuts', String), + Column('w_id', BigInteger), Column('la_id', Integer), Column('mvlv_subst_id', Integer), Column('rea_sort', Integer), @@ -4610,6 +4834,7 @@ class EgoSupplyRea(Base): Column('scenario', String), Column('flag', String), Column('nuts', String), + Column('w_id', BigInteger), Column('la_id', Integer), Column('mvlv_subst_id', Integer), Column('rea_sort', Integer), @@ -4683,6 +4908,7 @@ class EgoSupplyReaM2Windfarm(Base): Column('scenario', String), Column('flag', String), Column('nuts', String), + Column('w_id', BigInteger), Column('la_id', Integer), Column('mvlv_subst_id', Integer), Column('rea_sort', Integer), @@ -4742,6 +4968,7 @@ class EgoSupplyReaM2Windfarm(Base): Column('scenario', String), Column('flag', String), Column('nuts', String), + Column('w_id', BigInteger), Column('la_id', Integer), Column('mvlv_subst_id', Integer), Column('rea_sort', Integer), @@ -4801,6 +5028,7 @@ class EgoSupplyReaM2Windfarm(Base): Column('scenario', String), Column('flag', String), Column('nuts', String), + Column('w_id', BigInteger), Column('la_id', Integer), Column('mvlv_subst_id', Integer), Column('rea_sort', Integer), @@ -4811,8 +5039,8 @@ class EgoSupplyReaM2Windfarm(Base): ) -t_ego_supply_rea_m5_rest_mview = Table( - 'ego_supply_rea_m5_rest_mview', metadata, +t_ego_supply_rea_m5_rest_2_mview = Table( + 'ego_supply_rea_m5_rest_2_mview', metadata, Column('id', BigInteger), Column('electrical_capacity', Numeric), Column('generation_type', Text), @@ -4825,7 +5053,21 @@ class EgoSupplyReaM2Windfarm(Base): ) -t_ego_supply_rea_out_mview = Table( +t_ego_supply_rea_m5_rest_mview = Table( + 'ego_supply_rea_m5_rest_mview', metadata, + Column('id', BigInteger), + Column('electrical_capacity', Numeric), + Column('generation_type', Text), + Column('generation_subtype', String), + Column('voltage_level', SmallInteger), + Column('subst_id', BigInteger), + Column('geom', Geometry, index=True), + Column('rea_flag', String), + schema='model_draft' +) + + +t_ego_supply_rea_out_mview = Table( 'ego_supply_rea_out_mview', metadata, Column('id', BigInteger), Column('electrical_capacity', Numeric), @@ -4890,6 +5132,102 @@ class EgoSupplyReaPerMvgd(Base): geom = Column(Geometry('MULTIPOLYGON', 3035), index=True) +class EgoSupplyRenewableBnetzaFullAttribute(Base): + __tablename__ = 'ego_supply_renewable_bnetza_full_attribute' + __table_args__ = {'schema': 'model_draft'} + + gid = Column(Integer, primary_key=True) + meldedatum = Column(String(254)) + meldegrund = Column(String(254)) + anlagennummer = Column(String(254)) + eeg_anlagenschluessel = Column(String(254)) + genehmigungs_datum = Column(String(254)) + genehmigungs_behoerde = Column(String(254)) + genehmigungs_aktenzeichen = Column(String(254)) + geplantes_inbetriebnahme_datum = Column(String(254)) + errichtungs_frist = Column(String(254)) + energietraeger = Column(String(254)) + installierte_leistung = Column(String(254)) + inst_leistung_vor_leistungs_aenderung = Column(Numeric) + inst_leistung_nach_leistungs_aenderung = Column(Numeric) + tatsächliche_inbetriebnahme = Column(String(254)) + datum_leistungs_aenderung = Column(String(254)) + stilllegungs_datum = Column(String(254)) + name_der_anlage = Column(String(254)) + strasse = Column(String(254)) + hausnummer = Column(String(254)) + plz = Column(String(254)) + ort = Column(String(254)) + gemeinde_schluessel = Column('gemeinde-schluessel', String(254)) + bundesland = Column(String(254)) + utm_zonenwert = Column('utm-zonenwert', String(254)) + utm_east = Column('utm-east', Numeric) + utm_east_neu = Column('utm-east_neu', Numeric) + utm_north = Column('utm-north', Numeric) + zugehoehrigkeit_anlagenpark = Column(String(254)) + name_des_anlagenparks = Column(String(254)) + spannungsebene = Column(String(254)) + netzanschlusspunkt = Column(String(254)) + zaehlpunktbezeichnung = Column(String(254)) + name_des_netzbetreibers = Column(String(254)) + fernsteuerbarkeit_durch = Column(String(254)) + gemeinsame_techn_einrichtung = Column(String(254)) + inanspruchnahme_finanzieller_foerderung = Column(String(254)) + eigenverbrauch_geplant = Column(String(254)) + eingesetzte_biomasse = Column(String(254)) + ausschliesslich_Biomasse = Column(String(254)) + flexpraemie = Column(String(254)) + erstmalige_inanspruchnahme_flexpraemie = Column(String(254)) + leistungserhoehung_flexpraemie = Column(String(254)) + datum_leistungserhoehung_flexpraemie = Column(String(254)) + umfang_der_leistungserhoehung = Column(String(254)) + erstmalig_ausschliesslich_biomethan = Column(String(254)) + zustimmung_gesonderte_veröeffentlichung_biomethanstilllegung = Column(String(254)) + kwk_anlage = Column(String(254)) + thermische_leistung = Column(String(254)) + andere_energietraeger = Column(String(254)) + eingesetzte_andere_energietraeger = Column(String(254)) + erstmalige_stromerzeugung = Column(String(254)) + windanlagenhersteller = Column(String(254)) + anlagentyp = Column(String(254)) + nabenhoehe = Column(String(254)) + rotordurchmesser = Column(String(254)) + repowering = Column(String(254)) + stillgelegt = Column(String(254)) + _7_7_1_mitt = Column('7_7_1_mitt', String(254)) + _7_7_2_form = Column('7_7_2_form', String(254)) + _7_7_3_skal = Column('7_7_3_skal', Numeric) + _7_7_4_ertr = Column('7_7_4_ertr', Numeric) + _7_7_5_ertr = Column('7_7_5_ertr', Numeric) + _7_8_1_seel = Column('7_8_1_seel', String(254)) + _7_8_2_wass = Column('7_8_2_wass', String(254)) + _7_8_3_küs = Column('7_8_3_k\xfcs', String(254)) + _8_1_ertüc = Column('8_1_ert\xfcc', String(254)) + _8_2_art_de = Column('8_2_art_de', String(254)) + _8_3_zulass = Column('8_3_zulass', String(254)) + _8_4_höhe = Column('8_4_h\xf6he', String(254)) + _8_5_datum = Column('8_5_datum', String(254)) + _9_1_zuschl = Column('9_1_zuschl', String(254)) + _9_2_wie_vi = Column('9_2_wie_vi', String(254)) + _9_3_wie_vi = Column('9_3_wie_vi', String(254)) + field_74 = Column(Numeric) + field_75 = Column(Numeric) + field_76 = Column(String(254)) + field_77 = Column(String(254)) + field_78 = Column(String(254)) + field_79 = Column(String(254)) + field_80 = Column(String(254)) + field_81 = Column(String(254)) + field_82 = Column(String(254)) + field_83 = Column(String(254)) + field_84 = Column(String(254)) + field_85 = Column(Numeric) + field_86 = Column(Numeric(10, 0)) + field_87 = Column(String(254)) + field_88 = Column(String(254)) + geom = Column(Geometry('POINT', 25832), index=True) + + t_ego_supply_res_biomass_2035_temp = Table( 'ego_supply_res_biomass_2035_temp', metadata, Column('preversion', Text), @@ -5149,7 +5487,6 @@ class EgoSupplyResPowerplant(Base): un_id = Column(BigInteger) voltage_level = Column(SmallInteger) la_id = Column(Integer) - w_id = Column(Integer) mvlv_subst_id = Column(Integer) rea_sort = Column(Integer) rea_flag = Column(String) @@ -5192,8 +5529,8 @@ class EgoSupplyResPowerplant(Base): Column('scenario', String), Column('flag', String), Column('nuts', String), + Column('w_id', BigInteger), Column('la_id', Integer), - Column('w_id', Integer), Column('mvlv_subst_id', Integer), Column('rea_sort', Integer), Column('rea_flag', String), @@ -5238,52 +5575,7 @@ class EgoSupplyResPowerplant(Base): Column('scenario', String), Column('flag', String), Column('nuts', String), - Column('la_id', Integer), - Column('w_id', Integer), - Column('mvlv_subst_id', Integer), - Column('rea_sort', Integer), - Column('rea_flag', String), - Column('rea_geom_line', Geometry('LINESTRING', 3035)), - Column('rea_geom_new', Geometry('POINT', 3035)), - schema='model_draft' -) - - -t_ego_supply_res_powerplant_nep2035_v030pre1_mview = Table( - 'ego_supply_res_powerplant_nep2035_v030pre1_mview', metadata, - Column('preversion', Text), - Column('id', BigInteger), - Column('start_up_date', DateTime), - Column('electrical_capacity', Numeric), - Column('generation_type', Text), - Column('generation_subtype', String), - Column('thermal_capacity', Numeric), - Column('city', String), - Column('postcode', String), - Column('address', String), - Column('lon', Numeric), - Column('lat', Numeric), - Column('gps_accuracy', String), - Column('validation', String), - Column('notification_reason', String), - Column('eeg_id', String), - Column('tso', Float(53)), - Column('tso_eic', String), - Column('dso_id', String), - Column('dso', String), - Column('voltage_level_var', String), - Column('network_node', String), - Column('power_plant_id', String), - Column('source', String), - Column('comment', String), - Column('geom', Geometry('POINT', 4326)), - Column('subst_id', BigInteger), - Column('otg_id', BigInteger), - Column('un_id', BigInteger), - Column('voltage_level', SmallInteger), - Column('scenario', String), - Column('flag', String), - Column('nuts', String), + Column('w_id', BigInteger), Column('la_id', Integer), Column('mvlv_subst_id', Integer), Column('rea_sort', Integer), @@ -5370,8 +5662,8 @@ class EgoSupplyResPowerplant(Base): Column('scenario', String), Column('flag', String), Column('nuts', String), + Column('w_id', BigInteger), Column('la_id', Integer), - Column('w_id', Integer), Column('mvlv_subst_id', Integer), Column('rea_sort', Integer), Column('rea_flag', String), @@ -5450,6 +5742,51 @@ class EgoSupplyResWo2050GermanyMunTemp(Base): wo_new_units = Column(Integer) +t_ego_supply_res_woff_2035_temp = Table( + 'ego_supply_res_woff_2035_temp', metadata, + Column('preversion', Text), + Column('id', BigInteger), + Column('start_up_date', DateTime), + Column('electrical_capacity', Numeric), + Column('generation_type', Text), + Column('generation_subtype', String), + Column('thermal_capacity', Numeric), + Column('city', String), + Column('postcode', String), + Column('address', String), + Column('lon', Numeric), + Column('lat', Numeric), + Column('gps_accuracy', String), + Column('validation', String), + Column('notification_reason', String), + Column('eeg_id', String), + Column('tso', Float(53)), + Column('tso_eic', String), + Column('dso_id', String), + Column('dso', String), + Column('voltage_level_var', String), + Column('network_node', String), + Column('power_plant_id', String), + Column('source', String), + Column('comment', String), + Column('geom', Geometry('POINT', 4326), index=True), + Column('subst_id', BigInteger), + Column('otg_id', BigInteger), + Column('un_id', BigInteger), + Column('voltage_level', SmallInteger), + Column('scenario', String), + Column('flag', String), + Column('nuts', String), + Column('la_id', Integer), + Column('mvlv_subst_id', Integer), + Column('rea_sort', Integer), + Column('rea_flag', String), + Column('rea_geom_line', Geometry('LINESTRING', 3035)), + Column('rea_geom_new', Geometry('POINT', 3035)), + schema='model_draft' +) + + t_ego_supply_res_woff_2050_temp = Table( 'ego_supply_res_woff_2050_temp', metadata, Column('preversion', Text), @@ -5499,11 +5836,11 @@ class EgoSupplyScenarioCapacity(Base): __tablename__ = 'ego_supply_scenario_capacities' __table_args__ = {'schema': 'model_draft'} - state = Column(String(50), nullable=False) - generation_type = Column(String(25), primary_key=True, nullable=False) + state = Column(CHAR(50), nullable=False) + generation_type = Column(CHAR(25), primary_key=True, nullable=False) capacity = Column(Numeric(15, 0)) - nuts = Column(String(12), primary_key=True, nullable=False) - scenario_name = Column(String(50), primary_key=True, nullable=False) + nuts = Column(CHAR(12), primary_key=True, nullable=False) + scenario_name = Column(CHAR(50), primary_key=True, nullable=False) class EgoSupplyWpaPerMvgd(Base): @@ -5520,15 +5857,9 @@ class EgoWeatherMeasurementPoint(Base): __tablename__ = 'ego_weather_measurement_point' __table_args__ = {'schema': 'model_draft'} - name = Column(Text, primary_key=True, nullable=False) + coastdat_id = Column(BigInteger, primary_key=True, nullable=False) type_of_generation = Column(Text, primary_key=True, nullable=False) - comment = Column(Text) - source = Column(Text) - scenario = Column(Text, primary_key=True, nullable=False) - capacity_scale = Column(Numeric) - geom = Column(Geometry('POINT', 4326), index=True) - coastdat_id = Column(BigInteger) - sub_id = Column(BigInteger) + geom = Column(Geometry('POINT', 4326)) t_ev_charging_berlin_parking_poly = Table( @@ -5722,8 +6053,8 @@ class EvChargingDistrict(Base): ) -t_ev_charging_gießen_poi_points_ = Table( - 'ev_charging_gie\xdfen_poi_points_', metadata, +t_ev_charging_giessen_poi_points_ = Table( + 'ev_charging_giessen_poi_points_', metadata, Column('id', BigInteger), Column('geom', Geometry('POINT', 3035), index=True), Column('amenity', String(50)), @@ -5732,30 +6063,30 @@ class EvChargingDistrict(Base): ) -t_ev_charging_gießen_poi_points__clusters = Table( - 'ev_charging_gie\xdfen_poi_points__clusters', metadata, +t_ev_charging_giessen_poi_points__clusters = Table( + 'ev_charging_giessen_poi_points__clusters', metadata, Column('npoints', Integer), Column('geom', Geometry, index=True), schema='model_draft' ) -class EvChargingGießenStreet(Base): - __tablename__ = 'ev_charging_gie\xdfen_streets' +class EvChargingGiessenStreet(Base): + __tablename__ = 'ev_charging_giessen_streets' __table_args__ = {'schema': 'model_draft'} - id = Column(Integer, primary_key=True, server_default=text("nextval('model_draft.ev_charging_gießen_streets_id_seq'::regclass)")) + id = Column(Integer, primary_key=True, server_default=text("nextval('model_draft.\"ev_charging_gießen_streets_id_seq\"'::regclass)")) osm_id = Column(Integer) geom = Column(Geometry('LINESTRING', 3035), index=True) length = Column(Numeric) highway = Column(HSTORE(Text())) -class EvChargingGießenStreetsSegmented(Base): - __tablename__ = 'ev_charging_gie\xdfen_streets_segmented' +class EvChargingGiessenStreetsSegmented(Base): + __tablename__ = 'ev_charging_giessen_streets_segmented' __table_args__ = {'schema': 'model_draft'} - id = Column(Integer, primary_key=True, server_default=text("nextval('model_draft.ev_charging_gießen_streets_segmented_id_seq'::regclass)")) + id = Column(Integer, primary_key=True, server_default=text("nextval('model_draft.\"ev_charging_gießen_streets_segmented_id_seq\"'::regclass)")) x1 = Column(Float(53)) y1 = Column(Float(53)) x2 = Column(Float(53)) @@ -5932,8 +6263,8 @@ class EvChargingPoiPointsBerlinCluster(Base): ) -t_ev_charging_poi_points_gießen = Table( - 'ev_charging_poi_points_gie\xdfen', metadata, +t_ev_charging_poi_points_giessen = Table( + 'ev_charging_poi_points_giessen', metadata, Column('id', BigInteger), Column('geom', Geometry('POINT', 3035)), Column('amenity', String(50)), @@ -6167,22 +6498,22 @@ class EvChargingStreetsFriedlandSegmented(Base): length = Column(Float(53)) -class EvChargingStreetsGießen(Base): - __tablename__ = 'ev_charging_streets_gie\xdfen' +class EvChargingStreetsGiessen(Base): + __tablename__ = 'ev_charging_streets_giessen' __table_args__ = {'schema': 'model_draft'} - id = Column(Integer, primary_key=True, server_default=text("nextval('model_draft.ev_charging_streets_gießen_id_seq'::regclass)")) + id = Column(Integer, primary_key=True, server_default=text("nextval('model_draft.\"ev_charging_streets_gießen_id_seq\"'::regclass)")) osm_id = Column(Integer) geom = Column(Geometry('LINESTRING', 3035), index=True) length = Column(Numeric) highway = Column(HSTORE(Text())) -class EvChargingStreetsGießenSegmented(Base): - __tablename__ = 'ev_charging_streets_gie\xdfen_segmented' +class EvChargingStreetsGiessenSegmented(Base): + __tablename__ = 'ev_charging_streets_giessen_segmented' __table_args__ = {'schema': 'model_draft'} - id = Column(Integer, primary_key=True, server_default=text("nextval('model_draft.ev_charging_streets_gießen_segmented_id_seq'::regclass)")) + id = Column(Integer, primary_key=True, server_default=text("nextval('model_draft.\"ev_charging_streets_gießen_segmented_id_seq\"'::regclass)")) x1 = Column(Float(53)) y1 = Column(Float(53)) x2 = Column(Float(53)) @@ -6320,8 +6651,8 @@ class EvChargingTestInsertWitha(Base): ) -t_ev_charging_top_censusblocks_gießen = Table( - 'ev_charging_top_censusblocks_gie\xdfen', metadata, +t_ev_charging_top_censusblocks_giessen = Table( + 'ev_charging_top_censusblocks_giessen', metadata, Column('cb_id', Integer), Column('district_name', String(50)), Column('population', Integer), @@ -6718,6 +7049,153 @@ class LanduseCalc(Base): area_ha = Column(Numeric(15, 1)) +class LisCharging(Base): + __tablename__ = 'lis_charging' + __table_args__ = {'schema': 'model_draft'} + + id = Column(BigInteger, primary_key=True, server_default=text("nextval('model_draft.lis_charging_id_seq'::regclass)")) + geom = Column(Geometry('POINT', 3035), index=True) + desc = Column(String) + + +class LisChargingGe(Base): + __tablename__ = 'lis_charging_ge' + __table_args__ = {'schema': 'model_draft'} + + id = Column(BigInteger, primary_key=True, server_default=text("nextval('model_draft.lis_charging_ge_id_seq'::regclass)")) + ge_id = Column(BigInteger) + geom = Column(Geometry('POINT', 3035), index=True) + name = Column(String) + street = Column(String) + postcode = Column(String) + city = Column(String) + count = Column(Integer) + power = Column(Float(53)) + type = Column(String) + desc = Column(String) + + +class LisChargingPoiBadSaarow(Base): + __tablename__ = 'lis_charging_poi_bad_saarow' + __table_args__ = {'schema': 'model_draft'} + + id = Column(BigInteger, primary_key=True, server_default=text("nextval('model_draft.lis_charging_poi_bad_saarow_id_seq'::regclass)")) + geom = Column(Geometry('POINT', 3035), index=True) + osm_id = Column(BigInteger) + amenity = Column(String) + name = Column(String) + category = Column(SmallInteger) + grid_id = Column(BigInteger) + potential = Column(Float(53)) + covered_by = Column(BigInteger) + + +class LisChargingPoiBerlin(Base): + __tablename__ = 'lis_charging_poi_berlin' + __table_args__ = {'schema': 'model_draft'} + + id = Column(BigInteger, primary_key=True, server_default=text("nextval('model_draft.map_charging_poi_berlin_id_seq'::regclass)")) + geom = Column(Geometry('POINT', 3035), index=True) + osm_id = Column(BigInteger) + amenity = Column(String) + name = Column(String) + category = Column(SmallInteger) + grid_id = Column(BigInteger) + potential = Column(Float(53)) + covered_by = Column(BigInteger) + + +class LisChargingPoiBrandenburg(Base): + __tablename__ = 'lis_charging_poi_brandenburg' + __table_args__ = {'schema': 'model_draft'} + + id = Column(BigInteger, primary_key=True, server_default=text("nextval('model_draft.lis_charging_poi_brandenburg_id_seq'::regclass)")) + geom = Column(Geometry('POINT', 3035), index=True) + osm_id = Column(BigInteger) + amenity = Column(String) + name = Column(String) + category = Column(SmallInteger) + grid_id = Column(BigInteger) + potential = Column(Float(53)) + covered_by = Column(BigInteger) + + +class LisChargingPoiFuerstenwaldespree(Base): + __tablename__ = 'lis_charging_poi_fuerstenwaldespree' + __table_args__ = {'schema': 'model_draft'} + + id = Column(BigInteger, primary_key=True, server_default=text("nextval('model_draft.lis_charging_poi_fuerstenwaldespree_id_seq'::regclass)")) + geom = Column(Geometry('POINT', 3035), index=True) + osm_id = Column(BigInteger) + amenity = Column(String) + name = Column(String) + category = Column(SmallInteger) + grid_id = Column(BigInteger) + potential = Column(Float(53)) + covered_by = Column(BigInteger) + + +class LisChargingPoiPanketal(Base): + __tablename__ = 'lis_charging_poi_panketal' + __table_args__ = {'schema': 'model_draft'} + + id = Column(BigInteger, primary_key=True, server_default=text("nextval('model_draft.lis_charging_poi_panketal_id_seq'::regclass)")) + geom = Column(Geometry('POINT', 3035), index=True) + osm_id = Column(BigInteger) + amenity = Column(String) + name = Column(String) + category = Column(SmallInteger) + grid_id = Column(BigInteger) + potential = Column(Float(53)) + covered_by = Column(BigInteger) + + +class LisChargingPoiPotsdam(Base): + __tablename__ = 'lis_charging_poi_potsdam' + __table_args__ = {'schema': 'model_draft'} + + id = Column(BigInteger, primary_key=True, server_default=text("nextval('model_draft.lis_charging_poi_potsdam_id_seq'::regclass)")) + geom = Column(Geometry('POINT', 3035), index=True) + osm_id = Column(BigInteger) + amenity = Column(String) + name = Column(String) + category = Column(SmallInteger) + grid_id = Column(BigInteger) + potential = Column(Float(53)) + covered_by = Column(BigInteger) + + +class LisChargingPoiUelzen(Base): + __tablename__ = 'lis_charging_poi_uelzen' + __table_args__ = {'schema': 'model_draft'} + + id = Column(BigInteger, primary_key=True, server_default=text("nextval('model_draft.map_charging_poi_uelzen_id_seq'::regclass)")) + geom = Column(Geometry('POINT', 3035), index=True) + osm_id = Column(BigInteger) + amenity = Column(String) + name = Column(String) + category = Column(SmallInteger) + grid_id = Column(BigInteger) + potential = Column(Float(53)) + covered_by = Column(BigInteger) + + +t_lis_charging_test = Table( + 'lis_charging_test', metadata, + Column('ge_id', BigInteger), + Column('lat', Float(53)), + Column('lng', Float(53)), + Column('name', String), + Column('street', String), + Column('postcode', String), + Column('city', String), + Column('count', Integer), + Column('power', Float(53)), + Column('type', String), + schema='model_draft' +) + + class NepSupplyConvPowerplantNep2015(Base): __tablename__ = 'nep_supply_conv_powerplant_nep2015' __table_args__ = {'schema': 'model_draft'} @@ -6743,6 +7221,15 @@ class NepSupplyConvPowerplantNep2015(Base): gid = Column(Integer, primary_key=True, server_default=text("nextval('model_draft.nep_supply_conv_powerplant_nep2015_seq'::regclass)")) +t_offshore_feedin_foreign = Table( + 'offshore_feedin_foreign', metadata, + Column('generator_id', BigInteger), + Column('scn_name', String), + Column('feedin', ARRAY(Float(precision=53))), + schema='model_draft' +) + + class OpenfredLocation(Base): __tablename__ = 'openfred_locations' __table_args__ = {'schema': 'model_draft'} @@ -6764,22 +7251,6 @@ class OpenfredTimestamp(Base): stop = Column(DateTime) -class OpenfredValue(Base): - __tablename__ = 'openfred_values' - __table_args__ = {'schema': 'model_draft'} - - id = Column(BigInteger, primary_key=True, server_default=text("nextval('model_draft.openfred_values_id_seq'::regclass)")) - v = Column(Float(53), nullable=False) - altitude = Column(Float(53)) - timestamp_id = Column(ForeignKey('model_draft.openfred_timestamps.id'), nullable=False, server_default=text("1")) - location_id = Column(ForeignKey('model_draft.openfred_locations.id'), nullable=False) - variable_id = Column(ForeignKey('model_draft.openfred_variables.id'), nullable=False) - - location = relationship('OpenfredLocation') - timestamp = relationship('OpenfredTimestamp') - variable = relationship('OpenfredVariable') - - class OpenfredVariable(Base): __tablename__ = 'openfred_variables' __table_args__ = {'schema': 'model_draft'} @@ -6797,8 +7268,8 @@ class OpenfredFlag(OpenfredVariable): __table_args__ = {'schema': 'model_draft'} id = Column(ForeignKey('model_draft.openfred_variables.id'), primary_key=True) - flag_ks = Column(ARRAY(INTEGER()), nullable=False) - flag_vs = Column(ARRAY(VARCHAR(length=37)), nullable=False) + flag_ks = Column(ARRAY(Integer()), nullable=False) + flag_vs = Column(ARRAY(String(length=37)), nullable=False) t_opsd_hourly_timeseries = Table( @@ -6878,24 +7349,20 @@ class OpenfredFlag(OpenfredVariable): ) -class RenpassGisEconomicLinearTransformer(Base): - __tablename__ = 'renpass_gis_economic_linear_transformer' - __table_args__ = {'schema': 'model_draft'} +t_ren_feedin_by_gen_id = Table( + 'ren_feedin_by_gen_id', metadata, + Column('generator_id', BigInteger), + Column('feedin', ARRAY(Float(precision=53))), + schema='model_draft' +) - id = Column(BigInteger, primary_key=True, server_default=text("nextval('model_draft.renpass_gis_economic_linear_transformer_id_seq'::regclass)")) - scenario_id = Column(ForeignKey('model_draft.renpass_gis_economic_scenario.id')) - label = Column(String(250)) - source = Column(String(250)) - target = Column(String(250)) - conversion_factors = Column(ARRAY(NUMERIC())) - summed_min = Column(ARRAY(NUMERIC())) - nominal_value = Column(ARRAY(NUMERIC())) - actual_value = Column(ARRAY(NUMERIC())) - fixed = Column(Boolean) - variable_costs = Column(ARRAY(NUMERIC())) - fixed_costs = Column(ARRAY(NUMERIC())) - scenario = relationship('RenpassGisEconomicScenario') +t_ren_feedin_foreign = Table( + 'ren_feedin_foreign', metadata, + Column('generator_id', BigInteger), + Column('feedin', ARRAY(Float(precision=53))), + schema='model_draft' +) class RenpassGisEconomicScenario(Base): @@ -6906,108 +7373,85 @@ class RenpassGisEconomicScenario(Base): name = Column(String(250), nullable=False, unique=True) -class RenpassGisEconomicSink(Base): - __tablename__ = 'renpass_gis_economic_sink' +class RenpassGisParameterRegion(Base): + __tablename__ = 'renpass_gis_parameter_region' __table_args__ = {'schema': 'model_draft'} - id = Column(BigInteger, primary_key=True, server_default=text("nextval('model_draft.renpass_gis_economic_sink_id_seq'::regclass)")) - scenario_id = Column(ForeignKey('model_draft.renpass_gis_economic_scenario.id')) - label = Column(String(250)) - source = Column(String(250)) - target = Column(String(250)) - nominal_value = Column(ARRAY(NUMERIC())) - actual_value = Column(ARRAY(NUMERIC())) - fixed = Column(Boolean) - - scenario = relationship('RenpassGisEconomicScenario') + gid = Column(Integer, primary_key=True) + u_region_id = Column(String(14), nullable=False) + stat_level = Column(Integer) + geom = Column(Geometry('MULTIPOLYGON', 4326)) + geom_point = Column(Geometry('POINT', 4326)) -class RenpassGisEconomicSource(Base): - __tablename__ = 'renpass_gis_economic_source' +class RenpassgisEconomicWeatherpointVoronoi(Base): + __tablename__ = 'renpassgis_economic_weatherpoint_voronoi' __table_args__ = {'schema': 'model_draft'} - id = Column(BigInteger, primary_key=True, server_default=text("nextval('model_draft.renpass_gis_economic_source_id_seq'::regclass)")) - scenario_id = Column(ForeignKey('model_draft.renpass_gis_economic_scenario.id')) - label = Column(String(250)) - source = Column(String(250)) - target = Column(String(250)) - nominal_value = Column(ARRAY(NUMERIC())) - actual_value = Column(ARRAY(NUMERIC())) - variable_costs = Column(ARRAY(NUMERIC())) - fixed = Column(Boolean) - - scenario = relationship('RenpassGisEconomicScenario') + geom = Column(Geometry('POLYGON', 4326), index=True) + id = Column(Integer, primary_key=True) -class RenpassGisEconomicStorage(Base): - __tablename__ = 'renpass_gis_economic_storage' +class RenpassgisEconomyClimatepointVoronoi(Base): + __tablename__ = 'renpassgis_economy_climatepoint_voronoi' __table_args__ = {'schema': 'model_draft'} - id = Column(BigInteger, primary_key=True, server_default=text("nextval('model_draft.renpass_gis_economic_storage_id_seq'::regclass)")) - scenario_id = Column(ForeignKey('model_draft.renpass_gis_economic_scenario.id')) - label = Column(String(250)) - source = Column(String(250)) - target = Column(String(250)) - conversion_factors = Column(ARRAY(NUMERIC())) - summed_min = Column(ARRAY(NUMERIC())) - nominal_value = Column(ARRAY(NUMERIC())) - min = Column(ARRAY(NUMERIC())) - max = Column(ARRAY(NUMERIC())) - actual_value = Column(ARRAY(NUMERIC())) - fixed = Column(Boolean) - variable_costs = Column(ARRAY(NUMERIC())) - fixed_costs = Column(ARRAY(NUMERIC())) - nominal_capacity = Column(ARRAY(NUMERIC())) - capacity_loss = Column(ARRAY(NUMERIC())) - inflow_conversion_factor = Column(ARRAY(NUMERIC())) - outflow_conversion_factor = Column(ARRAY(NUMERIC())) - initial_capacity = Column(ARRAY(NUMERIC())) - capacity_min = Column(ARRAY(NUMERIC())) - capacity_max = Column(ARRAY(NUMERIC())) - - scenario = relationship('RenpassGisEconomicScenario') - - -class RenpassGisParameterRegion(Base): - __tablename__ = 'renpass_gis_parameter_region' - __table_args__ = {'schema': 'model_draft'} - - gid = Column(Integer, primary_key=True) - u_region_id = Column(String(14), nullable=False) - stat_level = Column(Integer) - geom = Column(Geometry('MULTIPOLYGON', 4326)) - geom_point = Column(Geometry('POINT', 4326)) + geom = Column(Geometry('POLYGON', 4326), index=True) + id = Column(Integer, primary_key=True) -class RenpassGisScenarioResult(Base): - __tablename__ = 'renpass_gis_scenario_results' +class RliResearchInstitute(Base): + __tablename__ = 'rli_research_institute' __table_args__ = {'schema': 'model_draft'} - id = Column(BigInteger, primary_key=True, server_default=text("nextval('model_draft.renpass_gis_scenario_results_id_seq'::regclass)")) - scenario_id = Column(ForeignKey('model_draft.renpass_gis_economic_scenario.id')) - bus_label = Column(String(250)) - type = Column(String(250)) - obj_label = Column(String(250)) - datetime = Column(DateTime) - val = Column(Numeric) - - scenario = relationship('RenpassGisEconomicScenario') + id = Column(Integer, primary_key=True, server_default=text("nextval('model_draft.rli_research_institute_id_seq'::regclass)")) + name = Column(Text) + short_name = Column(Text) + country_name = Column(Text) + country_code = Column(Text) + city = Column(Text) + project_id = Column(Text) + website = Column(Text) + osm_id = Column(BigInteger) + updated = Column(DateTime(True)) + source = Column(Text) + lon = Column(Float(53)) + lat = Column(Float(53)) + geom = Column(Geometry('POINT', 3035), index=True) -class RenpassgisEconomicWeatherpointVoronoi(Base): - __tablename__ = 'renpassgis_economic_weatherpoint_voronoi' +class ScenarioLog(Base): + __tablename__ = 'scenario_log' __table_args__ = {'schema': 'model_draft'} - geom = Column(Geometry('POLYGON', 4326), index=True) - id = Column(Integer, primary_key=True) - + id = Column(Integer, primary_key=True, server_default=text("nextval('model_draft.scenario_log_id_seq'::regclass)")) + project = Column(Text) + version = Column(Text) + io = Column(Text) + schema_name = Column(Text) + table_name = Column(Text) + script_name = Column(Text) + entries = Column(Integer) + comment = Column(Text) + user_name = Column(Text) + timestamp = Column(DateTime) + meta_data = Column(Text) -class RenpassgisEconomyClimatepointVoronoi(Base): - __tablename__ = 'renpassgis_economy_climatepoint_voronoi' - __table_args__ = {'schema': 'model_draft'} - geom = Column(Geometry('POLYGON', 4326), index=True) - id = Column(Integer, primary_key=True) +t_scn_nep2035_b2_line = Table( + 'scn_nep2035_b2_line', metadata, + Column('scn_name', String, nullable=False, server_default=text("'Status Quo'::character varying")), + Column('project', String), + Column('project_id', BigInteger), + Column('startpunkt', String), + Column('endpunkt', String), + Column('spannung', BigInteger), + Column('s_nom', Numeric, server_default=text("0")), + Column('cables', BigInteger), + Column('nova', String), + Column('geom', Geometry('MULTILINESTRING', 4326)), + schema='model_draft' +) class SqlalchemyLinestring(Base): @@ -7080,6 +7524,52 @@ class TemplateTable(Base): ) +t_test_ego_supply_res_powerplant_nep2035_mview = Table( + 'test_ego_supply_res_powerplant_nep2035_mview', metadata, + Column('version', Text), + Column('id', BigInteger), + Column('start_up_date', DateTime), + Column('electrical_capacity', Numeric), + Column('generation_type', Text), + Column('generation_subtype', String), + Column('thermal_capacity', Numeric), + Column('city', String), + Column('postcode', String), + Column('address', String), + Column('lon', Numeric), + Column('lat', Numeric), + Column('gps_accuracy', String), + Column('validation', String), + Column('notification_reason', String), + Column('eeg_id', String), + Column('tso', Float(53)), + Column('tso_eic', String), + Column('dso_id', String), + Column('dso', String), + Column('voltage_level_var', String), + Column('network_node', String), + Column('power_plant_id', String), + Column('source', String), + Column('comment', String), + Column('geom', Geometry('POINT', 4326)), + Column('subst_id', BigInteger), + Column('otg_id', BigInteger), + Column('un_id', BigInteger), + Column('voltage_level', SmallInteger), + Column('la_id', Integer), + Column('mvlv_subst_id', Integer), + Column('rea_sort', Integer), + Column('rea_flag', String), + Column('rea_geom_line', Geometry('LINESTRING', 3035)), + Column('rea_geom_new', Geometry('POINT', 3035)), + Column('preversion', Text), + Column('flag', String), + Column('scenario', String), + Column('nuts', String), + schema='model_draft' +) + + class TestTable(Base): __tablename__ = 'test_table' __table_args__ = {'schema': 'model_draft'} @@ -7093,7 +7583,7 @@ class TestTable(Base): t_way_substations_test = Table( 'way_substations_test', metadata, Column('id', BigInteger), - Column('tags', ARRAY(TEXT())), + Column('tags', ARRAY(Text())), Column('geom', Geometry), schema='model_draft' ) @@ -7131,6 +7621,115 @@ class WnAbwBkgVg2504Kr(Base): geom = Column(Geometry('MULTIPOLYGON', 31467), index=True) +class WnAbwBkgVg2506Gem(Base): + __tablename__ = 'wn_abw_bkg_vg250_6_gem' + __table_args__ = {'schema': 'model_draft'} + + reference_date = Column(Date, primary_key=True, nullable=False) + id = Column(Integer, primary_key=True, nullable=False, server_default=text("nextval('model_draft.wn_abw_bkg_vg250_6_gem_id_seq'::regclass)")) + ade = Column(Float(53)) + gf = Column(Float(53)) + bsg = Column(Float(53)) + rs = Column(String(12)) + ags = Column(String(12)) + sdv_rs = Column(String(12)) + gen = Column(String(50)) + bez = Column(String(50)) + ibz = Column(Float(53)) + bem = Column(String(75)) + nbd = Column(String(4)) + sn_l = Column(String(2)) + sn_r = Column(String(1)) + sn_k = Column(String(2)) + sn_v1 = Column(String(2)) + sn_v2 = Column(String(2)) + sn_g = Column(String(3)) + fk_s3 = Column(String(2)) + nuts = Column(String(5)) + rs_0 = Column(String(12)) + ags_0 = Column(String(12)) + wsk = Column(Date) + debkg_id = Column(String(16)) + geom = Column(Geometry('MULTIPOLYGON', 31467), index=True) + + +class WnAbwDemandElT(Base): + __tablename__ = 'wn_abw_demand_el_ts' + __table_args__ = {'schema': 'model_draft'} + + load_id = Column(BigInteger, primary_key=True) + bus = Column(BigInteger) + p_set = Column(ARRAY(Float(precision=53))) + q_set = Column(ARRAY(Float(precision=53))) + subst_id = Column(Integer) + + +class WnAbwEgoDemandHvLargescaleconsumer(Base): + __tablename__ = 'wn_abw_ego_demand_hv_largescaleconsumer' + __table_args__ = {'schema': 'model_draft'} + + polygon_id = Column(Integer, primary_key=True) + area_ha = Column(Float(53)) + powerplant_id = Column(Integer) + voltage_level = Column(SmallInteger) + subst_id = Column(Integer) + otg_id = Column(Integer) + un_id = Column(Integer) + consumption = Column(Numeric) + peak_load = Column(Numeric) + geom = Column(Geometry('MULTIPOLYGON', 3035), index=True) + geom_centre = Column(Geometry('POINT', 3035), index=True) + hvmv_subst_id = Column(Integer) + + +class WnAbwEgoDpConvPowerplant(Base): + __tablename__ = 'wn_abw_ego_dp_conv_powerplant' + __table_args__ = {'schema': 'model_draft'} + + version = Column(Text, primary_key=True, nullable=False) + gid = Column(Integer, primary_key=True, nullable=False) + bnetza_id = Column(Text) + company = Column(Text) + name = Column(Text) + postcode = Column(Text) + city = Column(Text) + street = Column(Text) + state = Column(Text) + block = Column(Text) + commissioned_original = Column(Text) + commissioned = Column(Float(53)) + retrofit = Column(Float(53)) + shutdown = Column(Float(53)) + status = Column(Text) + fuel = Column(Text) + technology = Column(Text) + type = Column(Text) + eeg = Column(Text) + chp = Column(Text) + capacity = Column(Float(53)) + capacity_uba = Column(Float(53)) + chp_capacity_uba = Column(Float(53)) + efficiency_data = Column(Float(53)) + efficiency_estimate = Column(Float(53)) + network_node = Column(Text) + voltage = Column(Text) + network_operator = Column(Text) + name_uba = Column(Text) + lat = Column(Float(53)) + lon = Column(Float(53)) + comment = Column(Text) + geom = Column(Geometry('POINT', 4326), index=True) + voltage_level = Column(SmallInteger) + subst_id = Column(BigInteger) + otg_id = Column(BigInteger) + un_id = Column(BigInteger) + preversion = Column(Text) + la_id = Column(Integer) + scenario = Column(Text, primary_key=True, nullable=False, server_default=text("'none'::text")) + flag = Column(Text) + nuts = Column(String) + + class WnAbwEgoDpHvmvSubstation(Base): __tablename__ = 'wn_abw_ego_dp_hvmv_substation' __table_args__ = {'schema': 'model_draft'} @@ -7157,6 +7756,55 @@ class WnAbwEgoDpHvmvSubstation(Base): geom = Column(Geometry('POINT', 3035), index=True) +class WnAbwEgoDpLoadarea(Base): + __tablename__ = 'wn_abw_ego_dp_loadarea' + __table_args__ = {'schema': 'model_draft'} + + version = Column(Text, primary_key=True, nullable=False) + id = Column(Integer, primary_key=True, nullable=False) + subst_id = Column(Integer) + area_ha = Column(Numeric) + nuts = Column(String(5)) + rs_0 = Column(String(12)) + ags_0 = Column(String(12)) + otg_id = Column(Integer) + un_id = Column(Integer) + zensus_sum = Column(Integer) + zensus_count = Column(Integer) + zensus_density = Column(Numeric) + ioer_sum = Column(Numeric) + ioer_count = Column(Integer) + ioer_density = Column(Numeric) + sector_area_residential = Column(Numeric) + sector_area_retail = Column(Numeric) + sector_area_industrial = Column(Numeric) + sector_area_agricultural = Column(Numeric) + sector_area_sum = Column(Numeric) + sector_share_residential = Column(Numeric) + sector_share_retail = Column(Numeric) + sector_share_industrial = Column(Numeric) + sector_share_agricultural = Column(Numeric) + sector_share_sum = Column(Numeric) + sector_count_residential = Column(Integer) + sector_count_retail = Column(Integer) + sector_count_industrial = Column(Integer) + sector_count_agricultural = Column(Integer) + sector_count_sum = Column(Integer) + sector_consumption_residential = Column(Float(53)) + sector_consumption_retail = Column(Float(53)) + sector_consumption_industrial = Column(Float(53)) + sector_consumption_agricultural = Column(Float(53)) + sector_consumption_sum = Column(Float(53)) + sector_peakload_retail = Column(Float(53)) + sector_peakload_residential = Column(Float(53)) + sector_peakload_industrial = Column(Float(53)) + sector_peakload_agricultural = Column(Float(53)) + geom_centroid = Column(Geometry('POINT', 3035)) + geom_surfacepoint = Column(Geometry('POINT', 3035)) + geom_centre = Column(Geometry('POINT', 3035)) + geom = Column(Geometry('POLYGON', 3035), index=True) + + class WnAbwEgoDpMvGriddistrict(Base): __tablename__ = 'wn_abw_ego_dp_mv_griddistrict' __table_args__ = {'schema': 'model_draft'} @@ -7170,7 +7818,7 @@ class WnAbwEgoDpMvGriddistrict(Base): type2_cnt = Column(Integer) type3 = Column(Integer) type3_cnt = Column(Integer) - group = Column(String(1)) + group = Column(CHAR(1)) gem = Column(Integer) gem_clean = Column(Integer) zensus_sum = Column(Integer) @@ -7192,21 +7840,69 @@ class WnAbwEgoDpMvGriddistrict(Base): mv_dea_capacity = Column(Numeric) geom_type = Column(Text) geom = Column(Geometry('MULTIPOLYGON', 3035), index=True) + consumption_total = Column(Integer) -class WnAbwEgoPfHvBus(Base): - __tablename__ = 'wn_abw_ego_pf_hv_bus' +class WnAbwEgoDpResPowerplant(Base): + __tablename__ = 'wn_abw_ego_dp_res_powerplant' __table_args__ = {'schema': 'model_draft'} version = Column(Text, primary_key=True, nullable=False) - scn_name = Column(String, primary_key=True, nullable=False, server_default=text("'Status Quo'::character varying")) - bus_id = Column(BigInteger, primary_key=True, nullable=False) - v_nom = Column(Float(53)) - current_type = Column(Text, server_default=text("'AC'::text")) - v_mag_pu_min = Column(Float(53), server_default=text("0")) - v_mag_pu_max = Column(Float(53)) - geom = Column(Geometry('POINT', 4326), index=True) + id = Column(BigInteger, primary_key=True, nullable=False) + start_up_date = Column(DateTime) + electrical_capacity = Column(Numeric) + generation_type = Column(Text) + generation_subtype = Column(String) + thermal_capacity = Column(Numeric) + city = Column(String) + postcode = Column(String) + address = Column(String) + lon = Column(Numeric) + lat = Column(Numeric) + gps_accuracy = Column(String) + validation = Column(String) + notification_reason = Column(String) + eeg_id = Column(String) + tso = Column(Float(53)) + tso_eic = Column(String) + dso_id = Column(String) + dso = Column(String) + voltage_level_var = Column(String) + network_node = Column(String) + power_plant_id = Column(String) + source = Column(String) + comment = Column(String) + geom = Column(Geometry('POINT', 4326), index=True) + subst_id = Column(BigInteger) + otg_id = Column(BigInteger) + un_id = Column(BigInteger) + voltage_level = Column(SmallInteger) + la_id = Column(Integer) + mvlv_subst_id = Column(Integer) + rea_sort = Column(Integer) + rea_flag = Column(String) + rea_geom_line = Column(Geometry('LINESTRING', 3035)) + rea_geom_new = Column(Geometry('POINT', 3035), index=True) + preversion = Column(Text) + flag = Column(String) + scenario = Column(String, primary_key=True, nullable=False, server_default=text("'none'::character varying")) + nuts = Column(String) + + +class WnAbwEgoPfHvBus(Base): + __tablename__ = 'wn_abw_ego_pf_hv_bus' + __table_args__ = {'schema': 'model_draft'} + + version = Column(Text, primary_key=True, nullable=False) + scn_name = Column(String, primary_key=True, nullable=False, server_default=text("'Status Quo'::character varying")) + bus_id = Column(BigInteger, primary_key=True, nullable=False) + v_nom = Column(Float(53)) + current_type = Column(Text, server_default=text("'AC'::text")) + v_mag_pu_min = Column(Float(53), server_default=text("0")) + v_mag_pu_max = Column(Float(53)) + geom = Column(Geometry('POINT', 4326), index=True) hvmv_subst_id = Column(Integer) + region_bus = Column(Boolean, server_default=text("false")) class WnAbwEgoPfHvLine(Base): @@ -7259,228 +7955,391 @@ class WnAbwEgoPfHvTransformer(Base): topo = Column(Geometry('LINESTRING', 4326)) -class WnAbwRegionTransport(Base): - __tablename__ = 'wn_abw_region_transport' +class WnAbwPowerplantT(Base): + __tablename__ = 'wn_abw_powerplant_ts' __table_args__ = {'schema': 'model_draft'} - hvmv_subst_id0 = Column(Integer) - hvmv_subst_id1 = Column(Integer) - capacity = Column(Float(53)) - geom = Column(Geometry('LINESTRING', 4326), index=True) - id = Column(BigInteger, primary_key=True, server_default=text("nextval('model_draft.wn_abw_region_transport_id_seq'::regclass)")) + generator_id = Column(BigInteger, primary_key=True) + bus = Column(BigInteger) + dispatch = Column(Text) + control = Column(Text) + p_nom = Column(Float(53), server_default=text("0")) + generation_type = Column(Text) + p_set = Column(ARRAY(Float(precision=53))) + subst_id = Column(Integer) + + +t_wn_abw_results_line = Table( + 'wn_abw_results_line', metadata, + Column('line_id', BigInteger), + Column('loading_mean', Float(53)), + Column('loading_max', Float(53)), + schema='model_draft' +) -class EgoGridLvBranchtee(Base): - __tablename__ = 'ego_grid_lv_branchtee' +class WnAbwResultsLineEgo(Base): + __tablename__ = 'wn_abw_results_line_ego' __table_args__ = {'schema': 'model_draft'} - id = Column(Integer, primary_key=True, - server_default=text("nextval('model_draft.ego_grid_lv_branchtee_id_seq'::regclass)")) - run_id = Column(BigInteger) - id_db = Column(String(36)) - geom = Column(Geometry('POINT', 4326)) - lv_grid_id_db = Column(String(22)) + line_id = Column(BigInteger, primary_key=True) + loading_max = Column(Float(53), server_default=text("0")) + loading_mean = Column(Float(53), server_default=text("0")) -class EgoGridLvGrid(Base): - __tablename__ = 'ego_grid_lv_grid' +class WnAbwStatsResPowerplantsPerMvgd(Base): + __tablename__ = 'wn_abw_stats_res_powerplants_per_mvgd' __table_args__ = {'schema': 'model_draft'} - id = Column(Integer, primary_key=True, - server_default=text("nextval('model_draft.ego_grid_lv_grid_id_seq'::regclass)")) - run_id = Column(BigInteger) - id_db = Column(String(22)) - geom = Column(Geometry('MULTIPOLYGON', 4326)) #Todo: check if right srid? - lv_grid_id = Column(BigInteger) - population = Column(BigInteger) - voltage_nom = Column(Float(10)) #Todo: Check Datatypes + subst_id = Column(BigInteger, primary_key=True, nullable=False) + generation_type = Column(Text, primary_key=True, nullable=False) + count = Column(Integer) + capacity_mw = Column(Numeric) + annual_energy_gwh = Column(Numeric) + + +class EgoDemandPfLoadSingle(Base): + __tablename__ = 'ego_demand_pf_load_single' + __table_args__ = ( + ForeignKeyConstraint(['bus', 'scn_name'], ['model_draft.ego_grid_pf_hv_bus.bus_id', 'model_draft.ego_grid_pf_hv_bus.scn_name']), + {'schema': 'model_draft'} + ) + + scn_name = Column(String, nullable=False, server_default=text("'Status Quo'::character varying")) + load_id = Column(BigInteger, primary_key=True) + bus = Column(BigInteger) + sign = Column(Float(53), server_default=text("'-1'::integer")) + e_annual = Column(Float(53)) + ego_grid_pf_hv_bu = relationship('EgoGridPfHvBus') -class EgoGridLvGenerator(Base): - __tablename__ = 'ego_grid_lv_generator' + +class EgoGridPfHvBusVMagSet(Base): + __tablename__ = 'ego_grid_pf_hv_bus_v_mag_set' __table_args__ = {'schema': 'model_draft'} - id = Column(Integer, primary_key=True, - server_default=text("nextval('model_draft.ego_grid_lv_generator_id_seq'::regclass)")) - run_id = Column(BigInteger) - id_db = Column(String(34)) - geom = Column(Geometry('POINT', 4326)) - lv_grid_id_db = Column(String(22)) - type = Column(String(22)) - subtype = Column(String(22)) - v_level = Column(Integer) - nominal_capacity = Column(Float(10)) + scn_name = Column(String, primary_key=True, nullable=False, server_default=text("'Status Quo'::character varying")) + bus_id = Column(BigInteger, primary_key=True, nullable=False) + temp_id = Column(ForeignKey('model_draft.ego_grid_pf_hv_temp_resolution.temp_id'), primary_key=True, nullable=False) + v_mag_pu_set = Column(ARRAY(Float(precision=53))) + + temp = relationship('EgoGridPfHvTempResolution') -class EgoGridLvLoad(Base): - __tablename__ = 'ego_grid_lv_load' +t_ego_grid_pf_hv_extension_generator = Table( + 'ego_grid_pf_hv_extension_generator', metadata, + Column('scn_name', String, nullable=False, server_default=text("'Status Quo'::character varying")), + Column('generator_id', BigInteger, nullable=False), + Column('bus', BigInteger), + Column('dispatch', Text, server_default=text("'flexible'::text")), + Column('control', Text, server_default=text("'PQ'::text")), + Column('p_nom', Float(53), server_default=text("0")), + Column('p_nom_extendable', Boolean, server_default=text("false")), + Column('p_nom_min', Float(53), server_default=text("0")), + Column('p_nom_max', Float(53)), + Column('p_min_pu_fixed', Float(53), server_default=text("0")), + Column('p_max_pu_fixed', Float(53), server_default=text("1")), + Column('sign', Float(53), server_default=text("1")), + Column('source', ForeignKey('model_draft.ego_grid_pf_hv_source.source_id')), + Column('marginal_cost', Float(53)), + Column('capital_cost', Float(53)), + Column('efficiency', Float(53)), + schema='model_draft' +) + + +t_ego_grid_pf_hv_extension_generator_pq_set = Table( + 'ego_grid_pf_hv_extension_generator_pq_set', metadata, + Column('scn_name', String, nullable=False, server_default=text("'Status Quo'::character varying")), + Column('generator_id', BigInteger, nullable=False), + Column('temp_id', ForeignKey('model_draft.ego_grid_pf_hv_temp_resolution.temp_id'), nullable=False), + Column('p_set', ARRAY(Float(precision=53))), + Column('q_set', ARRAY(Float(precision=53))), + Column('p_min_pu', ARRAY(Float(precision=53))), + Column('p_max_pu', ARRAY(Float(precision=53))), + schema='model_draft' +) + + +class EgoGridPfHvExtensionLoadPqSet(Base): + __tablename__ = 'ego_grid_pf_hv_extension_load_pq_set' __table_args__ = {'schema': 'model_draft'} - id = Column(Integer, primary_key=True, - server_default=text("nextval('model_draft.ego_grid_lv_load_id_seq'::regclass)")) - run_id = Column(BigInteger) - id_db = Column(String(26)) - geom = Column(Geometry('POINT', 4326)) - lv_grid_id_db = Column(String(22)) - consumption = Column(String(22)) + scn_name = Column(String, primary_key=True, nullable=False, server_default=text("'Status Quo'::character varying")) + load_id = Column(BigInteger, primary_key=True, nullable=False) + temp_id = Column(ForeignKey('model_draft.ego_grid_pf_hv_temp_resolution.temp_id'), primary_key=True, nullable=False) + p_set = Column(ARRAY(Float(precision=53))) + q_set = Column(ARRAY(Float(precision=53))) + + temp = relationship('EgoGridPfHvTempResolution') -class EgoGridLvmvStation(Base): - __tablename__ = 'ego_grid_lvmv_station' +class EgoGridPfHvGenerator(Base): + __tablename__ = 'ego_grid_pf_hv_generator' __table_args__ = {'schema': 'model_draft'} - id = Column(Integer, primary_key=True, - server_default=text("nextval('model_draft.ego_grid_lvmv_station_id_seq'::regclass)")) - run_id = Column(BigInteger) - id_db = Column(String(27)) - geom = Column(Geometry('POINT', 4326)) - lv_grid_id_db = Column(String(22)) + scn_name = Column(String, primary_key=True, nullable=False, server_default=text("'Status Quo'::character varying")) + generator_id = Column(BigInteger, primary_key=True, nullable=False) + bus = Column(BigInteger) + dispatch = Column(Text, server_default=text("'flexible'::text")) + control = Column(Text, server_default=text("'PQ'::text")) + p_nom = Column(Float(53), server_default=text("0")) + p_nom_extendable = Column(Boolean, server_default=text("false")) + p_nom_min = Column(Float(53), server_default=text("0")) + p_nom_max = Column(Float(53)) + p_min_pu_fixed = Column(Float(53), server_default=text("0")) + p_max_pu_fixed = Column(Float(53), server_default=text("1")) + sign = Column(Float(53), server_default=text("1")) + source = Column(ForeignKey('model_draft.ego_grid_pf_hv_source.source_id'), index=True) + marginal_cost = Column(Float(53)) + capital_cost = Column(Float(53)) + efficiency = Column(Float(53)) + + ego_grid_pf_hv_source = relationship('EgoGridPfHvSource') -class EgoGridLvTransformer(Base): - __tablename__ = 'ego_grid_lv_transformer' +class EgoGridPfHvGeneratorPqSet(Base): + __tablename__ = 'ego_grid_pf_hv_generator_pq_set' __table_args__ = {'schema': 'model_draft'} - id = Column(Integer, primary_key=True, - server_default=text("nextval('model_draft.ego_grid_lv_transformer_id_seq'::regclass)")) - run_id = Column(BigInteger) - id_db = Column(String(29)) - geom = Column(Geometry('POINT', 4326)) - lv_grid_id_db = Column(String(22)) - voltage_op = Column(Float(10)) - S_nom = Column(Float(10)) - X = Column(Float(10)) - R = Column(Float(10)) + scn_name = Column(String, primary_key=True, nullable=False, server_default=text("'Status Quo'::character varying")) + generator_id = Column(BigInteger, primary_key=True, nullable=False) + temp_id = Column(ForeignKey('model_draft.ego_grid_pf_hv_temp_resolution.temp_id'), primary_key=True, nullable=False) + p_set = Column(ARRAY(Float(precision=53))) + q_set = Column(ARRAY(Float(precision=53))) + p_min_pu = Column(ARRAY(Float(precision=53))) + p_max_pu = Column(ARRAY(Float(precision=53))) + temp = relationship('EgoGridPfHvTempResolution') -class EgoGridLvmvMapping(Base): - __tablename__ = 'ego_grid_lvmv_mapping' + +class EgoGridPfHvLoadPqSet(Base): + __tablename__ = 'ego_grid_pf_hv_load_pq_set' __table_args__ = {'schema': 'model_draft'} - id = Column(Integer, primary_key=True, - server_default=text("nextval('model_draft.ego_grid_lvmv_mapping_id_seq'::regclass)")) - run_id = Column(BigInteger) - lv_grid_id = Column(Integer) - lv_grid_id_db = Column(String(30)) - mv_grid_id = Column(Integer) - mv_grid_id_db = Column(String(30)) + scn_name = Column(String, primary_key=True, nullable=False, server_default=text("'Status Quo'::character varying")) + load_id = Column(BigInteger, primary_key=True, nullable=False) + temp_id = Column(ForeignKey('model_draft.ego_grid_pf_hv_temp_resolution.temp_id'), primary_key=True, nullable=False) + p_set = Column(ARRAY(Float(precision=53))) + q_set = Column(ARRAY(Float(precision=53))) + temp = relationship('EgoGridPfHvTempResolution') -class EgoGridLine(Base): - __tablename__ = 'ego_grid_line' + +class EgoGridPfHvStorage(Base): + __tablename__ = 'ego_grid_pf_hv_storage' __table_args__ = {'schema': 'model_draft'} - id = Column(Integer, primary_key=True, - server_default=text("nextval('model_draft.ego_grid_line_id_seq'::regclass)")) - run_id = Column(BigInteger) - edge_name = Column(String(20)) - grid_id_db = Column(String(30)) - node1 = Column(String(40)) - node2 = Column(String(40)) - type_kind = Column(String(20)) - type_name = Column(String(30)) - length = Column(Float(10)) - U_n = Column(Float(10)) - C = Column(Float(10)) - L = Column(Float(10)) - R = Column(Float(10)) - I_max_th = Column(Float(10)) + scn_name = Column(String, primary_key=True, nullable=False, server_default=text("'Status Quo'::character varying")) + storage_id = Column(BigInteger, primary_key=True, nullable=False) + bus = Column(BigInteger) + dispatch = Column(Text, server_default=text("'flexible'::text")) + control = Column(Text, server_default=text("'PQ'::text")) + p_nom = Column(Float(53), server_default=text("0")) + p_nom_extendable = Column(Boolean, server_default=text("false")) + p_nom_min = Column(Float(53), server_default=text("0")) + p_nom_max = Column(Float(53)) + p_min_pu_fixed = Column(Float(53), server_default=text("0")) + p_max_pu_fixed = Column(Float(53), server_default=text("1")) + sign = Column(Float(53), server_default=text("1")) + source = Column(ForeignKey('model_draft.ego_grid_pf_hv_source.source_id'), index=True) + marginal_cost = Column(Float(53)) + capital_cost = Column(Float(53)) + efficiency = Column(Float(53)) + soc_initial = Column(Float(53)) + soc_cyclic = Column(Boolean, server_default=text("false")) + max_hours = Column(Float(53)) + efficiency_store = Column(Float(53)) + efficiency_dispatch = Column(Float(53)) + standing_loss = Column(Float(53)) + ego_grid_pf_hv_source = relationship('EgoGridPfHvSource') -class EgoGridMvCircuitbreaker(Base): - __tablename__ = 'ego_grid_mv_circuitbreaker' + +class EgoGridPfHvStoragePqSet(Base): + __tablename__ = 'ego_grid_pf_hv_storage_pq_set' __table_args__ = {'schema': 'model_draft'} - id = Column(Integer, primary_key=True, - server_default=text("nextval('model_draft.ego_grid_mv_circuitbreaker_id_seq'::regclass)")) - run_id = Column(BigInteger) - id_db = Column(String(36)) - geom = Column(Geometry('POINT', 4326)) - mv_grid_id_db = Column(String(30)) - mv_grid_id = Column(Integer) - status = Column(String(6)) + scn_name = Column(String, primary_key=True, nullable=False, server_default=text("'Status Quo'::character varying")) + storage_id = Column(BigInteger, primary_key=True, nullable=False) + temp_id = Column(ForeignKey('model_draft.ego_grid_pf_hv_temp_resolution.temp_id'), primary_key=True, nullable=False) + p_set = Column(ARRAY(Float(precision=53))) + q_set = Column(ARRAY(Float(precision=53))) + p_min_pu = Column(ARRAY(Float(precision=53))) + p_max_pu = Column(ARRAY(Float(precision=53))) + soc_set = Column(ARRAY(Float(precision=53))) + inflow = Column(ARRAY(Float(precision=53))) + + temp = relationship('EgoGridPfHvTempResolution') -class EgoGridMvBranchtee(Base): - __tablename__ = 'ego_grid_mv_branchtee' +class EgoSupplyPfGeneratorSingle(Base): + __tablename__ = 'ego_supply_pf_generator_single' __table_args__ = {'schema': 'model_draft'} - id = Column(Integer, primary_key=True, - server_default=text("nextval('model_draft.ego_grid_mv_branchtee_id_seq'::regclass)")) - run_id = Column(BigInteger) - id_db = Column(String(36)) - geom = Column(Geometry('POINT', 4326)) - mv_grid_id_db = Column(String(22)) + scn_name = Column(String, primary_key=True, nullable=False, server_default=text("'Status Quo'::character varying")) + generator_id = Column(BigInteger, primary_key=True, nullable=False) + bus = Column(BigInteger) + dispatch = Column(Text, server_default=text("'flexible'::text")) + control = Column(Text, server_default=text("'PQ'::text")) + p_nom = Column(Float(53), server_default=text("0")) + p_nom_extendable = Column(Boolean, server_default=text("false")) + p_nom_min = Column(Float(53), server_default=text("0")) + p_nom_max = Column(Float(53)) + p_min_pu_fixed = Column(Float(53), server_default=text("0")) + p_max_pu_fixed = Column(Float(53), server_default=text("1")) + sign = Column(Float(53), server_default=text("1")) + source = Column(ForeignKey('model_draft.ego_grid_pf_hv_source.source_id')) + marginal_cost = Column(Float(53)) + capital_cost = Column(Float(53)) + efficiency = Column(Float(53)) + w_id = Column(BigInteger) + aggr_id = Column(BigInteger) + power_class = Column(BigInteger) + voltage_level = Column(SmallInteger) + + ego_grid_pf_hv_source = relationship('EgoGridPfHvSource') -class EgoGridMvGrid(Base): - __tablename__ = 'ego_grid_mv_grid' +class EgoSupplyPfStorageSingle(Base): + __tablename__ = 'ego_supply_pf_storage_single' __table_args__ = {'schema': 'model_draft'} - id = Column(Integer, primary_key=True, - server_default=text("nextval('model_draft.ego_grid_mv_grid_id_seq'::regclass)")) - run_id = Column(BigInteger) - id_db = Column(String(22)) - geom = Column(Geometry('MULTIPOLYGON', 4326)) #Todo: check if right srid? - mv_grid_id = Column(BigInteger) - population = Column(BigInteger) - voltage_nom = Column(Float(10)) #Todo: Check Datatypes + scn_name = Column(String, primary_key=True, nullable=False, server_default=text("'Status Quo'::character varying")) + storage_id = Column(BigInteger, primary_key=True, nullable=False) + bus = Column(BigInteger) + dispatch = Column(Text, server_default=text("'flexible'::text")) + control = Column(Text, server_default=text("'PQ'::text")) + p_nom = Column(Float(53), server_default=text("0")) + p_nom_extendable = Column(Boolean, server_default=text("false")) + p_nom_min = Column(Float(53), server_default=text("0")) + p_nom_max = Column(Float(53)) + p_min_pu_fixed = Column(Float(53), server_default=text("'-1'::integer")) + p_max_pu_fixed = Column(Float(53), server_default=text("1")) + sign = Column(Float(53), server_default=text("1")) + source = Column(ForeignKey('model_draft.ego_grid_pf_hv_source.source_id')) + marginal_cost = Column(Float(53)) + capital_cost = Column(Float(53)) + efficiency = Column(Float(53)) + soc_initial = Column(Float(53)) + soc_cyclic = Column(Boolean, server_default=text("true")) + max_hours = Column(Float(53)) + efficiency_store = Column(Float(53)) + efficiency_dispatch = Column(Float(53)) + standing_loss = Column(Float(53)) + aggr_id = Column(Integer) + ego_grid_pf_hv_source = relationship('EgoGridPfHvSource') -class EgoGridMvGenerator(Base): - __tablename__ = 'ego_grid_mv_generator' + +class OpenfredValue(Base): + __tablename__ = 'openfred_values' __table_args__ = {'schema': 'model_draft'} - id = Column(Integer, primary_key=True, - server_default=text("nextval('model_draft.ego_grid_mv_generator_id_seq'::regclass)")) - run_id = Column(BigInteger) - id_db = Column(String(34)) - geom = Column(Geometry('POINT', 4326)) - mv_grid_id_db = Column(String(22)) - type = Column(String(22)) - subtype = Column(String(22)) - v_level = Column(Integer) - nominal_capacity = Column(Float(10)) + id = Column(BigInteger, primary_key=True, server_default=text("nextval('model_draft.openfred_values_id_seq'::regclass)")) + v = Column(Float(53), nullable=False) + altitude = Column(Float(53)) + timestamp_id = Column(ForeignKey('model_draft.openfred_timestamps.id'), nullable=False, server_default=text("1")) + location_id = Column(ForeignKey('model_draft.openfred_locations.id'), nullable=False) + variable_id = Column(ForeignKey('model_draft.openfred_variables.id'), nullable=False) + + location = relationship('OpenfredLocation') + timestamp = relationship('OpenfredTimestamp') + variable = relationship('OpenfredVariable') -class EgoGridMvLoad(Base): - __tablename__ = 'ego_grid_mv_load' +class RenpassGisEconomicLinearTransformer(Base): + __tablename__ = 'renpass_gis_economic_linear_transformer' __table_args__ = {'schema': 'model_draft'} - id = Column(Integer, primary_key=True, - server_default=text("nextval('model_draft.ego_grid_mv_load_id_seq'::regclass)")) - run_id = Column(BigInteger) - id_db = Column(String(26)) - geom = Column(Geometry('POINT', 4326)) - mv_grid_id_db = Column(String(22)) - consumption = Column(String(22)) + id = Column(BigInteger, primary_key=True, server_default=text("nextval('model_draft.renpass_gis_economic_linear_transformer_id_seq'::regclass)")) + scenario_id = Column(ForeignKey('model_draft.renpass_gis_economic_scenario.id')) + label = Column(String(250)) + source = Column(String(250)) + target = Column(String(250)) + conversion_factors = Column(ARRAY(Numeric())) + summed_min = Column(ARRAY(Numeric())) + nominal_value = Column(ARRAY(Numeric())) + actual_value = Column(ARRAY(Numeric())) + fixed = Column(Boolean) + variable_costs = Column(ARRAY(Numeric())) + fixed_costs = Column(ARRAY(Numeric())) + + scenario = relationship('RenpassGisEconomicScenario') -class EgoGridMvhvStation(Base): - __tablename__ = 'ego_grid_mvhv_station' +class RenpassGisEconomicSink(Base): + __tablename__ = 'renpass_gis_economic_sink' __table_args__ = {'schema': 'model_draft'} - id = Column(Integer, primary_key=True, - server_default=text("nextval('model_draft.ego_grid_mvhv_station_id_seq'::regclass)")) - run_id = Column(BigInteger) - id_db = Column(String(27)) - geom = Column(Geometry('POINT', 4326)) - mv_grid_id_db = Column(String(22)) - lv_grid_id_db = Column(String(22)) + id = Column(BigInteger, primary_key=True, server_default=text("nextval('model_draft.renpass_gis_economic_sink_id_seq'::regclass)")) + scenario_id = Column(ForeignKey('model_draft.renpass_gis_economic_scenario.id')) + label = Column(String(250)) + source = Column(String(250)) + target = Column(String(250)) + nominal_value = Column(ARRAY(Numeric())) + actual_value = Column(ARRAY(Numeric())) + fixed = Column(Boolean) + + scenario = relationship('RenpassGisEconomicScenario') + +class RenpassGisEconomicSource(Base): + __tablename__ = 'renpass_gis_economic_source' + __table_args__ = {'schema': 'model_draft'} + + id = Column(BigInteger, primary_key=True, server_default=text("nextval('model_draft.renpass_gis_economic_source_id_seq'::regclass)")) + scenario_id = Column(ForeignKey('model_draft.renpass_gis_economic_scenario.id')) + label = Column(String(250)) + source = Column(String(250)) + target = Column(String(250)) + nominal_value = Column(ARRAY(Numeric())) + actual_value = Column(ARRAY(Numeric())) + variable_costs = Column(ARRAY(Numeric())) + fixed = Column(Boolean) -class EgoGridMvTransformer(Base): - __tablename__ = 'ego_grid_mv_transformer' + scenario = relationship('RenpassGisEconomicScenario') + + +class RenpassGisEconomicStorage(Base): + __tablename__ = 'renpass_gis_economic_storage' __table_args__ = {'schema': 'model_draft'} - id = Column(Integer, primary_key=True, - server_default=text("nextval('model_draft.ego_grid_mv_transformer_id_seq'::regclass)")) - run_id = Column(BigInteger) - id_db = Column(String(29)) - geom = Column(Geometry('POINT', 4326)) - mv_grid_id_db = Column(String(22)) - voltage_op = Column(Float(10)) - S_nom = Column(Float(10)) - X = Column(Float(10)) - R = Column(Float(10)) - lv_grid_id_db = Column(String(2)) + id = Column(BigInteger, primary_key=True, server_default=text("nextval('model_draft.renpass_gis_economic_storage_id_seq'::regclass)")) + scenario_id = Column(ForeignKey('model_draft.renpass_gis_economic_scenario.id')) + label = Column(String(250)) + source = Column(String(250)) + target = Column(String(250)) + conversion_factors = Column(ARRAY(Numeric())) + summed_min = Column(ARRAY(Numeric())) + nominal_value = Column(ARRAY(Numeric())) + min = Column(ARRAY(Numeric())) + max = Column(ARRAY(Numeric())) + actual_value = Column(ARRAY(Numeric())) + fixed = Column(Boolean) + variable_costs = Column(ARRAY(Numeric())) + fixed_costs = Column(ARRAY(Numeric())) + nominal_capacity = Column(ARRAY(Numeric())) + capacity_loss = Column(ARRAY(Numeric())) + inflow_conversion_factor = Column(ARRAY(Numeric())) + outflow_conversion_factor = Column(ARRAY(Numeric())) + initial_capacity = Column(ARRAY(Numeric())) + capacity_min = Column(ARRAY(Numeric())) + capacity_max = Column(ARRAY(Numeric())) + + scenario = relationship('RenpassGisEconomicScenario') + + +class RenpassGisScenarioResult(Base): + __tablename__ = 'renpass_gis_scenario_results' + __table_args__ = {'schema': 'model_draft'} + + id = Column(BigInteger, primary_key=True, server_default=text("nextval('model_draft.renpass_gis_scenario_results_id_seq'::regclass)")) + scenario_id = Column(ForeignKey('model_draft.renpass_gis_economic_scenario.id')) + bus_label = Column(String(250)) + type = Column(String(250)) + obj_label = Column(String(250)) + datetime = Column(DateTime) + val = Column(Numeric) + + scenario = relationship('RenpassGisEconomicScenario') diff --git a/egoio/db_tables/openstreetmap.py b/egoio/db_tables/openstreetmap.py index aafb2b5..d322e45 100644 --- a/egoio/db_tables/openstreetmap.py +++ b/egoio/db_tables/openstreetmap.py @@ -4,7 +4,6 @@ from geoalchemy2.types import Geometry from sqlalchemy.ext.declarative import declarative_base - Base = declarative_base() metadata = Base.metadata @@ -118,7 +117,7 @@ class OsmDeuNode(Base): id = Column(BigInteger, primary_key=True) lat = Column(Integer, nullable=False) lon = Column(Integer, nullable=False) - tags = Column(ARRAY(TEXT())) + tags = Column(ARRAY(Text())) class OsmDeuPoint(Base): @@ -198,6 +197,17 @@ class OsmDeuPoint(Base): gid = Column(Integer, primary_key=True, server_default=text("nextval('openstreetmap.osm_deu_point_gid_seq'::regclass)")) +class OsmDeuPointWindpower(Base): + __tablename__ = 'osm_deu_point_windpower' + __table_args__ = {'schema': 'openstreetmap'} + + gid = Column(Integer, primary_key=True) + osm_id = Column(BigInteger) + building = Column(Text) + tags = Column(HSTORE(Text())) + geom = Column(Geometry, index=True) + + class OsmDeuPolygon(Base): __tablename__ = 'osm_deu_polygon' __table_args__ = {'schema': 'openstreetmap'} @@ -448,9 +458,9 @@ class OsmDeuRel(Base): id = Column(BigInteger, primary_key=True, index=True) way_off = Column(SmallInteger) rel_off = Column(SmallInteger) - parts = Column(ARRAY(BIGINT()), index=True) - members = Column(ARRAY(TEXT())) - tags = Column(ARRAY(TEXT())) + parts = Column(ARRAY(BigInteger()), index=True) + members = Column(ARRAY(Text())) + tags = Column(ARRAY(Text())) pending = Column(Boolean, nullable=False) @@ -542,6 +552,6 @@ class OsmDeuWay(Base): __table_args__ = {'schema': 'openstreetmap'} id = Column(BigInteger, primary_key=True, index=True) - nodes = Column(ARRAY(BIGINT()), nullable=False, index=True) - tags = Column(ARRAY(TEXT())) + nodes = Column(ARRAY(BigInteger()), nullable=False, index=True) + tags = Column(ARRAY(Text())) pending = Column(Boolean, nullable=False) diff --git a/egoio/db_tables/reference.py b/egoio/db_tables/reference.py index a5363cf..337843d 100644 --- a/egoio/db_tables/reference.py +++ b/egoio/db_tables/reference.py @@ -3,75 +3,10 @@ from sqlalchemy.orm import relationship from sqlalchemy.ext.declarative import declarative_base - Base = declarative_base() metadata = Base.metadata -class Entry(Base): - __tablename__ = 'entries' - __table_args__ = {'schema': 'reference'} - - entries_id = Column(Integer, primary_key=True, server_default=text("nextval('reference.entries_entries_id_seq'::regclass)")) - jabref_eid = Column(String(8), server_default=text("NULL::character varying")) - database_id = Column(ForeignKey('reference.jabref_database.database_id')) - entry_types_id = Column(ForeignKey('reference.entry_types.entry_types_id')) - cite_key = Column(String(100), server_default=text("NULL::character varying")) - abstract = Column(Text) - address = Column(Text) - annote = Column(Text) - author = Column(Text) - booktitle = Column(Text) - chapter = Column(Text) - comment = Column(Text) - crossref = Column(Text) - doi = Column(Text) - edition = Column(Text) - editor = Column(Text) - eid = Column(Text) - file = Column(Text) - howpublished = Column(Text) - institution = Column(Text) - journal = Column(Text) - key_ = Column(Text) - keywords = Column(Text) - language = Column(Text) - location = Column(Text) - month = Column(Text) - note = Column(Text) - number = Column(Text) - organization = Column(Text) - pages = Column(Text) - pdf = Column(Text) - pmid = Column(Text) - priority = Column(Text) - ps = Column(Text) - publisher = Column(Text) - qualityassured = Column(Text) - ranking = Column(Text) - relevance = Column(Text) - school = Column(Text) - search = Column(Text) - series = Column(Text) - title = Column(Text) - type = Column(Text) - url = Column(Text) - volume = Column(Text) - year = Column(Text) - - database = relationship('JabrefDatabase') - entry_types = relationship('EntryType') - groupss = relationship('Group', secondary='entry_group') - - -t_entry_group = Table( - 'entry_group', metadata, - Column('entries_id', ForeignKey('reference.entries.entries_id', ondelete='CASCADE'), primary_key=True, nullable=False, server_default=text("nextval('reference.entry_group_entries_id_seq'::regclass)")), - Column('groups_id', ForeignKey('reference.groups.groups_id'), primary_key=True, nullable=False), - schema='reference' -) - - class EntryType(Base): __tablename__ = 'entry_types' __table_args__ = {'schema': 'reference'} @@ -129,24 +64,6 @@ class GroupType(Base): label = Column(String(100), server_default=text("NULL::character varying")) -class Group(Base): - __tablename__ = 'groups' - __table_args__ = {'schema': 'reference'} - - groups_id = Column(Integer, primary_key=True, server_default=text("nextval('reference.groups_groups_id_seq'::regclass)")) - group_types_id = Column(Integer) - label = Column(String(100), server_default=text("NULL::character varying")) - database_id = Column(ForeignKey('reference.jabref_database.database_id')) - parent_id = Column(Integer) - search_field = Column(String(100), server_default=text("NULL::character varying")) - search_expression = Column(String(200), server_default=text("NULL::character varying")) - case_sensitive = Column(Boolean) - reg_exp = Column(Boolean) - hierarchical_context = Column(Integer) - - database = relationship('JabrefDatabase') - - class JabrefDatabase(Base): __tablename__ = 'jabref_database' __table_args__ = {'schema': 'reference'} @@ -164,10 +81,84 @@ class ReferenceToEntry(Base): ref_data_json = Column(JSON) schema_name = Column(String, nullable=False) tbl_name = Column(String, nullable=False) - changed_by = Column(String(20), server_default=text("current_user()")) + changed_by = Column(String(20), server_default=text("\"current_user\"()")) lastmodified = Column(DateTime, server_default=text("now()")) +class Entry(Base): + __tablename__ = 'entries' + __table_args__ = {'schema': 'reference'} + + entries_id = Column(Integer, primary_key=True, server_default=text("nextval('reference.entries_entries_id_seq'::regclass)")) + jabref_eid = Column(String(8), server_default=text("NULL::character varying")) + database_id = Column(ForeignKey('reference.jabref_database.database_id')) + entry_types_id = Column(ForeignKey('reference.entry_types.entry_types_id')) + cite_key = Column(String(100), server_default=text("NULL::character varying")) + abstract = Column(Text) + address = Column(Text) + annote = Column(Text) + author = Column(Text) + booktitle = Column(Text) + chapter = Column(Text) + comment = Column(Text) + crossref = Column(Text) + doi = Column(Text) + edition = Column(Text) + editor = Column(Text) + eid = Column(Text) + file = Column(Text) + howpublished = Column(Text) + institution = Column(Text) + journal = Column(Text) + key_ = Column(Text) + keywords = Column(Text) + language = Column(Text) + location = Column(Text) + month = Column(Text) + note = Column(Text) + number = Column(Text) + organization = Column(Text) + pages = Column(Text) + pdf = Column(Text) + pmid = Column(Text) + priority = Column(Text) + ps = Column(Text) + publisher = Column(Text) + qualityassured = Column(Text) + ranking = Column(Text) + relevance = Column(Text) + school = Column(Text) + search = Column(Text) + series = Column(Text) + title = Column(Text) + type = Column(Text) + url = Column(Text) + volume = Column(Text) + year = Column(Text) + + database = relationship('JabrefDatabase') + entry_types = relationship('EntryType') + groupss = relationship('Group', secondary='reference.entry_group') + + +class Group(Base): + __tablename__ = 'groups' + __table_args__ = {'schema': 'reference'} + + groups_id = Column(Integer, primary_key=True, server_default=text("nextval('reference.groups_groups_id_seq'::regclass)")) + group_types_id = Column(Integer) + label = Column(String(100), server_default=text("NULL::character varying")) + database_id = Column(ForeignKey('reference.jabref_database.database_id')) + parent_id = Column(Integer) + search_field = Column(String(100), server_default=text("NULL::character varying")) + search_expression = Column(String(200), server_default=text("NULL::character varying")) + case_sensitive = Column(Boolean) + reg_exp = Column(Boolean) + hierarchical_context = Column(Integer) + + database = relationship('JabrefDatabase') + + class String(Base): __tablename__ = 'strings' __table_args__ = {'schema': 'reference'} @@ -178,3 +169,11 @@ class String(Base): database_id = Column(ForeignKey('reference.jabref_database.database_id')) database = relationship('JabrefDatabase') + + +t_entry_group = Table( + 'entry_group', metadata, + Column('entries_id', ForeignKey('reference.entries.entries_id', ondelete='CASCADE'), primary_key=True, nullable=False, server_default=text("nextval('reference.entry_group_entries_id_seq'::regclass)")), + Column('groups_id', ForeignKey('reference.groups.groups_id'), primary_key=True, nullable=False), + schema='reference' +) diff --git a/egoio/db_tables/scenario.py b/egoio/db_tables/scenario.py index 8afa524..541b9d2 100644 --- a/egoio/db_tables/scenario.py +++ b/egoio/db_tables/scenario.py @@ -3,7 +3,6 @@ from geoalchemy2.types import Geometry from sqlalchemy.ext.declarative import declarative_base - Base = declarative_base() metadata = Base.metadata diff --git a/egoio/db_tables/society.py b/egoio/db_tables/society.py index 30d9f8d..6f943d6 100644 --- a/egoio/db_tables/society.py +++ b/egoio/db_tables/society.py @@ -3,7 +3,6 @@ from geoalchemy2.types import Geometry from sqlalchemy.ext.declarative import declarative_base - Base = declarative_base() metadata = Base.metadata diff --git a/egoio/db_tables/supply.py b/egoio/db_tables/supply.py index 4cee253..0725824 100644 --- a/egoio/db_tables/supply.py +++ b/egoio/db_tables/supply.py @@ -1,14 +1,94 @@ # coding: utf-8 -from sqlalchemy import ARRAY, BigInteger, Column, DateTime, Float, Integer, Numeric, SmallInteger, String, Table, Text, text +from sqlalchemy import ARRAY, BigInteger, Column, Date, DateTime, Float, Integer, Numeric, SmallInteger, String, Table, Text, text from geoalchemy2.types import Geometry from sqlalchemy.ext.declarative import declarative_base -from sqlalchemy.dialects.postgresql import REAL - Base = declarative_base() metadata = Base.metadata +class BnetzaEegAnlagenstammdaten(Base): + __tablename__ = 'bnetza_eeg_anlagenstammdaten' + __table_args__ = {'schema': 'supply'} + + id = Column(Integer, primary_key=True, server_default=text("nextval('supply.bnetza_eeg_anlagenstammdaten_id_seq'::regclass)")) + version = Column(Text) + meldedatum = Column(Date) + meldegrund = Column(Text) + anlagennummer = Column(String(14)) + _1_8_eeg_anlagenschlüssel = Column('1.8_eeg-anlagenschl\xfcssel', Text) + _3_1_genehmigungs_datum = Column('3.1_genehmigungs-datum', Date) + _3_2_genehmigungs_behörde = Column('3.2_genehmigungs-beh\xf6rde', Text) + _3_3_genehmigungs_aktenzeichen = Column('3.3_genehmigungs-aktenzeichen', Text) + _3_4_geplantes_inbetriebnahme_datum = Column('3.4_geplantes_inbetriebnahme-datum', Date) + _3_5_errichtungs_frist = Column('3.5_errichtungs-frist', Date) + _4_1_energieträger = Column('4.1_energietr\xe4ger', Text) + _4_2_installierte_leistung = Column('4.2_installierte_leistung', Float(53)) + _4_2_1_inst__leistung_vor_änderung = Column('4.2.1_inst._leistung_vor_\xe4nderung', Float(53)) + _4_2_2_inst__leistung_nach_änderung = Column('4.2.2_inst._leistung_nach_\xe4nderung', Float(53)) + _4_3_tatsächliche_inbetriebnahme = Column('4.3_tats\xe4chliche_inbetriebnahme', Date) + _4_4_datum_leistungsänderung = Column('4.4_datum_leistungs\xe4nderung', Date) + _4_5_stilllegungsdatum = Column('4.5_stilllegungsdatum', Date) + _4_6_name_der_anlage = Column('4.6_name_der_anlage', Text) + _4_7_strasse_bzw__flurstück = Column('4.7_strasse_bzw._flurst\xfcck', Text) + _4_8_hausnummer = Column('4.8_hausnummer', Text) + _4_9_postleitzahl = Column('4.9_postleitzahl', Text) + _4_10_ort_bzw__gemarkung = Column('4.10_ort_bzw._gemarkung', Text) + _4_10_1_gemeindeschlüssel = Column('4.10_1_gemeindeschl\xfcssel', Text) + _4_11_bundesland = Column('4.11_bundesland', Text) + _4_12_utm_zonenwert = Column('4.12_utm-zonenwert', Integer) + _4_12_utm_east = Column('4.12_utm-east', Float(53)) + _4_12_utm_north = Column('4.12_utm-north', Float(53)) + _4_13_zugehörigkeit_anlagenpark = Column('4.13_zugeh\xf6rigkeit_anlagenpark', Text) + _4_13_1_name_des_anlagenparks = Column('4.13.1_name_des_anlagenparks', Text) + _4_14_spannungsebene = Column('4.14_spannungsebene', Text) + _4_15_netzanschlusspunkt = Column('4.15_netzanschlusspunkt', Text) + _4_15_1_zählpunktbezeichnung = Column('4.15.1_z\xe4hlpunktbezeichnung', Text) + _4_16_name_des_netzbetreibers = Column('4.16_name_des_netzbetreibers', Text) + _4_17_fernsteuerbarkeit_durch = Column('4.17_fernsteuerbarkeit_durch', Text) + _4_18_gemeinsame_techn__einrichtung = Column('4.18_gemeinsame_techn._einrichtung', Text) + _4_19_inanspruchnahme_finanzielle_Förderung = Column('4.19_inanspruchnahme_finanzielle_F\xf6rderung', Text) + _4_20_Eigenverbrauch_geplant = Column('4.20_Eigenverbrauch_geplant', Text) + _5_1_eingesetzte_biomasse = Column('5.1_eingesetzte_biomasse', Text) + _5_2_ausschließlich_biomasse = Column('5.2_ausschlie\xdflich_biomasse', Text) + _5_3_flexprämie_eeg = Column('5.3_flexpr\xe4mie_eeg', Text) + _5_4_erstmalige_inanspruchnahme_flexprämie = Column('5.4_erstmalige_inanspruchnahme_flexpr\xe4mie', Date) + _5_4_1_leistungserhöhung_flexprämie = Column('5.4.1_leistungserh\xf6hung_flexpr\xe4mie', Text) + _5_4_2_datum_leistungserhöhung_flexprämie = Column('5.4.2_datum_leistungserh\xf6hung_flexpr\xe4mie', Date) + _5_4_3_umfang_der_leistungserhöhung = Column('5.4.3_umfang_der_leistungserh\xf6hung', Text) + _5_5_erstmalig_ausschließlich_biomethan = Column('5.5_erstmalig_ausschlie\xdflich_biomethan', Text) + _5_6_zustimmung_gesonderte_veröffentlich = Column('5.6_zustimmung_gesonderte_ver\xf6ffentlich', Text) + _6_1_kwk_anlage = Column('6.1_kwk-anlage', Text) + _6_2_thermische_leistung = Column('6.2_thermische_leistung', Float(53)) + _6_3_andere_energieträger = Column('6.3_andere_energietr\xe4ger', Text) + _6_4_eingesetzte_andere_energieträger = Column('6.4_eingesetzte_andere_energietr\xe4ger', Text) + _6_5_erstmalige_stromerzeugung = Column('6.5_erstmalige_stromerzeugung', Date) + _7_1_windanlagenhersteller = Column('7.1_windanlagenhersteller', Text) + _7_2_anlagentyp = Column('7.2_anlagentyp', Text) + _7_3_nabenhöhe = Column('7.3_nabenh\xf6he', Float(53)) + _7_4_rotordurch_messer = Column('7.4_rotordurch-messer', Float(53)) + _7_5_repowering = Column('7.5_repowering', Text) + _7_6_stilllegung_gemeldet = Column('7.6_stilllegung_gemeldet', Text) + _7_7_1_mittlere_windgeschwindigkeit = Column('7.7.1_mittlere_windgeschwindigkeit', Float(53)) + _7_7_2_formparameter_weibull_verteilung = Column('7.7.2_formparameter_weibull-verteilung', Float(53)) + _7_7_3_skalenparameter_weibull_verteilung = Column('7.7.3_skalenparameter_weibull-verteilung', Float(53)) + _7_7_4_ertrags_einschätzung = Column('7.7.4_ertrags-einsch\xe4tzung', Float(53)) + _7_7_5_ertragseinschätzung_referenzertrag = Column('7.7.5_ertragseinsch\xe4tzung/referenzertrag', Float(53)) + _7_8_1_seelage = Column('7.8.1_seelage', Text) + _7_8_2_wassertiefe = Column('7.8.2_wassertiefe', Text) + _7_8_3_küstenentfernung = Column('7.8.3_k\xfcstenentfernung', Text) + _7_9_pilotwindanlage = Column('7.9_pilotwindanlage', Text) + _8_1_ertüchtigung_wasserkraftanlage = Column('8.1_ert\xfcchtigung_wasserkraftanlage', Text) + _8_2_art_der_ertüchtigung = Column('8.2_art_der_ert\xfcchtigung', Text) + _8_3_zulassungspflichtige_maßnahme = Column('8.3_zulassungspflichtige_ma\xdfnahme', Text) + _8_4__höhe_leistungssteigerung = Column('8.4._h\xf6he_leistungssteigerung', Float(53)) + _8_5_datum_der_ertüchtigung = Column('8.5_datum_der_ert\xfcchtigung', Date) + _9_1_zuschlagnummer_pv_freifläche = Column('9.1_zuschlagnummer_pv-freifl\xe4che', Text) + _9_2_fläche_pv_freiflächenanlage = Column('9.2_fl\xe4che_pv-freifl\xe4chenanlage', Float(53)) + _9_3_pv_freifläche_auf_ackerland = Column('9.3_pv-freifl\xe4che_auf_ackerland', Float(53)) + geom = Column(Geometry('POINT', 5652)) + + class EgoConventionalPowerplant(Base): __tablename__ = 'ego_conventional_powerplant' __table_args__ = {'schema': 'supply'} @@ -423,6 +503,32 @@ class EgoDpResPowerplant(Base): ) +class EgoPowerClas(Base): + __tablename__ = 'ego_power_class' + __table_args__ = {'schema': 'supply'} + + version = Column(Text, primary_key=True, nullable=False) + power_class_id = Column(Integer, primary_key=True, nullable=False) + lower_limit = Column(Float(53)) + upper_limit = Column(Float(53)) + wea = Column(Text) + h_hub = Column(Float(53)) + d_rotor = Column(Float(53)) + + +class EgoRenewableFeedin(Base): + __tablename__ = 'ego_renewable_feedin' + __table_args__ = {'schema': 'supply'} + + version = Column(Text, primary_key=True, nullable=False) + weather_scenario_id = Column(Integer, primary_key=True, nullable=False) + w_id = Column(Integer, primary_key=True, nullable=False) + source = Column(Text, primary_key=True, nullable=False) + weather_year = Column(Integer, primary_key=True, nullable=False) + feedin = Column(ARRAY(Float(precision=53))) + power_class = Column(Integer, primary_key=True, nullable=False) + + t_ego_renewable_power_plants_germany_hydro_mview = Table( 'ego_renewable_power_plants_germany_hydro_mview', metadata, Column('id', BigInteger), @@ -548,7 +654,7 @@ class ForwindOekoRenewableFeedinPerFederalstate(Base): year = Column(SmallInteger, nullable=False) federal_state = Column(Text) comment = Column(Text) - time_series = Column(ARRAY(REAL())) + time_series = Column(ARRAY(Float())) t_fred_dp_conv_powerplant_hydro_mview = Table( diff --git a/egoio/tools/db.py b/egoio/tools/db.py index 667efb2..6b778be 100644 --- a/egoio/tools/db.py +++ b/egoio/tools/db.py @@ -115,6 +115,7 @@ def get_connection_details(section): Used for configuration file parser language. """ print('Please enter your connection details:') + dialect = input('Enter input value for `dialect` (default: psycopg2): ') or 'psycopg2' username = input('Enter value for `username`: ') database = input('Enter value for `database`: ') host = input('Enter value for `host`: ') @@ -122,11 +123,12 @@ def get_connection_details(section): cfg = cp.ConfigParser() cfg.add_section(section) + cfg.set(section, 'dialect', dialect) cfg.set(section, 'username', username) cfg.set(section, 'host', host) cfg.set(section, 'port', port) cfg.set(section, 'database', database) - pw = getpass.getpass(prompt="Enter your password to " \ + pw = getpass.getpass(prompt="Enter your password/token to " \ "store it in " "keyring: ".format(database=section)) keyring.set_password(section, cfg.get(section, "username"), pw) @@ -226,7 +228,8 @@ def connection(filepath=None, section='oep'): # establish connection and return it conn = create_engine( - "postgresql+psycopg2://{user}:{password}@{host}:{port}/{db}".format( + "postgresql+{dialect}://{user}:{password}@{host}:{port}/{db}".format( + dialect=cfg.get(section, 'dialect', fallback='psycopg2'), user=cfg.get(section, 'username'), password=pw, host=cfg.get(section, 'host'), diff --git a/setup.py b/setup.py index 36a5917..c3cbe76 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ author='NEXT ENERGY, Reiner Lemoine Institut gGmbH, ZNES', author_email='ulf.p.mueller@hs-flensburg.de', description='ego input/output repository', - version='0.3.1', + version='0.4.0', url='https://github.com/openego/ego.io', packages=find_packages(), license='GNU Affero General Public License v3.0',